/* ───────────────────────────────────────────────
   Lawfirm · Contract Intake Automation — mockup
   Palette: warm ivory, deep ink, brass accent, emerald success
─────────────────────────────────────────────── */

:root {
  --ivory:        #f6f4ef;
  --ivory-2:      #efece4;
  --paper:        #ffffff;
  --ink:          #16171a;
  --ink-soft:     #3c3d42;
  --ink-mute:     #8a8a8f;
  --line:         #e4e0d6;
  --line-soft:    #ece9e1;
  --brass:        #9a7b4f;
  --brass-soft:   #c8ad84;
  --emerald:      #2e7d5b;
  --emerald-soft: #d6ebe1;
  --radius:       22px;
  --radius-sm:    14px;
  --shadow-soft:  0 1px 2px rgba(22,23,26,.04), 0 18px 50px -28px rgba(22,23,26,.28);
  --shadow-card:  0 1px 2px rgba(22,23,26,.05), 0 40px 90px -48px rgba(22,23,26,.42);
  --ease:         cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 100% 0%, #fbfaf6 0%, var(--ivory) 42%, var(--ivory-2) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* subtle paper grain */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: .035;
  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'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ───────────── Header ───────────── */
.site-header {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 30px clamp(24px, 5vw, 80px);
}
.wordmark { display: flex; align-items: center; gap: 12px; }
.monogram {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--ivory);
  font-family: "Fraunces", serif; font-weight: 600; font-size: 20px;
  font-style: italic;
}
.wordmark-text {
  font-weight: 600; letter-spacing: .22em; font-size: 14px;
}
.header-meta {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--ink-mute); letter-spacing: .04em;
}
.header-meta .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 4px var(--emerald-soft);
}

/* ───────────── Stage layout ───────────── */
.stage {
  position: relative; z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  padding: clamp(20px, 3vh, 48px) clamp(24px, 5vw, 80px) 40px;
  max-width: 1400px; width: 100%; margin: 0 auto;
}

/* ───────────── Left panel ───────────── */
.eyebrow {
  font-size: 12.5px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--brass); font-weight: 600; margin-bottom: 22px;
}
.headline {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 1.02;
  letter-spacing: -.015em;
  color: var(--ink);
}
.headline em {
  font-style: italic; font-weight: 400; color: var(--brass);
}
.headline strong { font-weight: 600; }

.lede {
  margin-top: 26px; max-width: 440px;
  font-size: 16.5px; line-height: 1.62; color: var(--ink-soft);
}

/* Dropzone */
.dropzone {
  margin-top: 34px;
  background: var(--paper);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 30px;
  cursor: pointer;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease), background .3s var(--ease);
  box-shadow: var(--shadow-soft);
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--brass-soft);
  transform: translateY(-2px);
  outline: none;
}
.dropzone.is-drag {
  border-color: var(--brass);
  background: #fffdf8;
  transform: scale(1.01);
}
.dropzone.has-file { border-style: solid; border-color: var(--line); cursor: default; }

.dz-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 8px 0; }
.dz-icon {
  width: 54px; height: 54px; border-radius: 16px; margin-bottom: 12px;
  display: grid; place-items: center;
  background: var(--ivory); color: var(--ink);
}
.dz-icon svg { width: 26px; height: 26px; }
.dz-title { font-weight: 600; font-size: 17px; }
.dz-sub { font-size: 14px; color: var(--ink-mute); }
.dz-link { color: var(--brass); font-weight: 600; }

.dz-file { display: flex; align-items: center; gap: 16px; }
.file-badge {
  width: 50px; height: 50px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: var(--ink); color: var(--ivory);
}
.file-badge svg { width: 24px; height: 24px; }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 13px; color: var(--emerald); margin-top: 2px; }
.file-clear {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  border: none; background: var(--ivory); color: var(--ink-mute);
  cursor: pointer; display: grid; place-items: center;
  transition: background .2s, color .2s;
}
.file-clear:hover { background: var(--ivory-2); color: var(--ink); }
.file-clear svg { width: 16px; height: 16px; }

/* Run button */
.run-btn {
  margin-top: 24px;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 30px; border: none; border-radius: 100px;
  background: var(--ink); color: var(--ivory);
  font-family: "Inter", sans-serif; font-weight: 600; font-size: 15.5px;
  cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), opacity .3s, background .3s;
  box-shadow: 0 14px 34px -16px rgba(22,23,26,.55);
}
.run-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 22px 44px -18px rgba(22,23,26,.6); }
.run-btn:active:not(:disabled) { transform: translateY(0) scale(.99); }
.run-btn:disabled { opacity: .32; cursor: not-allowed; box-shadow: none; }
.run-btn .run-arrow { width: 19px; height: 19px; transition: transform .35s var(--ease); }
.run-btn:hover:not(:disabled) .run-arrow { transform: translateX(4px); }

