/* Freshers Park base + component styles. Legacy class names (.card .btn .badge .change ...) are restyled so every page inherits the design. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font: var(--fs-md)/1.6 var(--font-ui); background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body::before { /* subtle noise texture */ content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: var(--fs-2xl); } h2 { font-size: var(--fs-xl); } h3 { font-size: var(--fs-lg); }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
img, svg { max-width: 100%; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); color: var(--fg); padding: 10px 14px; border-radius: var(--r-sm); z-index: 200; box-shadow: var(--shadow-2); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .err { color: var(--danger); min-height: 1.5em; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@supports not (background-clip: text) { .gradient-text { color: var(--accent); } }

/* ---------- navigation ---------- */
nav.top { position: sticky; top: 0; z-index: 50; display: flex; gap: var(--s-4); align-items: center; padding: 8px clamp(14px, 3vw, 28px); min-height: 54px;
  background: var(--surface-glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line); }
nav.top .brand { flex: none; display: inline-flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; color: var(--fg); font: 700 1.15rem var(--font-display); letter-spacing: -.02em; min-height: var(--tap); }
nav.top a:not(.brand):not(.btn) { color: var(--muted); text-decoration: none; padding: 10px 6px; border-radius: 8px; font-size: var(--fs-sm); }
nav.top a:not(.brand):not(.btn):hover { color: var(--fg); }
.logo { display: block; flex: none; width: auto; height: 30px; overflow: visible; }
.logo .mark-leaf { fill: url(#fp-grad); }
.logo .mark-path { fill: none; stroke: var(--fg); stroke-width: 2.4; stroke-linecap: round; }
.logo .word { fill: var(--fg); font: 700 22px var(--font-display); letter-spacing: -.5px; }
.theme-toggle { width: var(--tap); height: var(--tap); padding: 0; display: inline-grid; place-items: center; border-radius: var(--r-pill); background: transparent; color: var(--fg); border: 1px solid var(--line); cursor: pointer; }
.theme-toggle:hover { background: var(--tint-info); }
.theme-toggle svg { width: 20px; height: 20px; transition: transform var(--dur-4) var(--ease-spring); }
:root[data-theme="light"] .theme-toggle svg { transform: rotate(180deg); }
.theme-toggle .moon { display: none; } :root[data-theme="light"] .theme-toggle .moon { display: block; } :root[data-theme="light"] .theme-toggle .sun { display: none; }

/* ---------- layout ---------- */
main.page { max-width: 960px; margin: var(--s-6) auto var(--s-8); padding: 0 clamp(14px, 3vw, 24px); }
main.page > h1 { margin-bottom: .3em; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-3); }
.bento { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-4); }
.bento .wide { grid-column: span 2; } @media (max-width: 640px) { .bento .wide { grid-column: auto; } }

/* ---------- surfaces ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-5); margin-bottom: var(--s-4); box-shadow: var(--shadow-1); }
.card.glass { background: var(--surface-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card.spot::after { /* cursor-follow spotlight */ content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--dur-3);
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(16,185,129,.16), transparent 60%); }
.card.spot:hover::after { opacity: 1; }
.card.lift { transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out), border-color var(--dur-3); }
.card.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.gborder { position: relative; } .gborder::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); opacity: 0; transition: opacity var(--dur-3);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); pointer-events: none; }
.gborder:hover::before, .gborder:focus-within::before { opacity: 1; }

/* ---------- forms ---------- */
label { display: block; font-size: var(--fs-sm); color: var(--muted); margin-bottom: 4px; font-weight: 500; }
input, textarea, select { width: 100%; min-height: var(--tap); padding: 8px 11px; border: 1px solid var(--field-line); border-radius: var(--r-sm); font: inherit; background: var(--field); color: var(--fg); transition: border-color var(--dur-2), box-shadow var(--dur-2); }
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring, 0 0 0 4px rgba(16,185,129,.22)); }
input[type=checkbox], input[type=radio] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--emerald); vertical-align: middle; }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 84px; }

