/* ============================================================
   Corkboard — page tokens and components
   ============================================================ */

:root {
  color-scheme: dark;

  /* Surfaces — near-black so the warm accent carries the light */
  --bg: #08090B;
  --bg-alt: #0B0D11;
  --surface: #111318;
  --surface-2: #171A21;
  --border: #1E222A;
  --border-strong: #2D333E;

  /* Text */
  --text: #F5F6F8;
  --text-secondary: #A0A7B4;
  --text-tertiary: #6F7885;

  /* Accent — warm amber, the cork/paper note */
  --accent: #E9A23B;
  --accent-hover: #F3B85F;
  --accent-press: #CE8A26;
  --accent-ink: #241703;
  --accent-dim: rgba(233, 162, 59, 0.10);
  --accent-border: rgba(233, 162, 59, 0.32);
  --accent-gradient: linear-gradient(135deg, #F7C877 0%, #E9A23B 45%, #D9765A 100%);

  /* Secondary hues for note cards */
  --hue-rose: #D9765A;
  --hue-sky: #5AA9D9;
  --hue-sage: #6FBF8E;
  --hue-violet: #9B87D9;

  --good: #6FBF8E;

  /* Type */
  --font-sans: system-ui, -apple-system, "Segoe UI", "Segoe UI Variable", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --fs-hero: clamp(2.5rem, 1.4rem + 4.8vw, 5rem);
  --fs-h2: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
  --fs-h3: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9rem;
  --fs-micro: 0.75rem;

  --lh-tight: 1.08;
  --lh-body: 1.62;
  --ls-tight: -0.03em;
  --ls-wide: 0.07em;

  /* Spacing (8px base) */
  --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;  --s-5: 20px;
  --s-6: 24px; --s-8: 32px;  --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-24: 96px;

  /* Layout */
  --maxw: 1180px;
  --maxw-wide: 1400px;
  --side-pad: clamp(20px, 4vw, 40px);
  --section-pad: clamp(64px, 8vw, 128px);
  --nav-h: 62px;

  /* Radii */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;

  /* Elevation */
  --shadow-card: 0 1px 0 rgba(255,255,255,0.02), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-shot: 0 1px 0 rgba(255,255,255,0.03), 0 24px 70px rgba(0,0,0,0.55);

  /* Motion */
  --dur-fast: 120ms;
  --dur: 220ms;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  padding-block: clamp(56px, 8vw, 104px) clamp(64px, 9vw, 128px);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -34%;
  left: 50%;
  width: min(1150px, 135%);
  aspect-ratio: 1.55;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(233, 162, 59, 0.13), transparent 72%),
    radial-gradient(closest-side, rgba(217, 118, 90, 0.08), transparent 78%);
  pointer-events: none;
}

/* Faint pinboard grid behind the hero */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 38%, #000 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 38%, #000 0%, transparent 100%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: var(--s-16);
  align-items: center;
}

.hero h1 {
  font-size: var(--fs-hero);
  font-weight: 650;
  margin-block: var(--s-5) var(--s-5);
}

.hero .lead { max-width: 46ch; margin-bottom: var(--s-6); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin-top: var(--s-8);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.hero-meta span { display: inline-flex; align-items: center; gap: var(--s-2); }
.hero-meta span::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- The board ---------- */

.board {
  position: relative;
  aspect-ratio: 1 / 0.92;
  perspective: 1400px;
}

.board-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.note {
  position: absolute;
  width: 46%;
  padding: var(--s-4);
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-card);
}

/* Pin head */
.note::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: var(--pin, var(--accent));
  box-shadow: 0 2px 5px rgba(0,0,0,0.55), inset 0 -2px 3px rgba(0,0,0,0.28);
}

.note-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: var(--s-2);
  letter-spacing: -0.01em;
}
.note-body {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.note-tag {
  display: inline-block;
  margin-top: var(--s-3);
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--pin, var(--accent));
  background: color-mix(in srgb, var(--pin, var(--accent)) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--pin, var(--accent)) 30%, transparent);
}

/* Individual placement + co-prime float periods so they never sync */
.note-1 { top: 2%;  left: 1%;   --pin: var(--accent);     animation: floatA 7s ease-in-out infinite; }
.note-2 { top: 20%; right: 0;   --pin: var(--hue-sky);    animation: floatB 9s ease-in-out infinite; }
.note-3 { top: 47%; left: 6%;   --pin: var(--hue-sage);   animation: floatC 8s ease-in-out infinite; }
.note-4 { bottom: 1%; right: 6%; --pin: var(--hue-violet); animation: floatB 11s ease-in-out infinite; }

@keyframes floatA {
  0%, 100% { transform: translateY(0) rotate(-2.2deg); }
  50%      { transform: translateY(-11px) rotate(-2.2deg); }
}
@keyframes floatB {
  0%, 100% { transform: translateY(0) rotate(1.8deg); }
  50%      { transform: translateY(-13px) rotate(1.8deg); }
}
@keyframes floatC {
  0%, 100% { transform: translateY(0) rotate(-1.1deg); }
  50%      { transform: translateY(-9px) rotate(-1.1deg); }
}

/* A photo attachment card, to show media lives on the board too */
.note-photo { padding: var(--s-2); }
.note-photo .thumb {
  height: 74px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(233,162,59,0.5), rgba(217,118,90,0.42) 45%, rgba(90,169,217,0.38));
  position: relative;
  overflow: hidden;
}
.note-photo .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.30), transparent 55%);
}
.note-photo .cap {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: var(--s-2) var(--s-1) 2px;
}

