/* ==========================================================================
   NOVA — hero + tool workspace
   ========================================================================== */

/* ---------------- Hero ---------------- */
.hero { position: relative; padding-top: var(--space-7); padding-bottom: var(--space-8); }
.hero__grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--space-8);
  align-items: center;
}
.hero__title {
  font-size: var(--step-5);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-5);
  max-width: 16ch;
}
.hero__title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}
.hero__lede { font-size: var(--step-1); color: var(--text-dim); max-width: 46ch; margin-bottom: var(--space-6); }

.hero__search {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  max-width: 560px;
  color: var(--text-faint);
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}
.hero__search:hover { border-color: var(--accent-line); }
.hero__search input { flex: 1; border: none; background: none; font-size: var(--step-0); color: var(--text); min-width: 0; }
.hero__search input:focus { outline: none; }

.hero__stats { display: flex; gap: var(--space-6); margin-top: var(--space-6); flex-wrap: wrap; }
.hero__stat strong {
  display: block;
  font-size: var(--step-2);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.hero__stat span { font-size: var(--step--2); color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.12em; }

/* Hero side panel — "instrument" card */
.hero__panel {
  position: relative;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 120% at 100% 0%, var(--accent-soft), transparent 55%),
    var(--surface);
  padding: var(--space-5);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.hero__panel::after {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  mask-image: radial-gradient(120% 90% at 80% 0%, #000 20%, transparent 75%);
}
.hero__panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.hero__panel-title { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); }
.hero__panel-list { display: flex; flex-direction: column; gap: var(--space-1); position: relative; z-index: 1; }
.hero__panel-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  transition: background var(--dur-1), color var(--dur-1);
}
.hero__panel-item:hover { background: var(--surface-2); color: var(--text); }
.hero__panel-item .hp-i { color: var(--accent); display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-xs); background: var(--surface-2); }
.hero__panel-item .hp-n { flex: 1; font-size: var(--step--1); font-weight: 600; }
.hero__panel-item kbd { opacity: 0.7; }

/* ---------------- Workspace ---------------- */
.workspace { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.ws-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.ws-side__back { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--step--1); color: var(--text-dim); }
.ws-side__back:hover { color: var(--accent); }
.ws-side__list { display: flex; flex-direction: column; gap: 2px; }
.ws-side__list a {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--step--1);
  color: var(--text-dim);
}
.ws-side__list a:hover { background: var(--surface-2); color: var(--text); }
.ws-side__list a.is-active { background: var(--text); color: var(--bg); }
.ws-side__head { font-size: var(--step--2); text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-faint); padding: 0 var(--space-3); }

.ws-main { min-width: 0; display: flex; flex-direction: column; gap: var(--space-5); }
.ws-header { display: flex; flex-direction: column; gap: var(--space-3); }
.ws-header h1 { font-size: var(--step-3); margin: 0; }
.ws-header__desc { color: var(--text-dim); max-width: var(--maxw-read); margin: 0; }
.ws-header__meta { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

.ws-panel {
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.ws-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--border-w) solid var(--line);
  flex-wrap: wrap;
}
.ws-panel__title { font-size: var(--step-0); font-weight: 650; margin: 0; }
.ws-panel__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-5); }
.ws-panel__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-top: var(--border-w) solid var(--line); flex-wrap: wrap; background: var(--surface-2); }

.ws-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); }

.ws-preview {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: var(--space-5);
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(45deg, var(--surface-3) 25%, transparent 25%, transparent 75%, var(--surface-3) 75%) 0 0 / 20px 20px,
    linear-gradient(45deg, var(--surface-3) 25%, transparent 25%, transparent 75%, var(--surface-3) 75%) 10px 10px / 20px 20px,
    var(--surface-2);
  overflow: auto;
  max-height: 60vh;
}
.ws-preview img, .ws-preview canvas, .ws-preview video { max-height: 56vh; width: auto; border-radius: var(--radius-sm); box-shadow: var(--shadow-1); }
.ws-preview--plain { background: var(--surface-2); }
.ws-preview--plain img, .ws-preview--plain canvas { box-shadow: none; }

