/* ============================================================================
   LUMINA · 拾光  —  01 Foundation
   Design tokens, reset, typography, layout primitives, motion
   ========================================================================== */

/* ------------------------------------------------------------------ tokens */
:root {
  /* ink */
  --ink-950: #08090A;
  --ink-900: #0D0F11;
  --ink-850: #121417;
  --ink-800: #171A1E;
  --ink-700: #22262B;
  --ink-600: #33383F;
  --ink-500: #4B5158;
  --ink-400: #6E747C;
  --ink-300: #949AA1;

  /* paper */
  --paper: #F7F4ED;
  --paper-2: #F0EBE1;
  --paper-3: #E5DFD2;
  --paper-4: #D6CFC0;

  /* accents — light is the subject matter of this brand */
  --brass: #9C6B25;
  --brass-2: #BC8A3D;
  --glow: #E7CE97;
  --sage: #5B6F63;
  --douyin-red: #FE2C55;
  --douyin-cyan: #25F4EE;

  /* semantic */
  --bg: var(--paper);
  --fg: var(--ink-900);
  --fg-soft: var(--ink-500);
  --fg-mute: var(--ink-400);
  --line: rgba(13, 15, 17, .12);
  --line-strong: rgba(13, 15, 17, .24);
  --surface: #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(13, 15, 17, .05), 0 10px 26px -14px rgba(13, 15, 17, .18);
  --shadow-md: 0 2px 6px rgba(13, 15, 17, .06), 0 28px 64px -30px rgba(13, 15, 17, .34);
  --shadow-lg: 0 44px 110px -44px rgba(13, 15, 17, .5);

  /* type */
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei",
    "Source Han Sans SC", "Noto Sans SC", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", var(--font-serif);
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Roboto Mono", monospace;

  /* metrics */
  --gutter: clamp(18px, 4.2vw, 64px);
  --container: 1320px;
  --section-y: clamp(64px, 8.6vw, 148px);

  --r-xs: 3px;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --r-xl: 34px;

  --ease: cubic-bezier(.22, .68, 0, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, .05, .36, 1);
}

/* dark theme scope — flip the semantic layer only */
.theme-dark {
  --bg: var(--ink-950);
  --fg: #F4F1EA;
  --fg-soft: rgba(244, 241, 234, .64);
  --fg-mute: rgba(244, 241, 234, .42);
  --line: rgba(244, 241, 234, .13);
  --line-strong: rgba(244, 241, 234, .28);
  --surface: var(--ink-850);
  --brass: #C9A15E;
  --brass-2: #DBB87C;
  background-color: var(--bg);
  color: var(--fg);
}

/* ------------------------------------------------------------------- reset */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--ink-300) transparent;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* `clip` (not `hidden`) so `position: sticky` descendants keep working */
  overflow-x: clip;
}

body.is-locked { overflow: hidden; }

img,
svg,
video,
canvas { display: block; max-width: 100%; }

img { height: auto; border-style: none; }

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol { list-style: none; padding: 0; }

table { border-collapse: collapse; }

::selection {
  background: var(--brass);
  color: #FFF9EC;
}

:focus-visible {
  outline: 2px solid var(--brass-2);
  outline-offset: 3px;
  border-radius: 2px;
}

/* thin custom scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(13, 15, 17, .22);
  border: 3px solid transparent;
  border-radius: 99px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(13, 15, 17, .4); background-clip: content-box; }
.theme-dark ::-webkit-scrollbar-thumb { background: rgba(244, 241, 234, .24); background-clip: content-box; }

/* ------------------------------------------------------------------- grain */
/* a fixed film-grain veil. keeps flat surfaces from feeling digital-dead. */
.grain-veil {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: multiply;
  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='0.82' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='.55'/></svg>");
}

/* -------------------------------------------------------------- typography */
.display-1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3.1rem, 10.4vw, 10.5rem);
  line-height: .88;
  letter-spacing: -.028em;
}

