/* ============================================================
   AI Résumé Matcher  "Precision Instrument" theme
   Warm ink ground · cream paper text · signal-amber accent
   Display: Fraunces · Body: Hanken Grotesk · Mono: JetBrains Mono
   ============================================================ */

:root {
  --ink:        #14110f;
  --ink-2:      #1b1714;
  --surface:    #211c18;
  --surface-2:  #2a241f;
  --line:       #3a322b;
  --cream:      #f4ede3;
  --cream-dim:  #cdc3b6;
  --muted:      #968b7d;
  --amber:      #e0a83d;
  --amber-deep: #b9802a;
  --sage:       #7fb069;
  --coral:      #e0533a;
  --shadow:     0 24px 60px -20px rgba(0,0,0,.7);
  --radius:     18px;
  --radius-sm:  11px;
  --maxw:       1140px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--cream);
  background:
    radial-gradient(1100px 700px at 78% -8%, rgba(224,168,61,.10), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, rgba(127,176,105,.06), transparent 55%),
    var(--ink);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-x: hidden;
}

/* ---- atmosphere ---- */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.glow {
  position: fixed; top: -30vh; right: -10vw; width: 60vw; height: 60vw;
  z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(224,168,61,.14), transparent 65%);
  filter: blur(20px);
}

/* ---- chrome ---- */
.site-head {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin: 0 auto;
  padding: 30px 28px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--cream); }
