@import url("https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=JetBrains+Mono:wght@400;600&family=Noto+Sans+TC:wght@400;500;700;900&display=swap");

/* LUYU LAB — generated from tokens/tokens.json. Do not edit; run npm run build. */
:root {
  --bg: #111410;
  --surface: #191D18;
  --frame: #0E100F;
  --line: #2B3129;
  --hud: #363E33;
  --fg: #E9EEE6;
  --muted: #939B8E;
  --accent: #5F7A4A;
  --on-accent: #F3F6F0;
  --accent-text: #A8C38E;
  --font-head: "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  --font-tech: "Chakra Petch", "Noto Sans TC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-11: 44px;
  --space-14: 56px;
  --radius-0: 0;
  --radius-sm: 4px;
  --radius-md: 10px;
  --slant: 18px;
  --stroke-hair: 1px;
  --stroke-card: 2px;
  --stroke-active: 3px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #E4E8E0;
    --surface: #EFF2EB;
    --frame: #14171A;
    --line: #CDD4C7;
    --hud: #BFC8B9;
    --fg: #141911;
    --muted: #5F685C;
    --accent: #4D6640;
    --on-accent: #F3F6F0;
    --accent-text: #415A37;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #E4E8E0;
  --surface: #EFF2EB;
  --frame: #14171A;
  --line: #CDD4C7;
  --hud: #BFC8B9;
  --fg: #141911;
  --muted: #5F685C;
  --accent: #4D6640;
  --on-accent: #F3F6F0;
  --accent-text: #415A37;
  color-scheme: light;
}
.ll-dark {
  --bg: #111410;
  --surface: #191D18;
  --frame: #0E100F;
  --line: #2B3129;
  --hud: #363E33;
  --fg: #E9EEE6;
  --muted: #939B8E;
  --accent: #5F7A4A;
  --on-accent: #F3F6F0;
  --accent-text: #A8C38E;
  color-scheme: dark;
}
.ll-t-display { font-family: var(--font-head); font-size: 104px; line-height: 1.18; font-weight: 900; letter-spacing: 0.02em; }
.ll-t-subtitle { font-family: var(--font-head); font-size: 24px; line-height: 1.5; font-weight: 700; letter-spacing: 0.04em; }
.ll-t-heading { font-family: var(--font-head); font-size: 32px; line-height: 1.3; font-weight: 900; }
.ll-t-nav { font-family: var(--font-head); font-size: 22px; line-height: 1; font-weight: 500; letter-spacing: 0.06em; }
.ll-t-button { font-family: var(--font-head); font-size: 24px; line-height: 1; font-weight: 700; letter-spacing: 0.08em; }
.ll-t-body { font-family: var(--font-head); font-size: 16px; line-height: 1.75; font-weight: 400; }
.ll-t-small { font-family: var(--font-head); font-size: 14px; line-height: 1.6; font-weight: 500; }
.ll-t-wordmark { font-family: var(--font-tech); font-size: 40px; line-height: 1; font-weight: 700; letter-spacing: 0.14em; }
.ll-t-card-title { font-family: var(--font-tech); font-size: 27px; line-height: 1.1; font-weight: 700; letter-spacing: 0.06em; }
.ll-t-label { font-family: var(--font-tech); font-size: 12px; line-height: 1; font-weight: 600; letter-spacing: 0.12em; }
.ll-t-readout { font-family: var(--font-mono); font-size: 14px; line-height: 1.75; font-weight: 400; font-variant-numeric: tabular-nums; }

/* LUYU LAB components. Every value comes from tokens.css; class prefix ll-. */

/* ── base (opt-in: add class="ll" to <body>, or copy these rules) ── */
.ll { background: var(--bg); color: var(--fg); font: 400 16px/1.75 var(--font-head); margin: 0; transition: background-color .3s, color .3s; }
.ll *, .ll *::before, .ll *::after { box-sizing: border-box; }
.ll :focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; }
.ll-wrap { max-width: 1240px; margin: 0 auto; padding-left: max(var(--space-4), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-4), env(safe-area-inset-right, 0px)); }
.ll-row { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: center; }
.ll-accent { color: var(--accent-text); font-style: normal; }
.ll-muted { color: var(--muted); }

/* ── Button: parallelogram ── */
.ll-btn { position: relative; display: inline-flex; align-items: center; gap: 22px; padding: 18px 40px 18px 44px; font: 700 clamp(17px, 1.6vw, 21px)/1 var(--font-head); letter-spacing: .08em; border: none; cursor: pointer; text-decoration: none; clip-path: polygon(var(--slant) 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%); transition: transform .15s; }
.ll-btn > * { position: relative; }
.ll-btn svg { width: 12px; height: 18px; }
.ll-btn--primary { background: var(--accent); color: var(--on-accent); }
.ll-btn--outline { background: var(--fg); color: var(--fg); }
.ll-btn--outline::before { content: ""; position: absolute; inset: var(--stroke-card); background: var(--bg); clip-path: polygon(calc(var(--slant) - 1px) 0, 100% 0, calc(100% - var(--slant) + 1px) 100%, 0 100%); transition: background-color .3s; }
.ll-btn:hover { transform: translateX(3px); }
.ll-btn:focus-visible { outline: var(--stroke-card) solid var(--accent-text); outline-offset: 4px; }
.ll-btn--sm { padding: 12px 28px 12px 32px; font-size: 16px; gap: 14px; }