.display-2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 5.4vw, 4.6rem);
  line-height: .98;
  letter-spacing: -.02em;
}

.h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.9rem);
  line-height: 1.14;
  font-weight: 600;
  letter-spacing: -.01em;
}

.h2 {
  font-size: clamp(1.7rem, 3.1vw, 2.9rem);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.008em;
}

.h3 {
  font-size: clamp(1.16rem, 1.7vw, 1.5rem);
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0;
}

.h4 {
  font-size: 1.0625rem;
  line-height: 1.45;
  font-weight: 600;
}

.lede {
  font-size: clamp(1rem, 1.22vw, 1.2rem);
  line-height: 1.85;
  color: var(--fg-soft);
}

.lede strong,
.body-sm strong {
  color: var(--fg);
  font-weight: 600;
}

.body-sm {
  font-size: .875rem;
  line-height: 1.75;
  color: var(--fg-soft);
}

.serif { font-family: var(--font-serif); }
.latin-serif { font-family: var(--font-display); font-weight: 400; }

/* the small tracked label that anchors every section */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--fg-mute);
  line-height: 1;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: .7;
}

.eyebrow--plain::before { display: none; }

.eyebrow--brass { color: var(--brass); }

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.mono { font-family: var(--font-mono); }

/* ---------------------------------------------------------------- layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: 940px; }
.container--wide { max-width: 1560px; }

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--tight { padding-block: clamp(44px, 5.4vw, 88px); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(20px, 3vw, 56px);
  margin-bottom: clamp(32px, 4vw, 64px);
}

.section-head__main { max-width: 62ch; }

.section-head__main .eyebrow { margin-bottom: 18px; }

.section-head__main .h2 + p { margin-top: 18px; }

.section-head__aside {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.grid { display: grid; gap: clamp(16px, 2vw, 28px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.hairline {
  height: 1px;
  border: 0;
  background: var(--line);
  width: 100%;
}

/* a labelled rule, e.g.  ——— EXIF ————————— */
.rule-label {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--fg-mute);
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.rule-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--ink-900);
  --btn-fg: #FFF9EC;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  padding: 0 26px;
  height: 50px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform .5s var(--ease-out), background-color .4s var(--ease), color .4s var(--ease), box-shadow .5s var(--ease);
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 160% at 50% 120%, var(--brass-2), transparent 70%);
  opacity: 0;
  transition: opacity .5s var(--ease);
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:hover::after { opacity: .18; }
.btn:active { transform: translateY(0) scale(.985); }

.btn svg { width: 15px; height: 15px; flex: none; }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn--ghost:hover {
  --btn-fg: var(--fg);
  box-shadow: inset 0 0 0 1px var(--fg), var(--shadow-sm);
}

.btn--light { --btn-bg: var(--paper); --btn-fg: var(--ink-900); }
.btn--brass { --btn-bg: var(--brass); --btn-fg: #FFF9EC; }
.btn--lg { height: 58px; padding: 0 34px; font-size: .9375rem; }
.btn--sm { height: 40px; padding: 0 18px; font-size: .8125rem; }
.btn--block { width: 100%; }

.btn[disabled] { opacity: .45; pointer-events: none; }

/* text link with an animated underline */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .02em;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color .4s var(--ease), gap .4s var(--ease), color .4s var(--ease);
}

.link-arrow svg { width: 14px; height: 14px; transition: transform .4s var(--ease); }
.link-arrow:hover { border-color: var(--fg); gap: .85em; }
.link-arrow:hover svg { transform: translateX(2px); }

/* icon button */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .35s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease);
}