/* ---------- buttons ---------- */
button, .btn { position: relative; overflow: hidden; font: 600 var(--fs-md)/1 var(--font-ui); min-height: var(--tap); padding: 9px 16px; border-radius: var(--r-pill); border: 0; background: var(--grad); color: var(--on-grad); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--btn-shadow, 0 6px 18px rgba(16,185,129,.28)); transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2), filter var(--dur-2); -webkit-tap-highlight-color: transparent; }
button:hover, .btn:hover { color: var(--on-grad); transform: translateY(-1px); box-shadow: var(--btn-shadow-hover, 0 10px 26px rgba(16,185,129,.38)); filter: brightness(1.04); }
button:active, .btn:active { transform: translateY(1px) scale(.98); }
button.secondary, .btn.secondary { background: transparent; color: var(--fg); border: 1px solid var(--line-strong); box-shadow: none; }
button.secondary:hover, .btn.secondary:hover { color: var(--fg); background: var(--tint-info); box-shadow: none; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); box-shadow: none; }
button.danger:hover { color: var(--danger); background: var(--tint-bad); box-shadow: none; }
button.ghost { background: transparent; color: var(--muted); box-shadow: none; } button.ghost:hover { color: var(--fg); background: var(--tint-info); box-shadow: none; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }
.sm { min-height: 32px; padding: 5px 11px; font-size: var(--fs-sm); width: auto; }
@media (pointer: coarse) { .sm { min-height: 36px; } }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.45); pointer-events: none; animation: ripple var(--dur-5) var(--ease-out); }

/* ---------- badges, notes, lists ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; border: 1px solid; }
.badge.high { color: var(--ok); border-color: var(--ok); background: var(--tint-ok); }
.badge.med { color: var(--warn); border-color: var(--warn); background: var(--tint-warn); }
.badge.low { color: var(--danger); border-color: var(--danger); background: var(--tint-bad); }
.badge.info { color: var(--muted); border-color: var(--line-strong); background: var(--tint-info); }
.note-info { color: var(--muted); } .note-warn { color: var(--warn); } .note-error { color: var(--danger); }
.warn { color: var(--warn); font-size: var(--fs-sm); margin: 4px 0; }
.status { font-size: var(--fs-sm); color: var(--muted); }
.cvlist { list-style: none; padding: 0; margin: 0; }
.cvlist li { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cvlist .grow { flex: 1; min-width: 160px; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; animation: step-in var(--dur-4) var(--ease-out) both; }
kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; font: inherit; font-size: .8em; background: var(--surface-2); }

/* ---------- review / diff ---------- */
.change { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; margin-bottom: 10px; background: var(--surface); transition: border-color var(--dur-2), opacity var(--dur-2), transform var(--dur-3) var(--ease-out); }
.change:hover { border-color: var(--line-strong); }
.change.off { opacity: .62; }
.change label { display: flex; gap: 12px; align-items: flex-start; color: var(--fg); font-size: var(--fs-md); cursor: pointer; }
.change input[type=checkbox] { margin-top: 4px; }
.change .meta { margin: 6px 0 0 32px; font-size: var(--fs-sm); }
.diff { font-size: var(--fs-sm); margin: 4px 0; }
.diff .old, .diff .new { white-space: pre-wrap; display: block; padding: 6px 10px; border-radius: 8px; }
.diff .old { color: var(--danger); background: var(--tint-bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.diff .new { color: var(--ok); background: var(--tint-ok); animation: morph-in var(--dur-4) var(--ease-out) both; }
.checks label { display: flex; gap: 10px; align-items: center; color: var(--fg); }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: 56px minmax(340px, 480px) 1fr; height: calc(100vh - 61px); height: calc(100dvh - 61px); }
.editor .rail { display: flex; flex-direction: column; gap: 4px; padding: 10px 6px; border-right: 1px solid var(--line); overflow: auto; background: var(--bg-2); }
.editor .rail a { display: grid; place-items: center; min-height: var(--tap); border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 1.05rem; transition: background var(--dur-2), color var(--dur-2); }
.editor .rail a:hover, .editor .rail a.on { background: var(--tint-ok); color: var(--accent); }
.editor .panel { overflow: auto; padding: 16px; border-right: 1px solid var(--line); background: var(--surface); scroll-behavior: smooth; }
.editor .preview { padding: 14px; overflow: hidden; position: relative; background: var(--bg-2); display: flex; flex-direction: column; gap: 10px; }
.editor iframe { width: 100%; flex: 1; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-2); transition: opacity var(--dur-3) var(--ease-out); }
.editor iframe.swap { opacity: .15; }
.editor iframe.glow { animation: preview-glow 1.1s var(--ease-out); }
details.sec { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 10px; background: var(--surface-2); overflow: hidden; }
details.sec > summary { cursor: pointer; padding: 14px 16px; min-height: var(--tap); font-weight: 600; font-family: var(--font-display); list-style: none; display: flex; align-items: center; gap: 8px; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--dur-3) var(--ease-out); }
details.sec[open] > summary::after { transform: rotate(-135deg); }
details.sec .body { padding: 0 16px 16px; animation: expand-in var(--dur-3) var(--ease-out); }
.entry { border: 1px dashed var(--line-strong); border-radius: var(--r-sm); padding: 12px; margin-bottom: 12px; background: var(--surface); transition: transform var(--dur-3) var(--ease-spring), box-shadow var(--dur-3), opacity var(--dur-2); }
.entry .tools { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 8px; }
.entry .tools button { min-height: 32px; padding: 2px 10px; font-size: var(--fs-xs); }
.entry.dragging { opacity: .45; transform: scale(.98); }
.entry.over { outline: 2px dashed var(--emerald); outline-offset: 3px; background: var(--tint-ok); transform: translateY(4px); }
.handle { cursor: grab; user-select: none; padding: 4px 8px; color: var(--muted); margin-right: auto; touch-action: none; }
.aitools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.aipanel { border: 1px solid var(--emerald); border-radius: var(--r-md); padding: 12px; margin-bottom: 10px; background: var(--tint-ok); box-shadow: var(--glow); animation: expand-in var(--dur-3) var(--ease-out); }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; height: auto; } .editor .rail { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); } .editor iframe { height: 70vh; flex: none; } .editor .panel { border-right: 0; } }