.brand-mark {
  font-size: 1.35rem; color: var(--amber);
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.brand-name { font-family: var(--serif); font-size: 1.32rem; font-weight: 600; letter-spacing: -.01em; }
.brand-name em { font-style: italic; color: var(--amber); font-weight: 500; }

.site-nav { display: flex; align-items: center; gap: 9px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); box-shadow: 0 0 0 0 rgba(150,139,125,.5);
}
.status-dot.is-ai { background: var(--sage); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(127,176,105,.5); }
  70% { box-shadow: 0 0 0 8px rgba(127,176,105,0); }
  100% { box-shadow: 0 0 0 0 rgba(127,176,105,0); }
}
.status-text { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

.page { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 0 28px 80px; }

.site-foot {
  position: relative; z-index: 1;
  max-width: var(--maxw); margin: 0 auto;
  padding: 28px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.site-foot a { color: var(--cream-dim); text-decoration: none; border-bottom: 1px solid var(--line); }
.site-foot a:hover { color: var(--amber); }
.foot-sep { opacity: .5; }

/* ---- flash ---- */
.flash-stack { max-width: var(--maxw); margin: 18px auto 0; padding: 0 28px; position: relative; z-index: 2; }
.flash {
  display: flex; align-items: center; gap: 12px;
  background: rgba(224,83,58,.12); border: 1px solid rgba(224,83,58,.4);
  color: #f4c9bf; padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: .92rem; margin-bottom: 10px;
  animation: drop .4s cubic-bezier(.2,.9,.3,1) both;
}
.flash-icon {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--coral); color: #fff; font-weight: 700;
  display: grid; place-items: center; font-size: .8rem;
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* ---- shared ---- */
.eyebrow {
  font-family: var(--mono); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .18em; color: var(--muted);
  display: flex; align-items: center; gap: 10px; margin: 0 0 18px;
}
.eyebrow-num { color: var(--amber); }
.src-tag {
  margin-left: auto; font-size: .66rem; padding: 3px 9px; border-radius: 100px;
  border: 1px solid var(--line); color: var(--muted); letter-spacing: .1em;
}
.src-tag.src-ai { color: var(--sage); border-color: rgba(127,176,105,.4); }

/* ============ HERO ============ */
.hero {
  padding: 64px 0 36px;
  display: grid; grid-template-columns: 1fr 360px;
  gap: 56px; align-items: center;
}
.hero-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: .98;
  letter-spacing: -.025em; margin: 0 0 26px;
}
.hero-title em { font-style: italic; color: var(--amber); font-weight: 500; }
.hero-lead { max-width: none; font-size: 1.12rem; color: var(--cream-dim); margin: 0; }

.hero-text > * { animation: rise .7s cubic-bezier(.2,.85,.3,1) both; }
.hero-text .eyebrow { animation-delay: .02s; }
.hero-title { animation-delay: .1s; }
.hero-lead { animation-delay: .22s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* hero preview card (sample report) */
.hero-preview { animation: rise .7s cubic-bezier(.2,.85,.3,1) .32s both; }
.preview-card {
  position: relative; text-align: center;
  background: linear-gradient(180deg, var(--surface), var(--ink-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px 26px; box-shadow: var(--shadow);
}
.preview-card::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(224,168,61,.5), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.preview-tag {
  font-family: var(--mono); font-size: .64rem; text-transform: uppercase;
  letter-spacing: .16em; color: var(--muted);
}
.preview-gauge { position: relative; width: 150px; height: 150px; margin: 16px auto 6px; }
.preview-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pg-track { fill: none; stroke: var(--line); stroke-width: 10; }
.pg-fill {
  fill: none; stroke: var(--coral); stroke-width: 10; stroke-linecap: round;
  animation: pg-draw 1.4s cubic-bezier(.2,.8,.2,1) .5s both;
}
@keyframes pg-draw { from { stroke-dashoffset: 326.7; } }
.preview-num {
  position: absolute; inset: 0; display: grid; place-content: center;
  font-family: var(--serif); font-size: 2.6rem; font-weight: 600; color: var(--coral);
}
.preview-num span { font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.preview-verdict { font-family: var(--serif); font-size: 1.3rem; margin: 0 0 14px; }
.preview-chips { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.pchip { font-size: .76rem; padding: 5px 11px; border-radius: 100px; border: 1px solid var(--line); }
.pchip--match { color: #cfe6c1; border-color: rgba(127,176,105,.4); background: rgba(127,176,105,.1); }
.pchip--miss { color: #f4c9bf; border-color: rgba(224,83,58,.4); background: rgba(224,83,58,.1); }

/* ============ PANEL / FORM ============ */
.panel {
  background: linear-gradient(180deg, var(--surface), var(--ink-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow);
  animation: rise .7s cubic-bezier(.2,.85,.3,1) .34s both;
}
.field { margin-bottom: 24px; }
.field-label {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .76rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--cream-dim); margin-bottom: 11px;
}
.field-num {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  display: grid; place-items: center; background: var(--amber); color: var(--ink);
  font-weight: 700; font-size: .78rem;
}
.field-hint { margin-left: auto; color: var(--muted); text-transform: none; letter-spacing: 0; }
.sample-btn {
  margin-left: auto; background: none; border: 1px solid var(--line);
  color: var(--amber); font-family: var(--mono); font-size: .68rem;
  text-transform: uppercase; letter-spacing: .1em; padding: 5px 11px;
  border-radius: 100px; cursor: pointer; transition: .2s;
}
.sample-btn:hover { border-color: var(--amber); background: rgba(224,168,61,.1); }

/* dropzone */
.dropzone {
  display: block; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  background: rgba(0,0,0,.18); transition: .22s;
}
.dropzone:hover, .dropzone.is-drag {
  border-color: var(--amber); background: rgba(224,168,61,.07);
}
.dropzone:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.dropzone.has-file { border-style: solid; border-color: var(--sage); background: rgba(127,176,105,.07); }
.dropzone.has-error { border-style: solid; border-color: var(--coral); background: rgba(224,83,58,.08); }
.dropzone.has-error .dropzone-icon { color: var(--coral); }
.dropzone.has-error .dropzone-sub { color: #f4c9bf; }
.dropzone-inner { padding: 38px 20px; text-align: center; }
.dropzone-icon {
  font-size: 2rem; color: var(--amber); line-height: 1;
  display: inline-block; margin-bottom: 10px; transform: translateY(0);
  transition: transform .25s;
}
.dropzone:hover .dropzone-icon { transform: translateY(-4px); }
.dropzone.has-file .dropzone-icon { color: var(--sage); }
.dropzone-title { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 4px; font-weight: 500; }
.dropzone-sub { font-size: .86rem; color: var(--muted); margin: 0; }

/* textarea */
textarea {
  width: 100%; resize: vertical; min-height: 150px;
  background: rgba(0,0,0,.22); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--cream);
  font-family: var(--sans); font-size: 1rem; line-height: 1.55;
  padding: 15px 16px; transition: .2s;
}
textarea::placeholder { color: var(--muted); }
textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(224,168,61,.15); }

/* CTA */
.cta {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  gap: 11px; width: 100%;
  background: var(--amber); color: var(--ink);
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--sans); font-weight: 700; font-size: 1.02rem;
  padding: 16px 24px; text-decoration: none;
  transition: transform .15s, box-shadow .2s, background .2s;
  box-shadow: 0 10px 28px -10px rgba(224,168,61,.55);
}
.cta:hover { background: #efbb54; transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgba(224,168,61,.6); }
.cta:active { transform: translateY(0); }
.cta-arrow { transition: transform .2s; }
.cta:hover .cta-arrow { transform: translateX(4px); }
.cta-spinner {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(20,17,15,.3); border-top-color: var(--ink);
  animation: spin .7s linear infinite;
}
.cta.is-loading .cta-label, .cta.is-loading .cta-arrow { display: none; }
.cta.is-loading .cta-spinner { display: inline-block; }
.cta:disabled { cursor: progress; opacity: .9; }

/* Click feedback: dim/disable sibling actions so the user knows what they hit */
.is-dimmed {
  opacity: .38; filter: grayscale(.4); pointer-events: none;
  transition: opacity .25s ease, filter .25s ease;
}
.cta.is-active { box-shadow: 0 0 0 2px var(--amber), 0 10px 28px -10px rgba(224,168,61,.55); }

.cta-amber { width: auto; }
.cta-ghost {
  width: auto; background: transparent; color: var(--cream);
  border: 1px solid var(--line); box-shadow: none;
}
.cta-ghost:hover { background: var(--surface-2); border-color: var(--cream-dim); transform: translateY(-2px); }

.form-note { font-size: .82rem; color: var(--muted); text-align: center; margin: 16px 0 0; }

/* ============ HOW ============ */
.how { padding: 64px 0 0; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 24px;
  transition: transform .2s, border-color .2s;
}
.how-card:hover { transform: translateY(-4px); border-color: var(--amber); }
.how-step { font-family: var(--mono); font-size: .8rem; color: var(--amber); letter-spacing: .1em; }
.how-card h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; margin: 10px 0 8px; }
.how-card p { font-size: .92rem; color: var(--cream-dim); margin: 0; }

/* ============ RESULT ============ */
.result-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 50px 0 22px; flex-wrap: wrap;
}
.result-head .eyebrow { margin: 0; flex: 1; min-width: 220px; }
.back-link { font-family: var(--mono); font-size: .76rem; color: var(--cream-dim); text-decoration: none; letter-spacing: .06em; }
.back-link:hover { color: var(--amber); }
.back-form { margin: 0; }
.back-link--btn { background: none; border: none; padding: 0; cursor: pointer; }

.score-block {
  display: grid; grid-template-columns: 220px 1fr; gap: 38px; align-items: center;
  background: linear-gradient(180deg, var(--surface), var(--ink-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 36px; box-shadow: var(--shadow);
  animation: rise .6s cubic-bezier(.2,.85,.3,1) both;
}
.gauge { position: relative; width: 220px; height: 220px; }
.gauge-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: var(--line); stroke-width: 12; }
.gauge-fill {
  fill: none; stroke: var(--amber); stroke-width: 12; stroke-linecap: round;
  transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1);
}
.gauge-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.gauge-num { font-family: var(--serif); font-size: 3.7rem; font-weight: 600; line-height: 1; }
.gauge-unit { font-family: var(--mono); font-size: .85rem; color: var(--muted); }

.score-verdict { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 600; margin: 0 0 10px; letter-spacing: -.02em; }
.score-summary { color: var(--cream-dim); font-size: 1.05rem; margin: 0 0 22px; max-width: 48ch; }
.score-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* skills */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.skill-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.skill-col--match { border-top: 3px solid var(--sage); }
.skill-col--miss { border-top: 3px solid var(--coral); }
.skill-head {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--cream-dim); margin: 0 0 16px;
}
.skill-tick, .skill-cross { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; font-size: .76rem; }
.skill-tick { background: rgba(127,176,105,.18); color: var(--sage); }
.skill-cross { background: rgba(224,83,58,.18); color: var(--coral); }
.skill-count { margin-left: auto; font-size: 1rem; color: var(--muted); }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-size: .88rem; padding: 7px 13px; border-radius: 100px; border: 1px solid var(--line);
  background: var(--surface-2); animation: pop .4s cubic-bezier(.2,.9,.3,1) both;
}
.chip--match { color: #cfe6c1; border-color: rgba(127,176,105,.4); background: rgba(127,176,105,.1); }
.chip--miss  { color: #f4c9bf; border-color: rgba(224,83,58,.4); background: rgba(224,83,58,.1); }
.chips .chip:nth-child(1){animation-delay:.04s}.chips .chip:nth-child(2){animation-delay:.08s}
.chips .chip:nth-child(3){animation-delay:.12s}.chips .chip:nth-child(4){animation-delay:.16s}
.chips .chip:nth-child(5){animation-delay:.20s}.chips .chip:nth-child(6){animation-delay:.24s}
.chips .chip:nth-child(7){animation-delay:.28s}.chips .chip:nth-child(8){animation-delay:.32s}
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
.empty { color: var(--muted); font-size: .92rem; margin: 0; }

/* suggestions */
.suggestions { margin-top: 44px; }
.sugg-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.sugg-item {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px 20px;
  transition: border-color .2s, transform .2s;
}
.sugg-item:hover { border-color: var(--amber); transform: translateX(4px); }
.sugg-num { font-family: var(--serif); font-size: 1.5rem; color: var(--amber); line-height: 1; flex: none; }
.sugg-item p { margin: 0; color: var(--cream-dim); }

/* ============ COVER LETTER ============ */
.letter-wrap { max-width: 720px; margin: 0 auto; animation: rise .6s cubic-bezier(.2,.85,.3,1) both; }
.letter-paper {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #faf6ee, #f1e9da);
  color: #2a2520; border-radius: var(--radius);
  padding: 54px 52px; box-shadow: var(--shadow);
  font-size: 1.05rem; line-height: 1.7;
  border: 1px solid rgba(0,0,0,.08);
}
.letter-paper p { margin: 0 0 16px; }
.letter-paper p:first-of-type { font-family: var(--serif); }
.letter-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
}
.letter-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* ============ RESPONSIVE ============ */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 34px; padding-top: 48px; }
  .hero-lead { max-width: 52ch; }
  .preview-card { max-width: 360px; margin: 0 auto; }
}

@media (max-width: 760px) {
  .how-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .score-block { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 30px 22px; }
  .score-summary { margin-inline: auto; }
  .score-actions { justify-content: center; }
  .panel { padding: 22px; }
  .letter-paper { padding: 36px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