.icon-btn:hover {
  background: rgba(127, 127, 127, .1);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.icon-btn svg { width: 17px; height: 17px; }

/* ------------------------------------------------------------------ chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  height: 38px;
  padding: 0 17px;
  border-radius: 999px;
  font-size: .8125rem;
  letter-spacing: .03em;
  color: var(--fg-soft);
  box-shadow: inset 0 0 0 1px var(--line);
  background: transparent;
  transition: color .35s var(--ease), background-color .35s var(--ease), box-shadow .35s var(--ease);
  white-space: nowrap;
}

.chip:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong); }

.chip.is-active {
  background: var(--ink-900);
  color: #FFF9EC;
  box-shadow: inset 0 0 0 1px var(--ink-900);
}

.theme-dark .chip.is-active { background: var(--paper); color: var(--ink-900); }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

/* a tiny label sitting on media */
.tag {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .625rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: rgba(9, 10, 12, .58);
  color: #F3EEE2;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ------------------------------------------------------------------ forms */
.field { display: block; }

.field + .field { margin-top: 22px; }

.field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .03em;
  margin-bottom: 9px;
  color: var(--fg);
}

.field__label em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  color: var(--fg-mute);
  font-weight: 400;
}

.input,
.textarea,
.select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--fg);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), background-color .3s var(--ease);
}

.theme-dark .input,
.theme-dark .textarea,
.theme-dark .select { background-color: rgba(255, 255, 255, .04); }

.input::placeholder,
.textarea::placeholder { color: var(--fg-mute); }

.input:hover,
.textarea:hover,
.select:hover { border-color: var(--line-strong); }

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--brass-2);
  box-shadow: 0 0 0 4px rgba(188, 138, 61, .14);
}

.textarea { resize: vertical; min-height: 118px; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236E747C' stroke-width='1.4' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 42px;
}

.hint {
  font-size: .75rem;
  line-height: 1.6;
  color: var(--fg-mute);
  margin-top: 8px;
}

/* switch */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: rgba(127, 127, 127, .28);
  flex: none;
  transition: background-color .35s var(--ease);
  cursor: pointer;
}

.switch::after {
  content: "";
  position: absolute;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #FFFDF7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
  transition: transform .38s var(--ease-out);
}

.switch[aria-checked="true"] { background: var(--ink-900); }
.switch[aria-checked="true"]::after { transform: translateX(19px); }

/* ----------------------------------------------------------------- motion */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity .95s var(--ease-out),
    transform .95s var(--ease-out);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

[data-reveal="fade"] { transform: none; }

[data-reveal="right"] { transform: translateX(-24px); }

[data-reveal="scale"] { transform: scale(.965); }

/* clip-reveal for headline lines */
.line-mask { display: block; overflow: hidden; }

.line-mask > span {
  display: block;
  transform: translateY(112%);
  transition: transform 1.1s var(--ease-out);
  transition-delay: var(--d, 0s);
}

.is-in .line-mask > span,
.line-mask.is-in > span { transform: none; }

/* masonry reveals must not translate (css columns) */
.masonry [data-reveal] { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal],
  .line-mask > span {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  .hero__bg-img,
  .marquee__track,
  .sync-chip,
  .scroll-cue__line::after,
  .hero__title .line-mask > span,
  .hero__copy .eyebrow,
  .hero__lede,
  .hero__actions,
  .hero__stack,
  .hero__foot { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ------------------------------------------------------------------ utils */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.is-hidden { display: none !important; }

.u-mt-0 { margin-top: 0 !important; }
.u-mt-1 { margin-top: 8px; }
.u-mt-2 { margin-top: 16px; }
.u-mt-3 { margin-top: 24px; }
.u-mt-4 { margin-top: 40px; }
.u-center { text-align: center; }
.u-mx-auto { margin-inline: auto; }

/* decorative sprocket dots — the film edge motif */
.film-edge {
  height: 15px;
  background-image: radial-gradient(circle at 7px 7.5px, currentColor 2.4px, transparent 2.9px);
  background-size: 21px 15px;
  background-repeat: repeat-x;
  opacity: .26;
}

/* -------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .grid-2,
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .section-head { align-items: flex-start; }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .btn { height: 46px; padding: 0 21px; }
  .btn--lg { height: 52px; padding: 0 26px; }
}
