/* ==========================================================================
   KinRidge — Main
   Design tokens, reset, typography, base layout, utilities
   ========================================================================== */

:root {
  /* Color — warm minimal outdoor */
  --c-ink:       #1C1B18;
  --c-ink-soft:  #2E2D29;
  --c-stone:     #6F6B62;
  --c-mute:      #9B968A;
  --c-line:      #E1DBCE;
  --c-line-soft: #ECE6D9;
  --c-paper:     #F7F5EF;
  --c-paper-2:   #EFEBE2;
  --c-sand:      #DBD0BC;
  --c-accent:    #A8582C;   /* clay */
  --c-moss:      #4A5243;

  /* Typography */
  --font-display: "Fraunces", "Cormorant Garamond", "Georgia",
                  "Songti SC", "STSong", "PingFang SC", serif;
  --font-body:    "Inter", "PingFang SC", "Hiragino Sans GB",
                  "Microsoft YaHei", "Noto Sans SC", -apple-system,
                  BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  /* Layout */
  --container:   1320px;
  --container-w: 88vw;
  --gutter:      clamp(20px, 4vw, 56px);

  /* Type scale (fluid) */
  --fs-eyebrow:  clamp(11px, 0.85vw, 13px);
  --fs-body:     clamp(15px, 1.05vw, 17px);
  --fs-lead:     clamp(17px, 1.4vw, 21px);
  --fs-h6:       clamp(13px, 0.95vw, 15px);
  --fs-h5:       clamp(15px, 1.1vw, 18px);
  --fs-h4:       clamp(18px, 1.4vw, 22px);
  --fs-h3:       clamp(22px, 1.9vw, 30px);
  --fs-h2:       clamp(30px, 3.2vw, 52px);
  --fs-h1:       clamp(40px, 5.5vw, 88px);
  --fs-display:  clamp(56px, 9vw, 144px);

  /* Motion
     Curves: three jobs — travel (--ease), settle (--ease-soft), snap back (--spring)
     Durations: fb < micro < state < med < comp < scene < hero
     Anything not on this list is a magic number; don't add one. */
  --ease:      cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 0, 0.15, 1);
  --spring:    cubic-bezier(0.34, 1.4, 0.64, 1);

  --t-fb:    110ms;   /* colour / opacity hand-off on hover-in */
  --t-fast:  160ms;   /* press, icon nudge */
  --t-state: 240ms;   /* swatch, indicator slide */
  --t-med:   320ms;   /* panel open, sticky bar rise */
  --t-comp:  420ms;   /* card lift, magnetic return */
  --t-slow:  600ms;   /* legacy alias — image zoom now uses --t-comp */
  --t-scene: 760ms;   /* section-level entrance */
  --t-hero:  900ms;   /* first-paint push-in */

  --stagger: 60ms;    /* per-item offset, capped at 5 steps */
  --lift:    8px;     /* hover rise */
  --shift:   14px;    /* neighbour give-way */
  --rise:    16px;    /* entrance travel */

  /* Elevation */
  --header-h: 76px;
}

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

html,
body { margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--c-ink);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

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

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

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}
a:hover { opacity: 0.7; }
a:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--c-ink);
}

p { margin: 0; }

/* Selection */
::selection { background: var(--c-ink); color: var(--c-paper); }

/* Typography utilities
   ---------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-stone);
  margin: 0;
}

.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }
.h4 { font-size: var(--fs-h4); }
.h5 { font-size: var(--fs-h5); }
.h6 { font-size: var(--fs-h6); }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--c-ink-soft);
  font-weight: 400;
  max-width: 56ch;
}

.muted { color: var(--c-stone); }
.fineprint {
  font-size: var(--fs-eyebrow);
  color: var(--c-mute);
  letter-spacing: 0.04em;
}

.rule {
  display: inline-block;
  width: 48px;
  height: 1px;
  background: var(--c-accent);
  vertical-align: middle;
  margin-right: var(--sp-3);
}

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

.section { padding-block: clamp(var(--sp-8), 10vw, var(--sp-10)); }
.section--tight { padding-block: clamp(var(--sp-7), 7vw, var(--sp-8)); }
.section--paper-2 { background: var(--c-paper-2); }
.section--ink { background: var(--c-ink); color: var(--c-paper); }
.section--ink h1, .section--ink h2, .section--ink h3,
.section--ink .eyebrow { color: inherit; }
.section--ink .eyebrow { color: rgba(247, 245, 239, 0.65); }

.section__head {
  display: grid;
  gap: var(--sp-3);
  margin-bottom: var(--sp-7);
  max-width: 760px;
}
.section__head .h2 { letter-spacing: -0.02em; }

/* Grid helpers */
.grid {
  display: grid;
  gap: var(--sp-5);
}
.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)); }

@media (max-width: 960px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--sp-6), 6vw, var(--sp-9));
  align-items: center;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.spacer-lg { height: clamp(var(--sp-7), 8vw, var(--sp-9)); }

/* Image helpers */
.media {
  position: relative;
  overflow: hidden;
  background: var(--c-paper-2);
}
.media__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-comp) var(--ease);
}
.media:hover .media__img { transform: scale(1.03); }

.media--aspect-1   { aspect-ratio: 1 / 1; }
.media--aspect-45  { aspect-ratio: 4 / 5; }
.media--aspect-169 { aspect-ratio: 16 / 9; }
.media--aspect-43  { aspect-ratio: 4 / 3; }

/* Reveal animation (subtle)
   .reveal is the legacy hook kept for markup that predates motion.css.
   New work should use [data-motion] variants instead. */
.reveal {
  opacity: 0;
  transform: translateY(var(--rise));
  transition: opacity var(--t-scene) var(--ease-soft),
              transform var(--t-scene) var(--ease-soft);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .media:hover .media__img { transform: none; }
  html { scroll-behavior: auto; }
}