.footnote { margin-top: 18px; font-size: 12.5px; color: var(--ink-mute); }

/* ───────────── Right panel · flow card ───────────── */
.panel--flow { position: relative; }
.flow-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  box-shadow: var(--shadow-card);
  min-height: 540px;
  padding: 34px 36px;
  overflow: hidden;
}

/* idle state */
.flow-idle {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 8px; padding: 40px;
  background: var(--paper);
  transition: opacity .5s var(--ease);
}
.idle-orbit {
  width: 84px; height: 84px; margin-bottom: 18px; position: relative;
}
.idle-orbit span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--line);
}
.idle-orbit span:nth-child(1) { animation: orbit 3.4s var(--ease) infinite; }
.idle-orbit span:nth-child(2) { inset: 16px; border-color: var(--brass-soft); animation: orbit 3.4s var(--ease) infinite .4s; }
.idle-orbit span:nth-child(3) { inset: 32px; background: var(--ivory); border-color: transparent; }
@keyframes orbit {
  0% { transform: scale(.9); opacity: .4; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(.9); opacity: .4; }
}
.idle-text { font-family: "Fraunces", serif; font-style: italic; font-size: 22px; color: var(--ink); }
.idle-sub { font-size: 14px; color: var(--ink-mute); max-width: 280px; line-height: 1.5; }
.idle-sub em { color: var(--ink); font-style: normal; font-weight: 600; }

/* live process */
.flow-live { opacity: 0; }
.flow-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 22px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.flow-head-title { font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.flow-progress {
  font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 13px; color: var(--brass);
  background: #fbf6ec; padding: 5px 12px; border-radius: 100px;
}

/* steps + spine */
.steps { list-style: none; position: relative; padding-top: 18px; }
.step {
  position: relative;
  display: grid; grid-template-columns: 34px 1fr; gap: 16px;
  padding-bottom: 30px;
}
.step:last-child { padding-bottom: 4px; }

/* vertical spine connecting nodes */
.step:not(:last-child)::before {
  content: ""; position: absolute;
  left: 16px; top: 32px; bottom: 0; width: 2px;
  background: var(--line);
  transform: scaleY(0); transform-origin: top;
  transition: transform .5s var(--ease);
}
.step.spine-on:not(:last-child)::before { transform: scaleY(1); }
.step:not(:last-child)::after {
  content: ""; position: absolute;
  left: 16px; top: 32px; bottom: 0; width: 2px;
  background: linear-gradient(var(--brass), var(--emerald));
  transform: scaleY(0); transform-origin: top;
  transition: transform .6s var(--ease);
}
.step.spine-fill:not(:last-child)::after { transform: scaleY(1); }

.step-node {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; position: relative; z-index: 1;
  background: var(--paper);
  border: 2px solid var(--line);
  color: transparent;
  transition: border-color .4s var(--ease), background .4s var(--ease), transform .4s var(--ease);
}
.step.active .step-node {
  border-color: var(--brass);
  background: #fff;
}
.step.active .step-node::after {
  content: ""; position: absolute; inset: 7px; border-radius: 50%;
  background: var(--brass);
  animation: pulse 1.1s ease-in-out infinite;
}
.step.done .step-node {
  border-color: var(--emerald);
  background: var(--emerald);
  transform: scale(1);
}
.step.done .step-node::after { display: none; }
.node-check {
  width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 24; stroke-dashoffset: 24;
  transition: stroke-dashoffset .45s var(--ease) .05s;
}
.step.done .node-check { stroke-dashoffset: 0; }
@keyframes pulse { 0%,100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }

.step-body { padding-top: 4px; }
.step-title { font-weight: 600; font-size: 15.5px; color: var(--ink-mute); transition: color .35s; }
.step.active .step-title, .step.done .step-title { color: var(--ink); }
.step-detail { font-size: 13.5px; color: var(--ink-mute); margin-top: 3px; }
.step-detail #folderCount { color: var(--emerald); font-weight: 600; font-variant-numeric: tabular-nums; }

/* read chips */
.read-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.read-chips .chip {
  font-size: 12.5px; font-weight: 500;
  padding: 6px 13px; border-radius: 100px;
  background: var(--ivory); color: var(--ink-soft);
  border: 1px solid var(--line-soft);
  opacity: 0; transform: translateY(6px);
}

/* folder grid */
.folder-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-top: 16px;
}
.folder {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--ivory); border: 1px solid var(--line-soft);
  opacity: 0; transform: translateY(10px) scale(.96);
}
.folder-ico {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: #fff; color: var(--brass);
  border: 1px solid var(--line-soft);
  position: relative;
}
.folder-ico svg { width: 17px; height: 17px; }
.folder-ico .mini-check {
  position: absolute; right: -5px; bottom: -5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--emerald); display: grid; place-items: center;
  opacity: 0; transform: scale(.4);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.folder-ico .mini-check svg { width: 10px; height: 10px; stroke: #fff; stroke-width: 3.4; fill: none; }
.folder.created .mini-check { opacity: 1; transform: scale(1); }
.folder.created .folder-ico { color: var(--emerald); }
.folder-name { font-size: 12.8px; font-weight: 500; line-height: 1.25; }
.folder-name b { display: block; font-weight: 600; font-size: 11px; color: var(--ink-mute); letter-spacing: .04em; }

/* doc list */
.doc-list { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.doc {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--ivory); border: 1px solid var(--line-soft);
  opacity: 0; transform: translateY(8px);
}
.doc-ico { width: 26px; height: 26px; flex: none; color: var(--ink-mute); display: grid; place-items: center; }
.doc-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.doc-name { flex: 1; font-size: 13.5px; font-weight: 500; }
.doc-status { font-size: 12px; color: var(--ink-mute); font-weight: 500; }
.doc.filled .doc-status { color: var(--emerald); }
.doc.filled .doc-ico { color: var(--emerald); }
/* fill sweep */
.doc::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(154,123,79,.12), transparent);
  transform: translateX(-100%);
}
.doc.filling::after { animation: sweep .9s var(--ease); }
@keyframes sweep { to { transform: translateX(100%); } }