/* ── Section heading: label + h2 + intro ── */
.ll-sec { border-top: var(--stroke-hair) solid var(--line); padding-block: var(--space-14); }
.ll-sec-h { display: flex; align-items: baseline; gap: var(--space-4); flex-wrap: wrap; margin: 0 0 28px; }
.ll-sec-h h2 { margin: 0; font: 900 clamp(28px, 3.2vw, 38px)/1.25 var(--font-head); }
.ll-sec-h small { font: 600 12px/1 var(--font-tech); letter-spacing: .2em; color: var(--accent-text); }
.ll-sec-h p { flex-basis: 100%; margin: 6px 0 0; color: var(--muted); max-width: 40em; }

/* ── CategoryCard: chamfered, photo left ── */
.ll-cat { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); border: var(--stroke-hair) solid var(--line); background: var(--surface); color: var(--fg); text-decoration: none; min-height: 168px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%); transition: border-color .2s, transform .2s; }
.ll-cat::after { content: ""; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; background: linear-gradient(135deg, transparent 50%, var(--hud) 50%); }
.ll-cat:hover { border-color: var(--accent); transform: translateY(-2px); }
.ll-cat:hover::after { background: linear-gradient(135deg, transparent 50%, var(--accent) 50%); }
.ll-cat img { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--frame); }
.ll-cat > div { padding: 20px 18px; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.ll-cat b { font: 700 clamp(18px, 1.8vw, 24px)/1.1 var(--font-tech); letter-spacing: .06em; }
.ll-cat span { display: flex; align-items: center; gap: 10px; font: 500 15px/1.4 var(--font-head); color: var(--muted); }
.ll-cat span svg { width: 9px; height: 14px; }
.ll-cat u { display: block; width: 52px; height: 3px; background: var(--hud); margin-top: 8px; transition: background-color .2s; }
.ll-cat:hover span { color: var(--accent-text); }
.ll-cat:hover u { background: var(--accent); }

/* ── Photo container (always dark) ── */
.ll-photo { position: relative; aspect-ratio: 3 / 2; }
.ll-photo__clip { position: absolute; inset: 0; background: var(--frame); overflow: hidden; clip-path: polygon(56px 0, 100% 0, 100% 100%, 0 100%, 0 56px); }
.ll-photo__clip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ll-photo--plain .ll-photo__clip { clip-path: none; border-radius: var(--radius-sm); }

/* ── Halo: <luyu-halo> inside .ll-photo; overflows the photo ── */
luyu-halo { position: absolute; inset: -6% -4%; pointer-events: none; z-index: 1; display: block; }
luyu-halo svg { width: 100%; height: 100%; overflow: visible; display: block; }
luyu-halo .ring { fill: none; stroke: var(--hud); stroke-width: 1.5; }
luyu-halo .dash { fill: none; stroke: var(--hud); stroke-width: 1.5; stroke-dasharray: 2 7; }
luyu-halo .tick { fill: none; stroke: var(--accent); stroke-width: 7; stroke-dasharray: 3 6; opacity: .6; }
luyu-halo .x { stroke: var(--hud); stroke-width: 1.5; }
luyu-halo .spin { transform-origin: 400px 255px; animation: ll-spin 40s linear infinite; }
.ll-fast luyu-halo .spin { animation-duration: 3s; }
@keyframes ll-spin { to { transform: rotate(360deg); } }
.ll-clip-x { overflow-x: clip; }

/* ── ModelSwitcher: icon-only parallelograms on a photo (fixed dark values) ── */
.ll-switch { position: absolute; left: 12px; bottom: 10px; display: flex; gap: 2px; z-index: 2; }
.ll-switch button { width: 40px; height: 32px; padding: 0; border: none; background: none; cursor: pointer; display: grid; place-items: center; }
.ll-switch button::before { content: ""; width: 22px; height: 10px; background: rgba(233, 238, 230, .32); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); transition: background-color .15s, width .2s; }
.ll-switch button:hover::before { background: rgba(233, 238, 230, .7); }
.ll-switch button[aria-pressed="true"]::before { width: 32px; background: #7E9C66; }
.ll-switch button:focus-visible { outline: 2px solid #A8C38E; outline-offset: -2px; }

/* ── CoordReadout: one line, outside the photo ── */
.ll-readout { font: 400 12.5px/1 var(--font-mono); font-variant-numeric: tabular-nums; white-space: pre; color: var(--muted); }

/* ── HazardStripe & crosshair (decor, hud only) ── */
.ll-hazard { width: 170px; height: 22px; background: repeating-linear-gradient(-55deg, var(--hud) 0 9px, transparent 9px 19px); clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.ll-hazard--lg { width: 260px; }
.ll-cross { color: var(--hud); font: 300 22px/1 var(--font-mono); user-select: none; }

/* ── Spec list (mono, aligned numbers) ── */
.ll-spec { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; font: 400 13px/1.6 var(--font-mono); font-variant-numeric: tabular-nums; }
.ll-spec dt { color: var(--muted); }
.ll-spec dd { margin: 0; }

/* ── Toast (easter egg) ── */
.ll-toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50; background: #0E100F; color: #A8C38E; border: 1px solid #2B3129; font: 400 13px/1 var(--font-mono); padding: 12px 16px; transition: opacity .2s, transform .2s; }
.ll-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  luyu-halo .spin { animation: none; }
  .ll-btn, .ll-cat, .ll-switch button::before, .ll-toast { transition: none; }
  .ll-btn:hover, .ll-cat:hover { transform: none; }
}