.ws-output { display: flex; flex-direction: column; gap: var(--space-3); }
.output-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.output-row__name { flex: 1; min-width: 0; font-size: var(--step--1); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.output-row__size { font-family: var(--font-mono); font-size: var(--step--2); color: var(--text-faint); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-3); }
.stat {
  padding: var(--space-4);
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.stat__k { font-size: var(--step--2); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); }
.stat__v { font-family: var(--font-mono); font-size: var(--step-1); margin-top: var(--space-1); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* Text tool split */
.text-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.text-split .field { min-width: 0; }
.code-block {
  margin: 0;
  padding: var(--space-4);
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1.6;
  overflow: auto;
  max-height: 60vh;
  white-space: pre;
  tab-size: 2;
}
.code-block--wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Swatch grid (color picker) */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-3); }
.swatch { border: var(--border-w) solid var(--line); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; }
.swatch__color { height: 64px; }
.swatch__meta { padding: var(--space-2) var(--space-3); font-family: var(--font-mono); font-size: var(--step--2); background: var(--surface-2); }

/* Workflow steps */
.flow { display: flex; align-items: stretch; gap: var(--space-3); flex-wrap: wrap; }
.flow__step {
  flex: 1 1 160px;
  min-width: 140px;
  padding: var(--space-4);
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  position: relative;
}
.flow__step-n { font-family: var(--font-mono); font-size: var(--step--2); color: var(--accent); }
.flow__step-t { font-weight: 650; font-size: var(--step--1); margin-top: var(--space-1); }
.flow__arrow { align-self: center; color: var(--text-faint); }

/* Feature/step list numbered */
.step-list { display: grid; gap: var(--space-4); counter-reset: step; }
.step-item { display: grid; grid-template-columns: 44px 1fr; gap: var(--space-4); align-items: start; }
.step-item__n {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: var(--border-w) solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--font-mono);
  color: var(--accent);
}
.step-item h4 { margin: 0 0 var(--space-1); }
.step-item p { color: var(--text-dim); font-size: var(--step--1); margin: 0; }

/* Split list (privacy dos/donts) */
.rule-list { display: grid; gap: var(--space-3); }
.rule { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--step--1); color: var(--text-dim); }
.rule__mark { flex-shrink: 0; color: var(--ok); margin-top: 2px; }
.rule--no .rule__mark { color: var(--danger); }
.rule strong { color: var(--text); }

/* ---------------- CV Builder ---------------- */
.cv-layout { display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.cv-preview-wrap { position: sticky; top: 92px; display: flex; flex-direction: column; gap: var(--space-3); }
.cv-toolbar { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.cv-label { font-weight: 650; font-size: var(--step--1); color: var(--text-dim); }
.cv-entry {
  padding: var(--space-4);
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.cv-entry__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--step--1); font-weight: 650; color: var(--text-dim);
}
.cv-sheet {
  background: #ffffff;
  color: #16181a;
  border-radius: var(--radius-md);
  padding: clamp(22px, 3vw, 44px);
  box-shadow: var(--shadow-2);
  font-size: 13px;
  line-height: 1.55;
}
.cv-sheet .cv-name { font-family: var(--font-serif); font-size: clamp(26px, 3vw, 34px); font-weight: 600; margin: 0; line-height: 1.04; letter-spacing: -0.01em; color: #111; }
.cv-sheet .cv-role { color: #16543b; font-weight: 600; margin: 4px 0 0; font-size: 15px; }
.cv-sheet .cv-contact { color: #555; font-size: 11.5px; margin: 8px 0 0; }
.cv-sheet .cv-section { margin-top: 20px; }
.cv-sheet .cv-section h2 {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #16543b;
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e2dc;
}
.cv-sheet .cv-item { margin-bottom: 11px; }
.cv-sheet .cv-item__top { display: flex; justify-content: space-between; gap: 12px; }
.cv-sheet .cv-item__top strong { font-size: 13px; }
.cv-sheet .cv-item__top span { color: #666; font-size: 11px; white-space: nowrap; }
.cv-sheet .cv-item__sub { color: #444; font-size: 12px; }
.cv-sheet .cv-item p { margin: 3px 0 0; color: #333; white-space: pre-wrap; }
.cv-sheet .cv-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-sheet .cv-skills span { background: #eef0ea; border-radius: 999px; padding: 2px 9px; font-size: 11px; }

@media (max-width: 980px) {
  .cv-layout { display: flex; flex-direction: column; }
  .cv-preview-wrap { order: -1; position: static; }
  .cv-sheet { font-size: 14px; padding: 24px; }
  .cv-sheet .cv-name { font-size: 30px; }
}

/* ---------------- Spreadsheet preview ---------------- */
.xls-preview { display: flex; flex-direction: column; gap: var(--space-3); }
.xls-scroll {
  overflow: auto;
  max-height: 60vh;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.xls-scroll table.data { min-width: 100%; white-space: nowrap; }
.xls-scroll td[contenteditable] { outline: none; }
.xls-scroll td[contenteditable]:focus { box-shadow: inset 0 0 0 2px var(--accent); }
