/* ============================================================
   base.css — reset, global typography, primitives, utilities
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Lenis controls scroll; keep native smooth off to avoid conflicts */
  scroll-behavior: auto;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--paper);
  background: var(--ink-900);
  font-feature-settings: "ss01", "cv11";
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

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

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

img,
video {
  height: auto;
  object-fit: cover;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

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

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---- Headings ---- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  font-optical-sizing: auto;
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { text-wrap: pretty; }

/* ============================================================
   Utilities
   ============================================================ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: clamp(28px, 4vw, 54px);
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* hero year range — wraps to tidy rows on narrow screens, tighter tracking,
   with the year range + count in gold and "years of making" dimmed */
.eyebrow--years {
  flex-wrap: wrap;
  row-gap: 0.4em;
  column-gap: 0.55em;
  letter-spacing: clamp(0.13em, 0.05em + 0.7vw, 0.34em);
}
.eyebrow--years .eyebrow__range,
.eyebrow--years .eyebrow__making {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.eyebrow--years .eyebrow__making { color: var(--paper-dim); }
.eyebrow--years .eyebrow__making::before {
  content: "·";
  margin-right: 0.5em;
  color: var(--paper-faint);
}
.eyebrow--years .eyebrow__making b { color: var(--accent); font-weight: 700; }
@media (max-width: 460px) {
  .eyebrow--years::before { width: 20px; }
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--paper-dim);
  max-width: var(--measure);
}

.muted { color: var(--paper-dim); }
.faint { color: var(--paper-faint); }

.u-hebrew {
  font-family: var(--font-hebrew);
  font-weight: 500;
  direction: rtl;
  unicode-bidi: isolate;
}

.u-serif { font-family: var(--font-display); }
.u-mono { font-family: var(--font-mono); }
.u-italic { font-style: italic; }

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

/* Gradient text helper */
.text-grad {
  background: linear-gradient(120deg, var(--paper) 30%, var(--accent) 65%, var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Buttons ---- */
.btn {
  --btn-fg: var(--accent-ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 1.02em 1.85em;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--btn-fg);
  background: var(--accent); /* fallback */
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--accent) 78%, white) 0%,
    var(--accent) 52%,
    color-mix(in oklab, var(--accent) 84%, black) 120%);
  border-radius: 100px;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16),
    0 12px 30px -12px var(--glow);
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.btn--lg {
  width: 100%;
  padding: 1.25em 2em;
  font-size: var(--fs-body);
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 700;
}
.btn--lg span { letter-spacing: 0.04em; }

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,0.35), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 18px 44px -10px var(--glow);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(-1px) scale(0.99); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--paper);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.btn .btn__icon {
  width: 1.1em;
  height: 1.1em;
  transition: transform var(--dur-fast) var(--ease-out);
}
.btn:hover .btn__icon { transform: translateX(3px) rotate(-2deg); }

/* Focus visibility — accessible on dark */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Custom scrollbar (non-Lenis browsers / fallback) */
@supports (scrollbar-color: auto) {
  html { scrollbar-color: var(--gold-deep) transparent; scrollbar-width: thin; }
}
