/* ============================================================
   Floom — design system (Cursor-accurate)
   Researched from cursor.com: cool near-white / cool near-black,
   system font stack, muted forest-green accent used sparingly,
   iOS-spring micro-interactions, one shadow tier + hairlines.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;450;500;550;600;680&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  /* ── Surfaces — pixel-extracted from cursor.com (light) ──
     canvas #f7f6f6 · sidebar/chrome #eeeeee · card crisp white ── */
  --bg:        #f7f7f6;   /* app canvas (Cursor editor ground) */
  --bg-2:      #ededec;   /* sidebar / sunken (Cursor grey chrome) */
  --bg-3:      #e6e6e4;   /* deeper sunken / rails */
  --paper:     #ffffff;   /* card surface — crisp on the grey-white canvas */
  --paper-2:   #fbfbfa;   /* nested surface */

  /* ── Ink — Cursor near-black, opacity steps ── */
  --ink:       #1a1a1a;
  --ink-soft:  rgba(26,26,26,0.66);
  --ink-mute:  rgba(26,26,26,0.45);
  --ink-faint: rgba(26,26,26,0.26);

  /* ── Lines — cool, hairline ── */
  --line:        rgba(20,20,20,0.08);
  --line-strong: rgba(20,20,20,0.14);
  --line-soft:   rgba(20,20,20,0.045);

  /* ── Accent — Cursor's muted forest green (#34785c). Sparing. ── */
  --accent:        #2f7a59;
  --accent-soft:   rgba(47,122,89,0.10);
  --accent-line:   rgba(47,122,89,0.26);

  /* ── Primary action = ink (monochrome, Cursor-style) ── */
  --solid:     #1a1a1a;
  --solid-2:   #2c2c2c;
  --solid-fg:  #fbfbfb;

  /* ── Status ── */
  --positive:  #2f7a59;
  --negative:  #c0392b;

  /* ── Elevation — soft layered shadow + inner top-highlight (v18 recipe).
     The inset hairline is what reads "crafted" not "flat AI". Restraint. ── */
  --hairline:  0 0 0 1px var(--line);
  --edge:      inset 0 1px 0 rgba(255,255,255,0.70);
  --shadow-sm: 0 1px 2px rgba(20,20,20,0.05), 0 0 0 1px rgba(20,20,20,0.05), var(--edge);
  --shadow-md: 0 6px 20px -8px rgba(20,20,20,0.13), 0 0 0 1px rgba(20,20,20,0.05), var(--edge);
  --shadow-pop:0 22px 50px -16px rgba(20,20,20,0.20), 0 0 0 1px rgba(20,20,20,0.06), var(--edge);
  --shadow-btn:0 1px 2px rgba(20,20,20,0.16), inset 0 1px 0 rgba(255,255,255,0.18);

  --focus: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink);

  /* ── Radii — tightened (Cursor-restrained, less round) ── */
  --r-xs:  3px;
  --r-sm:  5px;
  --r-md:  7px;
  --r-lg:  9px;
  --r-xl:  11px;
  --r-2xl: 13px;
  --r-pill:999px;

  /* ── Motion — iOS spring DNA ── */
  --spring: cubic-bezier(0.32, 1.06, 0.5, 1);
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 110ms;
  --t-base: 190ms;
  --t-slow: 320ms;

  /* ── Type — system stack (Cursor uses native OS font) ── */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-feat: "cv11" 1, "ss01" 1, "calt" 1;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Code", monospace;

  --maxw: 1080px;
}

html.dark {
  /* ── Surfaces — pixel-extracted from cursor.com (dark) ──
     canvas #1b1b1b · sidebar #202020 · card #212121 (elevation = lighter) ── */
  --bg:        #1b1b1b;   /* app canvas */
  --bg-2:      #202020;   /* sidebar / sunken */
  --bg-3:      #181818;   /* deeper / rails */
  --paper:     #222222;   /* card surface — elevated, slightly lighter */
  --paper-2:   #262626;   /* nested surface */

  --ink:       #e3e3e2;
  --ink-soft:  rgba(227,227,226,0.64);
  --ink-mute:  rgba(227,227,226,0.42);
  --ink-faint: rgba(227,227,226,0.23);

  --line:        rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.14);
  --line-soft:   rgba(255,255,255,0.05);

  --accent:        #4cae84;
  --accent-soft:   rgba(76,174,132,0.12);
  --accent-line:   rgba(76,174,132,0.28);

  --solid:     #e8e8e7;
  --solid-2:   #ffffff;
  --solid-fg:  #1b1b1b;

  --positive:  #4cae84;
  --negative:  #e06155;

  --hairline:  0 0 0 1px var(--line);
  --edge:      inset 0 1px 0 rgba(255,255,255,0.055);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.42), 0 0 0 1px rgba(255,255,255,0.04), var(--edge);
  --shadow-md: 0 6px 18px -8px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.05), var(--edge);
  --shadow-pop:0 22px 48px -16px rgba(0,0,0,0.66), 0 0 0 1px rgba(255,255,255,0.06), var(--edge);
  --shadow-btn:0 1px 2px rgba(0,0,0,0.46), inset 0 1px 0 rgba(255,255,255,0.06);

  --focus: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light; }
