/* CKPerformance public site.
   Shares the coaching report's palette, type scale, and spacing so the upload
   screen and the delivered report read as one product. */

:root {
  color-scheme: light;
  --canvas: #f5f5f7;
  --card: #fff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --hairline: #d2d2d7;
  --hairline-soft: #e8e8ed;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: #f0f6ff;
  --alert: #c8102e;
  --s1: #1667d6;
  --s2: #17864a;
  --s3: #c9520f;
  --s4: #9a6a00;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Pretendard, "Apple SD Gothic Neo", sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  width: min(calc(100% - 40px), 720px);
  margin: auto;
  padding: 72px 0 96px;
}

/* Navigation ------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--hairline-soft);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 40px), 980px);
  height: 48px;
  margin: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-symbol {
  width: 20px;
  height: 20px;
  fill: var(--ink);
}

.nav-meta {
  color: var(--ink-3);
  font-size: 12px;
}

/* Hero ------------------------------------------------------------------- */

.hero {
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 6.4vw, 60px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.intro {
  max-width: 560px;
  margin: 20px auto 0;
  color: var(--ink-2);
  font-size: 19px;
  line-height: 1.47;
}

.preview {
  margin: 44px 0 0;
  padding: 20px 20px 16px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  background: var(--card);
}

.preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.preview-grid path {
  fill: none;
  stroke: var(--hairline-soft);
  stroke-width: 1;
}

.preview-grid .event {
  stroke: var(--hairline);
  stroke-dasharray: 2 4;
}

.preview-tick {
  fill: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-anchor: middle;
}

.preview-curve {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.preview-curve.c1,
.preview-peak.c1 {
  stroke: var(--s1);
  fill: none;
}
.preview-curve.c2,
.preview-peak.c2 {
  stroke: var(--s2);
}
.preview-curve.c3,
.preview-peak.c3 {
  stroke: var(--s3);
}
.preview-curve.c4,
.preview-peak.c4 {
  stroke: var(--s4);
}

.preview-peak.c1 {
  fill: var(--s1);
}
.preview-peak.c2 {
  fill: var(--s2);
}
.preview-peak.c3 {
  fill: var(--s3);
}
.preview-peak.c4 {
  fill: var(--s4);
}

.preview figcaption {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 12px;
}

.preview figcaption span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview figcaption i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.preview figcaption .s1 {
  background: var(--s1);
}
.preview figcaption .s2 {
  background: var(--s2);
}
.preview figcaption .s3 {
  background: var(--s3);
}
.preview figcaption .s4 {
  background: var(--s4);
}

/* Upload panel ----------------------------------------------------------- */

.panel {
  margin-top: 56px;
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  background: var(--card);
}

.panel-head h2 {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.022em;
}

.panel-head p {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 15px;
}

/* Drop zone -------------------------------------------------------------- */

.drop-zone {
  display: flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 188px;
  margin-top: 28px;
  padding: 28px 20px;
  border: 1.5px dashed var(--hairline);
  border-radius: 14px;
  background: var(--canvas);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
}

.drop-zone.has-file {
  border-style: solid;
  border-color: var(--hairline-soft);
  background: var(--card);
  min-height: 0;
  padding: 16px;
}

.drop-zone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-title {
  font-size: 16px;
  font-weight: 500;
}

.drop-note {
  color: var(--ink-3);
  font-size: 13px;
}

.drop-zone.has-file .upload-icon,
.drop-zone.has-file .drop-title,
.drop-zone.has-file .drop-note {
  display: none;
}

.file-selection {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.file-selection > svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.file-selection > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.file-selection strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-selection small {
  color: var(--ink-3);
  font-size: 12px;
}

#remove-file {
  width: 28px;
  height: 28px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--canvas);
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

#remove-file:hover {
  background: var(--hairline-soft);
}

/* Fields ----------------------------------------------------------------- */

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field > span {
  color: var(--ink-2);
  font-size: 13px;
}

.field input,
.field select {
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 38px;
}

.field input::placeholder {
  color: var(--ink-3);
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(0, 113, 227, 0.18);
  outline-offset: 0;
}

/* Submit and progress ---------------------------------------------------- */

.submit-button {
  width: 100%;
  height: 50px;
  margin-top: 26px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.submit-button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.submit-button:disabled {
  background: var(--ink-3);
  cursor: default;
}

.progress {
  display: none;
  overflow: hidden;
  width: 100%;
  height: 3px;
  margin-top: 14px;
  border-radius: 2px;
  background: var(--hairline-soft);
}

#analyze-form[data-busy="true"] .progress {
  display: block;
}

.progress i {
  display: block;
  width: 34%;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  animation: progress-slide 1.15s ease-in-out infinite;
}

@keyframes progress-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(330%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress i {
    width: 100%;
    animation: none;
  }
}

#analyze-status {
  margin: 16px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}

#analyze-status.error {
  color: var(--alert);
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--hairline-soft);
  color: var(--ink-3);
  font-size: 13px;
}

.privacy-note svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.privacy-note strong {
  color: var(--ink-2);
  font-weight: 600;
}

/* Footer ----------------------------------------------------------------- */

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(calc(100% - 40px), 720px);
  margin: 0 auto;
  padding: 22px 0 40px;
  border-top: 1px solid var(--hairline-soft);
  color: var(--ink-3);
  font-size: 12px;
}

footer p {
  margin: 0;
}

@media (max-width: 620px) {
  main {
    padding: 48px 0 64px;
  }

  .fields {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    gap: 6px;
  }
}