/* ---------- meters, rings, skeleton, toast ---------- */
.ring { --p: 0; --size: 84px; width: var(--size); height: var(--size); position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ring .track { stroke: var(--line); } .ring .bar { stroke: url(#fp-grad); stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p)); transition: stroke-dashoffset var(--dur-5) var(--ease-out); }
.ring.low .bar { stroke: var(--coral); } .ring.med .bar { stroke: var(--amber); }
.ring b { font: 700 calc(var(--size) * .27)/1 var(--font-display); }
.skeleton { position: relative; overflow: hidden; background: var(--tint-info); border-radius: var(--r-sm); min-height: 1em; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent); animation: shimmer 1.4s infinite; }
.thinking { background: linear-gradient(90deg, var(--muted) 20%, var(--fg) 40%, var(--emerald) 50%, var(--fg) 60%, var(--muted) 80%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer-text 2s linear infinite; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 0 rgba(16,185,129,.6); animation: pulse 1.6s infinite; vertical-align: middle; }
.toasts { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface-2); color: var(--fg); border: 1px solid var(--line-strong); box-shadow: var(--shadow-3); animation: toast-in var(--dur-4) var(--ease-spring) both; }
.toast.out { animation: toast-out var(--dur-3) var(--ease-in-out) forwards; }
.toast .toast-act { margin-left: auto; min-height: 34px; padding: 6px 14px; font-size: var(--fs-sm); box-shadow: none; }
.toast .tick { width: 22px; height: 22px; flex: none; } .toast .tick path { fill: none; stroke: var(--emerald); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw var(--dur-4) .15s var(--ease-out) forwards; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; }
.cmdk { position: fixed; inset: 0; z-index: 500; display: grid; place-items: start center; padding-top: 14vh; background: rgba(5,8,18,.55); backdrop-filter: blur(4px); }
.cmdk .box { width: min(560px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-3); overflow: hidden; animation: pop-in var(--dur-3) var(--ease-spring); }
.cmdk input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; min-height: 56px; font-size: var(--fs-lg); box-shadow: none !important; }
.cmdk ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.cmdk li { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; cursor: pointer; min-height: var(--tap); }
.cmdk li[aria-selected=true] { background: var(--tint-ok); color: var(--accent); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-3); }

/* ---------- empty / error illustrations ---------- */
.empty { text-align: center; padding: var(--s-7) var(--s-4); } .empty svg { width: min(220px, 60%); height: auto; margin-bottom: var(--s-4); }
.illus .stroke { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; } .illus .fill { fill: url(#fp-grad); opacity: .85; } .illus .soft { fill: var(--tint-info); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .skeleton::after, .live-dot, .thinking { animation: none; }
}

@media (max-width: 560px) { nav.top { gap: 8px; } .hide-sm { display: none !important; } }

html.lenis, html.lenis body { height: auto; } .lenis.lenis-smooth { scroll-behavior: auto !important; } .lenis.lenis-stopped { overflow: clip; }

[hidden] { display: none !important; }

[hidden] { display: none !important; }

/* ambient colour wash behind every page (static, cheap to paint) */
body::after { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; background: radial-gradient(60vmax 40vmax at 8% -12%, var(--aurora-a), transparent 70%), radial-gradient(50vmax 40vmax at 100% -6%, var(--aurora-b), transparent 70%); opacity: .55; }

.editor .rail a::before { content: attr(data-g); }
.only-sm { display: none; } @media (max-width: 560px) { .only-sm { display: block; } }