/* ============================================================
   Sync diagram
   ============================================================ */

.sync-stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
  align-items: end;
  max-width: 780px;
  margin: var(--s-12) auto 0;
}

.device {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: var(--s-3);
  box-shadow: var(--shadow-card);
}
.device-screen {
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: var(--s-3);
  display: grid;
  gap: 6px;
}
.device-phone  { height: 168px; }
.device-laptop { height: 132px; }
.device-tablet { height: 148px; }

.device-label {
  margin-top: var(--s-3);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.skel {
  height: 7px;
  border-radius: 3px;
  background: var(--surface-2);
}
.skel.w-70 { width: 70%; }
.skel.w-90 { width: 90%; }
.skel.w-50 { width: 50%; }

/* The synced row lights up in sequence */
.skel.live {
  background: color-mix(in srgb, var(--accent) 55%, var(--surface-2));
  box-shadow: 0 0 14px rgba(233, 162, 59, 0.32);
  transition: background 420ms var(--ease), box-shadow 420ms var(--ease);
}

.sync-caption {
  text-align: center;
  margin-top: var(--s-6);
  color: var(--text-tertiary);
  font-size: var(--fs-small);
}

/* ============================================================
   Editor showcase
   ============================================================ */

.editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-shot);
}

.editor-pane {
  background: var(--surface);
  padding: var(--s-5);
  min-height: 300px;
}
.editor-pane-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding-bottom: var(--s-4);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--border);
}

.editor-src {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.85;
  white-space: pre-wrap;
  color: var(--text-secondary);
  margin: 0;
}
.editor-src .tok-h    { color: var(--accent); font-weight: 600; }
.editor-src .tok-b    { color: var(--text); font-weight: 600; }
.editor-src .tok-link { color: var(--hue-sky); }
.editor-src .tok-mark { color: var(--text-tertiary); }

/* Typing caret */
.caret {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.editor-out h4 {
  font-size: 1.15rem;
  margin-bottom: var(--s-3);
}
.editor-out p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--s-3);
}
.editor-out a { color: var(--hue-sky); border-bottom: 1px solid color-mix(in srgb, var(--hue-sky) 40%, transparent); }
.editor-out strong { color: var(--text); }

.task-line {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 5px 0;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}
.task-box {
  width: 17px;
  height: 17px;
  flex: none;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.task-box svg {
  width: 11px; height: 11px;
  stroke: var(--accent-ink);
  stroke-width: 3;
  fill: none;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease) 60ms;
}
.task-line.done .task-box { background: var(--accent); border-color: var(--accent); }
.task-line.done .task-box svg { opacity: 1; }
.task-line .task-text { transition: opacity var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease); }
.task-line.done .task-text { opacity: 0.42; text-decoration: line-through; }

/* ============================================================
   Media grid
   ============================================================ */

.media-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
}

.media-cell {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.media-cell:hover { transform: translateY(-4px) scale(1.02); border-color: var(--accent-border); }

.media-cell::after {
  content: attr(data-kind);
  position: absolute;
  left: 8px;
  bottom: 7px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

.m1 { background: linear-gradient(140deg, #E9A23B, #D9765A); }
.m2 { background: linear-gradient(140deg, #5AA9D9, #9B87D9); }
.m3 { background: linear-gradient(140deg, #6FBF8E, #5AA9D9); }
.m4 { background: linear-gradient(140deg, #D9765A, #9B87D9); }
.m5 { background: linear-gradient(140deg, #9B87D9, #5AA9D9); }
.m6 { background: linear-gradient(140deg, #E9A23B, #6FBF8E); }
.m7 { background: linear-gradient(140deg, #5AA9D9, #E9A23B); }
.m8 { background: linear-gradient(140deg, #6FBF8E, #D9765A); }

/* ============================================================
   Command palette
   ============================================================ */

.palette {
  max-width: 560px;
  margin-inline: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-shot);
  overflow: hidden;
}
.palette-input {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text);
}
.palette-input svg { width: 17px; height: 17px; stroke: var(--text-tertiary); fill: none; stroke-width: 1.8; flex: none; }
.palette-query { color: var(--text); }

.palette-list { padding: var(--s-2); }
.palette-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 9px var(--s-3);
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.palette-row .dot {
  width: 7px; height: 7px; border-radius: 2px; flex: none;
  background: var(--rowc, var(--accent));
}
.palette-row .kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 2px 6px;
}
.palette-row.is-active { background: var(--accent-dim); color: var(--text); }

/* ============================================================
   Cost strip
   ============================================================ */

.cost-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  text-align: center;
}
.cost-item {
  padding: var(--s-8) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.cost-num {
  display: block;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--s-3);
}
.cost-item p {
  color: var(--text-secondary);
  font-size: var(--fs-small);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: var(--s-12); }
  .board { max-width: 520px; margin-inline: auto; width: 100%; }
  .editor-split { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 720px) {
  .sync-stage { grid-template-columns: 1fr; max-width: 320px; }
  .cost-strip { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-meta { gap: var(--s-2) var(--s-4); }
}

@media (max-width: 460px) {
  .note { width: 54%; }
  .note-body { font-size: 0.72rem; }
}