/* ── key dates · 8-week timeline ── */
.weeks { position: relative; height: 168px; margin-top: 20px; }

.wk-scaffold {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: repeat(8, 1fr);
}
.wk-col { position: relative; border-left: 1px dashed var(--line-soft); }
.wk-col:last-child { border-right: 1px dashed var(--line-soft); }
.wk-col b {
  position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 600; letter-spacing: .05em;
  color: var(--ink-mute); opacity: 0;
}

.wk-axis {
  position: absolute; left: 6px; right: 6px; top: 40px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brass-soft), var(--emerald));
  transform: scaleX(0); transform-origin: left;
}
.wk-axis.drawn { transform: scaleX(1); transition: transform .7s var(--ease); }

.wk-mark {
  position: absolute; top: 40px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  opacity: 0; width: 84px;
}
.wk-dot {
  width: 11px; height: 11px; border-radius: 50%; margin-top: -5px;
  background: #fff; border: 2.5px solid var(--emerald); z-index: 2;
  box-shadow: 0 0 0 4px #fff;
}
.wk-stem { width: 1.5px; background: var(--line); }
.wk-row0 .wk-stem { height: 9px; }
.wk-row1 .wk-stem { height: 54px; }
.wk-pill {
  background: #fff; border: 1px solid var(--line-soft); border-radius: 11px;
  padding: 6px 9px; text-align: center; min-width: 74px;
  box-shadow: 0 8px 20px -12px rgba(22,23,26,.4);
}
.wk-pill b { display: block; font-size: 10.5px; font-weight: 600; color: var(--ink); line-height: 1.18; }
.wk-pill i { font-style: normal; font-size: 9.5px; color: var(--brass); font-weight: 600; }

/* done state */
.flow-done {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 8px; padding: 40px;
  background: var(--paper);
}
.done-check { width: 96px; height: 96px; margin-bottom: 20px; }
.done-check svg { width: 100%; height: 100%; fill: none; }
.done-check circle {
  stroke: var(--emerald); stroke-width: 2.5;
  stroke-dasharray: 151; stroke-dashoffset: 151;
}
.done-check path {
  stroke: var(--emerald); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40;
}
.done-title { font-family: "Fraunces", serif; font-size: 30px; letter-spacing: -.01em; }
.done-sub { font-size: 14.5px; color: var(--ink-mute); }
.done-again {
  margin-top: 22px; padding: 12px 26px; border-radius: 100px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-family: "Inter", sans-serif; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .25s, transform .25s var(--ease);
}
.done-again:hover { background: var(--ivory); transform: translateY(-1px); }

/* ───────────── Footer ───────────── */
.site-footer {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 26px; font-size: 12.5px; color: var(--ink-mute);
}
.footer-sep { opacity: .5; }

/* ───────────── Responsive ───────────── */
@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; gap: 36px; padding-top: 8px; }
  .panel--intro { order: 1; }
  .panel--flow { order: 2; }
  .flow-card { min-height: 500px; }
  .lede { max-width: none; }
}
@media (max-width: 520px) {
  .site-header { padding: 22px; }
  .header-meta { display: none; }
  .flow-card { padding: 26px 22px; }
  .folder-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
