/* ============================================================
   HPA — High Projects Architecture
   Shared design tokens & primitives.
   ============================================================ */

:root {
  --bg:        #f3ece1;
  --bg-soft:   #ece3d3;
  --fg:        #1c1a15;
  --fg-mute:   #5b5446;
  --fg-soft:   #8a8170;
  --line:      #1c1a1530;
  --line-soft: #1c1a1518;
  --accent:    #8a6a3c;
  --paper:     #fbf7ee;

  --ff-display: "Cormorant Garamond", "Cormorant", "EB Garamond", Georgia, serif;
  --ff-body:    "Manrope", "Inter", system-ui, -apple-system, sans-serif;
  --ff-mono:    "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  --hero-font-weight: 400;
  --display-italic:   italic;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  --s-11: 160px; --s-12: 208px;

  --container: 1440px;
  --gutter: clamp(20px, 4vw, 64px);

  --ease: cubic-bezier(.2,.7,.2,1);
}

html[data-palette="stone"] {
  --bg:        #ecede9;
  --bg-soft:   #e2e4df;
  --fg:        #15171a;
  --fg-mute:   #535a5e;
  --fg-soft:   #828a8d;
  --line:      #15171a30;
  --line-soft: #15171a18;
  --accent:    #5d6b6a;
  --paper:     #f3f4f0;
}

html[data-palette="charcoal"] {
  --bg:        #15161a;
  --bg-soft:   #1d1f25;
  --fg:        #f1ede4;
  --fg-mute:   #b2ad9f;
  --fg-soft:   #76746a;
  --line:      #f1ede430;
  --line-soft: #f1ede415;
  --accent:    #d1b58a;
  --paper:     #1a1c20;
}

html[data-type="sans"] {
  --ff-display: "Tenor Sans", "Marcellus", "Inter Tight", system-ui, sans-serif;
  --hero-font-weight: 400;
  --display-italic: normal;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 350;
  letter-spacing: 0.005em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

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

/* ============================================================
   Type
   ============================================================ */
.eyebrow {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  font-weight: 400;
}

.display {
  font-family: var(--ff-display);
  font-weight: var(--hero-font-weight);
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--fg);
}

.h-xl { font-size: clamp(56px, 10vw, 168px); }
.h-lg { font-size: clamp(44px, 7vw, 112px); }
.h-md { font-size: clamp(32px, 4.5vw, 72px); }
.h-sm { font-size: clamp(24px, 3vw, 44px); }

.italic { font-style: var(--display-italic); }

.body-lg {
  font-size: clamp(17px, 1.4vw, 22px);
  line-height: 1.5;
  max-width: 60ch;
  color: var(--fg-mute);
  text-wrap: pretty;
}
.body { color: var(--fg-mute); text-wrap: pretty; }

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.section { padding: var(--s-10) 0; }
.section--tight { padding: var(--s-9) 0; }

.divider {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: var(--s-5) var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  transition: background-color .3s var(--ease);
}
.site-header__brand {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  font-family: var(--ff-display);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.site-header__brand .mark {
  font-size: 22px;
  letter-spacing: 0.15em;
}
.site-header__brand .sub {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.site-nav {
  display: flex;
  gap: var(--s-6);
  justify-content: center;
}
.site-nav a {
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg);
  position: relative;
  padding: 6px 0;
  transition: opacity .25s var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .35s var(--ease);
}
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--accent); }