html.dark { color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: var(--font-feat);
  letter-spacing: -0.006em;
  min-height: 100vh;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
img, svg { display: block; }

/* ── Icon normalization — uniform lucide-style line weight ──
   Stroke icons (fill:none) all render at one consistent weight with
   round caps/joins, regardless of per-SVG stroke-width attributes.
   Filled brand logos (fill:currentColor) are left untouched. ── */
svg[fill="none"] { stroke-width: 1.75px; stroke-linecap: round; stroke-linejoin: round; }
svg[fill="none"] * { stroke-linecap: round; stroke-linejoin: round; }

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

/* ── Prototype top bar ── */
.proto-bar {
  position: sticky; top: 0; z-index: 200;
  height: 38px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px;
}
.proto-bar .pb-route { color: var(--ink); font-weight: 600; }
.proto-bar .pb-route .dim { color: var(--ink-mute); font-weight: 400; }
.proto-bar .pb-nav { display: flex; gap: 4px; align-items: center; }
.proto-bar .pb-nav a {
  color: var(--ink-mute); padding: 4px 8px; border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
}
.proto-bar .pb-nav a:hover { color: var(--ink); background: var(--bg-2); }
.proto-bar .pb-theme {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: var(--r-sm);
  border: 1px solid var(--line); color: var(--ink-soft);
  transition: border-color var(--t-fast), color var(--t-fast);
}
.proto-bar .pb-theme:hover { border-color: var(--line-strong); color: var(--ink); }
.proto-bar .pb-theme svg { width: 12px; height: 12px; }

/* ── App nav ── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative; z-index: 10;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); }
/* Real Floom mark (the chevron/forward shape from skills.floom.dev),
   rendered via mask so it's monochrome + theme-aware everywhere. The
   literal "f" in <span class="mark">f</span> is hidden by font-size:0. */
.brand .mark {
  width: 21px; height: 21px; font-size: 0; color: transparent; flex-shrink: 0;
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M32 26h20l22 22a3 3 0 0 1 0 4l-22 22H32a6 6 0 0 1-6-6V32a6 6 0 0 1 6-6z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M32 26h20l22 22a3 3 0 0 1 0 4l-22 22H32a6 6 0 0 1-6-6V32a6 6 0 0 1 6-6z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.nav-right { display: flex; align-items: center; gap: 4px; }
.nav-right a:not(.btn) { color: var(--ink-soft); font-size: 13px; font-weight: 500; padding: 7px 11px; border-radius: var(--r-sm); transition: color var(--t-fast), background var(--t-fast); }
.nav-right a:not(.btn):hover { color: var(--ink); background: var(--bg-2); }
.nav-right .ghost-icon { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; }
.nav-right .ghost-icon svg { width: 16px; height: 16px; opacity: 0.62; }

/* ── Page container ── */
.page { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 52px 24px 88px; }
.page.narrow { max-width: 680px; }
.page.flush { max-width: none; padding: 0; }

/* ── Type ── */
.display { font-size: clamp(34px, 4.4vw, 50px); font-weight: 680; letter-spacing: -0.035em; line-height: 1.04; color: var(--ink); }
/* CANON sec 10 / R1  -  app/auth h1 = 28px desktop, 24px <=480. Docs/legal/404
   override via per-page polish (canon allows 34 / 40 there). */
.h1 { font-size: 28px; font-weight: 660; letter-spacing: -0.025em; line-height: 1.12; color: var(--ink); }
@media (max-width: 480px) {
  .h1 { font-size: 24px; }
}
/* CANON sec 10  -  h2 = 22px / 640 / -.02em everywhere. */
.h2 { font-size: 22px; font-weight: 640; letter-spacing: -0.02em; color: var(--ink); }
.h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.011em; color: var(--ink); }
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-mute); }
.soft { color: var(--ink-soft); }
.tabular { font-variant-numeric: tabular-nums; }

/* ── Buttons — iOS spring ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px;
  border-radius: var(--r-md);
  font-family: var(--font); font-size: 13px; font-weight: 550;
  letter-spacing: -0.006em;
  border: 1px solid transparent;
  white-space: nowrap; user-select: none;
  transition: transform var(--t-base) var(--spring),
              background var(--t-fast) var(--ease),
              border-color var(--t-fast),
              box-shadow var(--t-fast),
              color var(--t-fast);
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:active { transform: scale(0.965); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
/* CANON sec 3  -  primary CTA = 46h / 28px pad / r-md / 600 15px. One size only. */
.btn-primary { background: var(--solid); color: var(--solid-fg); border-color: var(--solid); box-shadow: var(--shadow-btn);
  height: 46px; padding: 0 28px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.btn-primary:hover { background: var(--solid-2); color: var(--solid-fg); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: scale(0.965); }
/* CANON sec 5  -  secondary / ghost = 40h. */
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm);
  height: 40px; padding: 0 16px; border-radius: var(--r-md); }
