/* ==========================================================================
   Khusi Jewelers — Base styles
   Reset, font loading (design.md §3.1), type scale (§3.2/§3.3),
   focus/interaction-state globals (§2.4), reduced-motion baseline (§16).
   Depends on: tokens.css
   ========================================================================== */

/* ---- Font loading — Google Fonts per §3.1, font-display: swap per §19 ---- */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300..600&family=Cormorant+Garamond:wght@500;600&family=Inter:wght@400;500;600&family=Jost:wght@400;500&display=swap");

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip; /* full-bleed 100vw sections must never cause sideways scroll */
}

body {
  overflow-x: clip;
  font-family: var(--font-body);
  font-size: var(--type-body-size);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--surface-background);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img,
picture,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

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

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

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

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* ---- Focus ring — §2.4/§9: 2px gold, 2px offset, never suppressed ---- */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* ---- Type scale (§3.2) ---- */
.type-display {
  font-family: var(--font-display);
  font-size: var(--type-display-size);
  font-weight: 340; /* "Light-ish" via Fraunces variable axis */
  font-variation-settings: "opsz" 144;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.type-hero {
  font-family: var(--font-display);
  font-size: var(--type-hero-size);
  font-weight: 400;
  font-variation-settings: "opsz" 96;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h1, .type-h1 {
  font-family: var(--font-heading);
  font-size: var(--type-h1-size);
  font-weight: 600;
  line-height: 1.15;
}

h2, .type-h2 {
  font-family: var(--font-heading);
  font-size: var(--type-h2-size);
  font-weight: 600;
  line-height: 1.2;
}

h3, .type-h3 {
  font-family: var(--font-heading);
  font-size: var(--type-h3-size);
  font-weight: 600;
  line-height: 1.25;
}

h4, .type-h4 {
  font-family: var(--font-heading);
  font-size: var(--type-h4-size);
  font-weight: 600;
  line-height: 1.3;
}

h5, .type-h5 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

h6, .type-h6 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.type-body-lg {
  font-family: var(--font-body);
  font-size: var(--type-body-lg-size);
  font-weight: 400;
  line-height: 1.6;
}

.type-caption {
  font-family: var(--font-body);
  font-size: var(--type-caption-size);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.type-label {
  font-family: var(--font-label);
  font-size: var(--type-label-size);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.type-nav {
  font-family: var(--font-label);
  font-size: var(--type-nav-size);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.type-product-name {
  font-family: var(--font-heading);
  font-size: var(--type-product-name-size);
  font-weight: 600;
  line-height: 1.3;
}

.type-price {
  font-family: var(--font-body);
  font-size: var(--type-price-size);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.type-price-strike {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  text-decoration: line-through;
  color: var(--text-tertiary);
}

/* Mobile fixed-size adjustments (§3.2 — non-fluid styles) */
@media (max-width: 639px) {
  body { font-size: 15px; }
  .type-caption { font-size: 12px; }
  .type-label { font-size: 11px; }
  .type-product-name { font-size: 17px; }
  .type-price { font-size: 17px; }
  .type-price-strike { font-size: 13px; }
  h5, .type-h5 { font-size: 16px; }
  h6, .type-h6 { font-size: 14px; }
}

/* ---- Text-link hover: gold underline reveal, left-to-right 200ms (§2.4) ---- */
.link-underline {
  position: relative;
}

.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--accent-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--easing-standard);
}

.link-underline:hover::after {
  transform: scaleX(1);
}

/* ---- Utility ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Reduced motion baseline (design.md §16 accessibility note) ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
