/* ==========================================================================
   Ananta Designs - base layer

   Reset, document defaults, typography and the small set of utilities the
   templates lean on. Ported from the prototype's globals.css, with the
   Tailwind layer removed: production is hand-written CSS so the stylesheet
   ships at a few kilobytes rather than a framework's worth.
   ========================================================================== */

/* ---- reset --------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchored sections must clear the fixed header, not hide beneath it. */
  scroll-padding-top: calc(var(--head-h) + 1rem);
}

body {
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

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

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

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

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

/* ---- typography ---------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* The display serif is the identity. Sizes are fluid between the phone and
   the 1320px shell so a heading never needs a breakpoint of its own. */
.t-display-xl {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.25rem, 1.6rem + 2.8vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -0.005em;
}

.t-display-lg {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.75rem, 1.35rem + 1.7vw, 2.5rem);
  line-height: 1.06;
  letter-spacing: -0.005em;
}

.t-display-md {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.5rem, 1.28rem + 0.95vw, 2.25rem);
  line-height: 1.12;
}

/* Section headings. The prototype steps this at one breakpoint rather than
   scaling fluidly - text-[1.35rem] leading-tight md:text-[1.75rem] - so the
   step is reproduced exactly instead of approximated with a clamp. */
.t-display-sm {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.35rem;
  line-height: 1.25;
}

@media (min-width: 768px) {
  .t-display-sm {
    font-size: 1.75rem;
  }
}

/* The section kicker - the gold micro-caps line above a heading.

   Matches the prototype's inline treatment for this role exactly:
   text-[11px] font-medium tracking-[0.18em] uppercase, at the default 1.5
   line-height. It does NOT take the prototype's `.eyebrow` utility values
   (0.24em / line-height 1), because that utility serves badges, field labels
   and fieldset legends - roles which here carry their own rules in
   components.css (`.badge`, `.field__label`) and keep 0.24em.

   Product category labels are a third value again (0.16em); they are set on
   `.product-card__cat` and `.product-summary__cat`. */
.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--gold);
}

/* Prices, counts and quantities. Tabular figures stop a changing number from
   shifting the layout beside it. */
.numerals {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.lede {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--fg-dim);
}

/* ---- selection and focus ------------------------------------------------- */

::selection {
  background: var(--gold);
  color: #0a0a0a;
}

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

/* Never leave a keyboard user without a focus ring, but keep mouse users
   out of it. */
:focus:not(:focus-visible) {
  outline: none;
}

button,
[role="button"],
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

/* ---- layout utilities ---------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell-wide {
  width: 100%;
  max-width: var(--shell-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Edge-to-edge horizontal rails that still line up with .shell padding. */
.rail {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
}

/* Pad a rail to the page gutter AND tell scroll-snap about that padding - without the scroll-padding the first card snaps flush to the viewport edge
   and silently cancels the inline padding. */
.rail-gutter {
  padding-inline: var(--gutter);
  scroll-padding-inline: var(--gutter);
}

.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.hairline-t {
  border-top: 1px solid var(--line);
}

.hairline-b {
  border-bottom: 1px solid var(--line);
}

/* Safe-area aware bottom spacing for the sticky mobile bars. */
.pb-safe {
  padding-bottom: max(env(safe-area-inset-bottom), 0px);
}

.bottom-safe {
  bottom: max(env(safe-area-inset-bottom), 0px);
}

/* ---- the grain plate -----------------------------------------------------
   One rasterised noise tile, reused by every plate on the page. It is what
   stops a flat near-black rectangle reading as an empty div - the same
   treatment the prototype used behind its generated artwork, kept here for
   the studio frames and product placeholders. */

.grain {
  position: relative;
  isolation: isolate;
}

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: var(--grain-opacity, 0.32);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ---- accessibility helpers ----------------------------------------------- */

.screen-reader-text,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: var(--z-skip);
  width: auto;
  height: auto;
  clip-path: none;
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--gold);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---- motion --------------------------------------------------------------
   The prototype animated with GSAP. Production uses CSS plus one
   IntersectionObserver, so nothing is ever permanently invisible: the reveal
   start-state applies only when <html class="js"> is present, which means no
   JavaScript and reduced motion both fall back to the finished layout. */

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition:
      opacity 0.45s var(--ease-soft),
      transform 0.45s var(--ease-soft);
  }

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

/* Honour the OS setting: collapse every transition and animation. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