.btn-secondary:hover { border-color: var(--ink-mute); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink-soft); height: 40px; padding: 0 16px; border-radius: var(--r-md); }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
/* CANON sec 4.1 (R12)  -  nav CTA = 34h / 13.5px / 600. */
.btn-nav { height: 34px; padding: 0 16px; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em;
  background: var(--solid); color: var(--solid-fg); border-color: var(--solid); }
.btn-nav:hover { background: var(--solid-2); transform: translateY(-1px); }
/* R4: btn-sm / btn-lg size modifiers RETIRED. Classnames stay (proto-frozen)
   but they are NO-OPs for height — primary/secondary/ghost/nav each enforce
   their own canon size. .btn-lg neutralised at canon §3 primary size. */
.btn-sm { /* retired — no height/padding override */ }
.btn-lg { height: 46px; padding: 0 28px; font-size: 15px; border-radius: var(--r-md); }
.btn-block { width: 100%; }

/* ── Input ── */
.input {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font-family: var(--font); font-size: 13.5px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder { color: var(--ink-mute); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: var(--focus); }
.field { display: grid; gap: 6px; }
.field .flabel { font-size: 12.5px; font-weight: 550; color: var(--ink-soft); }
.field .fhelp { font-size: 11.5px; color: var(--ink-mute); }

/* ── Card ── */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-xl); }
.card-pad { padding: 22px 24px; }
.card-sm { box-shadow: var(--shadow-sm); }
.card-md { box-shadow: var(--shadow-md); }
.card-pop { box-shadow: var(--shadow-pop); }
.card-int {
  cursor: pointer;
  transition: transform var(--t-base) var(--spring),
              border-color var(--t-fast),
              box-shadow var(--t-base) var(--ease);
}
.card-int:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.card-int:active { transform: translateY(0) scale(0.994); }

/* ── Crumb ── */
.crumb { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-mute); }
.crumb a { color: var(--ink-mute); padding: 2px 5px; border-radius: var(--r-sm); transition: color var(--t-fast), background var(--t-fast); }
.crumb a:hover { color: var(--ink); background: var(--bg-2); }
.crumb .sep { padding: 0 3px; opacity: 0.4; }
.crumb .cur { color: var(--ink); padding: 2px 5px; }

/* ── Chip / pill / badge ── */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--positive); }
.dot-mute { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-mute); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--r-sm); background: var(--paper); border: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; transition: border-color var(--t-fast), color var(--t-fast); }
.pill:hover { color: var(--ink); border-color: var(--line-strong); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: var(--r-sm); font-family: var(--font-mono); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink-soft); }
.badge-accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

/* ── Command line ── */
.cmd { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 12px; height: 40px; font-family: var(--font-mono); font-size: 13px; color: var(--ink); }
.cmd .pr { color: var(--ink-mute); user-select: none; }
.cmd .cp { margin-left: auto; padding: 4px 9px; font-size: 11px; color: var(--ink-mute); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); transition: color var(--t-fast), border-color var(--t-fast); }
.cmd .cp:hover { color: var(--ink); border-color: var(--line-strong); }

/* ── Panel ── */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; height: 42px; padding: 0 16px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.panel-head .pt { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); font-weight: 500; }
.panel-head .pm { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-mute); }
.panel-body { padding: 18px 20px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px; font-size: 13px; font-weight: 520; color: var(--ink-mute); border-bottom: 1.5px solid transparent; margin-bottom: -1px; transition: color var(--t-fast), border-color var(--t-fast); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab .ct { font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); background: var(--bg-2); padding: 1px 6px; border-radius: var(--r-pill); }

/* ── Footer ── */
.footer { border-top: 1px solid var(--line); padding: 24px; text-align: center; color: var(--ink-mute); font-size: 12px; position: relative; z-index: 1; }
.footer a { color: var(--ink-soft); margin: 0 8px; transition: color var(--t-fast); }
.footer a:hover { color: var(--ink); }

/* ── Avatar ── */
.avatar { border-radius: 50%; background: var(--bg-3); color: var(--ink); display: grid; place-items: center; font-weight: 650; flex-shrink: 0; }

/* ── Page-load reveal (one orchestrated stagger) ── */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.rise { animation: rise var(--t-slow) var(--ease) backwards; }
.r1 { animation-delay: 30ms; } .r2 { animation-delay: 80ms; } .r3 { animation-delay: 140ms; } .r4 { animation-delay: 210ms; } .r5 { animation-delay: 290ms; }

@media (max-width: 600px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .display { font-size: 30px; }
  .proto-bar { padding: 0 10px; gap: 8px; }
  .proto-bar .pb-route { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .proto-bar .pb-route .dim { display: none; }
  .proto-bar .pb-nav a { display: none; }
}