.site-header__end {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  justify-content: flex-end;
}
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
}
.lang-toggle button {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--fg-mute);
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--fg);
  color: var(--bg);
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.btn-cta:hover { background: transparent; color: var(--fg); transform: translateY(-1px); }
.btn-cta .arr { transition: transform .3s var(--ease); }
.btn-cta:hover .arr { transform: translateX(4px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
  border-bottom: 1px solid var(--fg);
  transition: gap .3s var(--ease);
}
.btn-ghost:hover { gap: 16px; }

/* Mobile nav */
.mobile-nav-btn { display: none; }
@media (max-width: 880px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-nav { display: none; }
  .site-header__end .btn-cta { display: none; }
  .mobile-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ff-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }
}
.mobile-nav {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 60;
  padding: var(--s-9) var(--gutter) var(--s-6);
  transform: translateY(-100%);
  transition: transform .5s var(--ease);
  display: flex;
  flex-direction: column;
}
.mobile-nav.open { transform: translateY(0); }
.mobile-nav__close { align-self: flex-end; font-family: var(--ff-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.mobile-nav__list { display: flex; flex-direction: column; gap: 16px; margin-top: var(--s-7); list-style: none; padding: 0; }
.mobile-nav__list a {
  font-family: var(--ff-display); font-size: 44px; line-height: 1; letter-spacing: -0.02em;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--s-9) var(--gutter) var(--s-5);
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--s-7);
  max-width: var(--container);
  margin: 0 auto;
}
.site-footer h4 {
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin: 0 0 var(--s-4) 0;
}
.site-footer__giant {
  font-family: var(--ff-display);
  font-size: clamp(72px, 14vw, 220px);
  letter-spacing: -0.04em;
  color: var(--fg);
  line-height: 0.85;
  margin-top: var(--s-8);
  border-top: 1px solid var(--line-soft);
  padding-top: var(--s-5);
  text-transform: uppercase;
}
.site-footer__giant span { font-style: var(--display-italic); color: var(--accent); }
.site-footer__legal {
  max-width: var(--container);
  margin: var(--s-6) auto 0;
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--fg-soft);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; text-transform: uppercase; }
.site-footer a:hover { color: var(--fg); }
@media (max-width: 780px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Custom cursor (desktop only)
   ============================================================ */
@media (pointer: fine) {
  .cursor {
    position: fixed;
    top: 0; left: 0;
    width: 20px; height: 20px;
    border: 2px solid var(--fg);
    background: color-mix(in oklab, var(--accent) 30%, transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    transform: translate(-50%, -50%);
    transition: width .3s var(--ease), height .3s var(--ease), background-color .3s var(--ease), border-color .3s var(--ease);
  }
  .cursor.is-hot {
    width: 72px; height: 72px;
    background: var(--fg);
    border-color: var(--fg);
  }
  .cursor.is-hot .cursor__label { opacity: 1; }
  .cursor__label {
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--ff-mono);
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bg);
    opacity: 0;
    transition: opacity .25s var(--ease);
  }
  body.has-cursor { cursor: none; }
  body.has-cursor a, body.has-cursor button { cursor: none; }
}

/* ============================================================
   Reveal on scroll
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Image utilities
   ============================================================ */
.img {
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
}
.img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.img__label {
  position: absolute;
  bottom: var(--s-4); left: var(--s-4);
  font-family: var(--ff-mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg);
  background: var(--bg);
  padding: 4px 8px;
}
.img__index {
  position: absolute;
  top: var(--s-4); right: var(--s-4);
  font-family: var(--ff-mono); font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--bg);
  background: color-mix(in oklab, var(--fg) 70%, transparent);
  padding: 4px 8px;
}
.img--tall  { aspect-ratio: 3 / 4; }
.img--wide  { aspect-ratio: 16 / 9; }
.img--square{ aspect-ratio: 1 / 1; }

.img--zoom img { transition: transform 1.2s var(--ease); }
.img--zoom:hover img { transform: scale(1.04); }

/* ============================================================
   Animated marquee
   ============================================================ */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 26px 0;
}
.marquee__track {
  display: flex;
  gap: var(--s-8);
  width: max-content;
  animation: marquee 60s linear infinite;
  font-family: var(--ff-display);
  font-size: clamp(40px, 6vw, 88px);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
  white-space: nowrap;
}
.marquee__track > * { display: inline-flex; align-items: center; gap: var(--s-6); }
.marquee__track svg { width: 18px; height: 18px; color: var(--accent); }
@keyframes marquee {
  to { transform: translateX(-50%); }
}
