/* ==========================================================================
   Enigma — base: tokens, reset, typography, themes, buttons, form controls
   ========================================================================== */

@property --led {
  syntax: '<color>';
  inherits: true;
  initial-value: #FF3B3B;
}
@property --lac {
  syntax: '<color>';
  inherits: true;
  initial-value: #D8B49A;
}

:root {
  /* Palette — pearl skin, cocoa ink, espresso night, one fuchsia (the nail-bar chairs) */
  --pearl: #F2ECE6;
  --pearl-2: #E8DFD6;
  --milk: #FBF8F4;
  --cocoa: #2B1D19;
  --cocoa-2: #4A3630;
  --espresso: #19110F;
  --espresso-2: #231816;
  --espresso-3: #33241F;
  --fuchsia: #C0185C;
  --fuchsia-hi: #D62A70;
  --blush: #F0A6C3;
  --jade: #5F7D6C;
  --muted-light: #6B5A52;
  --muted-dark: #B5A59C;

  /* Paper grain: a tiny turbulence tile, rasterised once */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.17 0 0 0 0 0.11 0 0 0 0 0.1 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* Type */
  --f-serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --f-sans: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --fs-h1: clamp(3.1rem, 1.5rem + 6.6vw, 9.25rem);
  --fs-h2: clamp(2.3rem, 1.4rem + 3.6vw, 5.4rem);
  --fs-h3: clamp(1.5rem, 1.2rem + 1.1vw, 2.2rem);
  --fs-lead: clamp(1.12rem, 1rem + 0.5vw, 1.42rem);
  --fs-body: clamp(1rem, 0.96rem + 0.18vw, 1.1rem);
  --fs-small: 0.875rem;
  --fs-label: 0.72rem;

  /* Space — deliberately uneven rhythm */
  --gutter: clamp(1rem, 0.6rem + 2.4vw, 3rem);
  --space-2xl: clamp(7rem, 4rem + 10vw, 15rem);
  --space-xl: clamp(5rem, 3rem + 6vw, 9.5rem);
  --space-l: clamp(3rem, 2rem + 3vw, 5rem);
  --space-m: clamp(1.75rem, 1.2rem + 1.5vw, 2.75rem);
  --space-s: 1rem;
  --max: 1440px;

  /* Shape — the mirror: everything soft is an oval or a pill */
  --r-pill: 999px;
  --r-card: 28px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.83, 0, 0.17, 1);
  --ease-soft: cubic-bezier(0.45, 0, 0.2, 1);
  --t-fast: 180ms;
  --t-med: 450ms;

  --nav-h: 78px;
}

/* Themes: day = pearl, night = espresso */
[data-theme="pearl"], :root {
  --bg: var(--pearl);
  --bg-2: var(--pearl-2);
  --fg: var(--cocoa);
  --muted: var(--muted-light);
  --line: rgba(43, 29, 25, 0.14);
  --line-strong: rgba(43, 29, 25, 0.42);
  --accent: var(--fuchsia);
  --on-accent: var(--milk);
}
[data-theme="espresso"] {
  --bg: var(--espresso);
  --bg-2: var(--espresso-2);
  --fg: var(--pearl);
  --muted: var(--muted-dark);
  --line: rgba(242, 236, 230, 0.13);
  --line-strong: rgba(242, 236, 230, 0.42);
  --accent: var(--blush);
  --on-accent: var(--espresso);
}
[data-theme] { background-color: var(--bg); background-image: var(--grain); color: var(--fg); }

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  background: var(--pearl) var(--grain);
  color: var(--cocoa);
  font-family: var(--f-sans);
  font-size: var(--fs-body);
  font-variation-settings: 'wdth' 100;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body[data-nav-theme="espresso"] { background-color: var(--espresso); }
img, svg, video, iframe, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul[class], ol[class] { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-weight: 400; line-height: 1; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--fuchsia); color: var(--milk); }

[hidden] { display: none !important; }
.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;
}
.skip {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 400;
  padding: 0.7rem 1.1rem; border-radius: var(--r-pill); background: var(--cocoa); color: var(--pearl);
  transform: translateY(-180%); transition: transform var(--t-fast);
}
.skip:focus { transform: none; }

:focus-visible { outline: 2px solid var(--fuchsia); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }
[data-theme="espresso"] :focus-visible { outline-color: var(--blush); }

/* Typography */
.h1, .h2, .h3, .serif { font-family: var(--f-serif); letter-spacing: -0.012em; }
.h1 { font-size: var(--fs-h1); line-height: 0.9; }
.h2 { font-size: var(--fs-h2); line-height: 0.95; }
.h3 { font-size: var(--fs-h3); line-height: 1.05; }
.h1 em, .h2 em, .h3 em, .serif em { font-style: italic; }
[data-theme="espresso"] .h1 em, [data-theme="espresso"] .h2 em { color: var(--blush); }
.lead { font-size: var(--fs-lead); line-height: 1.45; max-width: 34ch; }
.muted { color: var(--muted); }
.label {
  display: inline-flex; align-items: center; gap: 0.7em;
  font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  font-variation-settings: 'wdth' 88;
  color: var(--muted);
}
.label::before { content: ''; width: 1.6em; height: 1px; background: var(--accent); flex: none; }

/* Wordmark (Pinyon Script outlines) */
.wordmark { width: 100%; height: auto; overflow: visible; }
.wordmark path { fill: currentColor; }

/* Links */
.link-u {
  position: relative; display: inline-block; font-weight: 500;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size var(--t-med) var(--ease-out);
}
.link-u:hover { background-size: 0 1px; background-position: 100% 100%; }

/* Buttons — pills; the fill rises like steam */
.btn {
  --b-bg: transparent; --b-fg: var(--fg); --b-line: var(--line-strong); --b-fill: var(--fg); --b-fill-fg: var(--bg);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 52px; padding: 0.85rem 1.7rem; border-radius: var(--r-pill);
  background: var(--b-bg); color: var(--b-fg); box-shadow: inset 0 0 0 1px var(--b-line);
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  transition: color var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out), transform var(--t-fast);
}
.btn::before {
  content: ''; position: absolute; inset: -2px; z-index: -1; border-radius: inherit;
  background: var(--b-fill); transform: translateY(102%); transition: transform 600ms var(--ease-out);
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: var(--b-fill-fg); box-shadow: inset 0 0 0 1px transparent; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn--sm { min-height: 42px; padding: 0.6rem 1.25rem; font-size: 0.875rem; }
.btn--fuchsia { --b-bg: var(--fuchsia); --b-fg: var(--milk); --b-line: transparent; --b-fill: var(--cocoa); --b-fill-fg: var(--milk); }
[data-theme="espresso"] .btn--fuchsia { --b-fill: var(--pearl); --b-fill-fg: var(--espresso); }
.btn--line { --b-fill: var(--fg); --b-fill-fg: var(--bg); }
.btn--block { width: 100%; }
.btn .arrow { transition: transform var(--t-med) var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }

/* Form controls */
.field { display: grid; gap: 0.45rem; }
.field label, .field legend { font-size: var(--fs-small); font-weight: 600; }
.field .opt { color: var(--muted); font-weight: 400; }
.input, .textarea {
  width: 100%; min-height: 54px; padding: 0.85rem 1.1rem; border-radius: 18px;
  background: var(--milk); border: 1px solid var(--line); color: var(--cocoa);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-color: var(--fuchsia); box-shadow: 0 0 0 3px rgba(192, 24, 92, 0.15); }

/* Layout helpers */
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.section { padding-block: var(--space-xl); }

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