/* STOA · editorial / luxury / futuristic */

:root {
  --ink: #0a0b0d;
  --bone: #f4efe6;
  --bone-2: #e8e1d4;
  --mist: rgba(244, 239, 230, 0.72);
  --line: rgba(244, 239, 230, 0.22);
  --line-strong: rgba(244, 239, 230, 0.4);
  --accent: #d98b4a; /* copper */
  --serif: 'Instrument Serif', 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: #05070a;
  color: var(--bone);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
}

#ocean {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
}

#weather {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
  pointer-events: none;
  mix-blend-mode: screen;
}

#rain {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s;
  mix-blend-mode: screen;
}

.no-webgl #ocean {
  background: linear-gradient(180deg, #1a2a3e 0%, #7a5a4a 50%, #2a1a20 100%);
}

.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.45) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 65%, rgba(0,0,0,0.55) 100%);
}

.page {
  position: relative;
  z-index: 2;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 40px;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }

.logo {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: 0.22em;
  font-weight: 400;
}

.nav-links {
  display: flex; gap: 40px;
  justify-self: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.nav-links a {
  color: var(--bone);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity .25s;
  position: relative;
  padding-bottom: 4px;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  height: 1px; width: 0;
  background: var(--accent);
  transition: width .35s ease;
}
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  justify-self: end;
  display: flex; align-items: center; gap: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #7ed957;
  box-shadow: 0 0 10px #7ed957;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  50% { opacity: 0.4; }
}

.btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 12px 22px;
  border: 1px solid var(--line-strong);
  background: rgba(10,11,13,0.25);
  color: var(--bone);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all .3s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn:hover { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.btn.primary { border-color: var(--accent); color: var(--bone); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 140px 40px 110px;
  position: relative;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
}
.hero-meta .left span { display: block; margin-bottom: 4px; }
.hero-meta .right { text-align: right; }

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(68px, 11vw, 180px);
  line-height: 0.92;
  letter-spacing: -0.025em;
  text-wrap: balance;
  margin-top: auto;
  margin-bottom: 48px;
}
.hero-title em {
  font-style: italic;
  color: var(--bone);
  opacity: 0.94;
}
.hero-title .accent {
  color: var(--accent);
  font-style: italic;
}

.hero-lead {
  font-family: var(--sans);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.4;
  max-width: 60ch;
  opacity: 0.92;
  margin-bottom: 44px;
  text-wrap: pretty;
}

.hero-bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.hero-bottom p {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  max-width: 34ch;
  opacity: 0.88;
  text-wrap: pretty;
}
.hero-ctas { display: flex; gap: 12px; justify-content: flex-end; }

.hero-number {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}
.hero-number strong {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 56px;
  letter-spacing: -0.01em;
  color: var(--bone);
  opacity: 1;
  margin-top: 6px;
  line-height: 1;
}

/* ---------- Logos ---------- */
.logos {
  position: relative;
  z-index: 2;
  padding: 80px 40px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(5,7,10,0) 0%, rgba(5,7,10,0.45) 100%);
  backdrop-filter: blur(2px);
}
.logos-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 32px;
  text-align: center;
}
.logos-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
}
.logo-item {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  letter-spacing: 0.02em;
  opacity: 0.55;
  transition: opacity .3s;
  white-space: nowrap;
}
.logo-item.sans {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 24px;
}
.logo-item.mono {
  font-family: var(--mono);
  font-style: normal;
  font-size: 20px;
  letter-spacing: -0.03em;
}
.logo-item.caps {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-size: 14px;
}
.logo-item:hover { opacity: 1; color: var(--accent); }

/* ---------- Case studies ---------- */
.cases {
  position: relative;
  z-index: 2;
  padding: 140px 40px 120px;
  background: linear-gradient(180deg, rgba(5,7,10,0.45) 0%, rgba(5,7,10,0.92) 30%, rgba(5,7,10,0.98) 100%);
}
.cases-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: end;
  max-width: 1400px;
  margin: 0 auto 80px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ''; width: 24px; height: 1px; background: var(--accent);
}
.cases-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 5.5vw, 84px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.cases-head h2 em { font-style: italic; color: var(--accent); }
.cases-head p {
  font-size: 16px; line-height: 1.55;
  max-width: 44ch;
  opacity: 0.82;
  text-wrap: pretty;
}

.case-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.case {
  border: 1px solid var(--line);
  background: rgba(10,11,13,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all .4s;
  position: relative;
  overflow: hidden;
  min-height: 120px;
}
.case:hover {
  border-color: var(--line-strong);
  background: rgba(10,11,13,0.75);
  transform: translateY(-2px);
}
.case.big { grid-column: span 8; min-height: 160px; }
.case.sm  { grid-column: span 4; }
.case.med { grid-column: span 6; }

.case-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.7;
}
.case-client {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.75;
}
.case-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 2.4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-top: auto;
  text-wrap: balance;
}
.case-title em { font-style: italic; color: var(--accent); }
.case-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}
.case-stat {
  font-family: var(--serif);
  font-style: italic;
  font-size: 72px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 12px 0;
}
.case-stat .unit {
  font-size: 28px;
  vertical-align: top;
  margin-left: 4px;
  opacity: 0.7;
}
.case-body {
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.8;
  text-wrap: pretty;
}
.case-arrow {
  position: absolute; top: 32px; right: 32px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: all .3s;
  font-size: 12px;
}
.case:hover .case-arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
  transform: rotate(-45deg);
}

/* ---------- Footer ---------- */
footer {
  position: relative;
  z-index: 2;
  background: #05070a;
  padding: 120px 40px 40px;
  border-top: 1px solid var(--line);
}
.footer-top {
  max-width: 1400px;
  margin: 0 auto 80px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-lead {
  font-family: var(--serif);
  font-size: clamp(40px, 4.2vw, 64px);
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.footer-lead em { font-style: italic; color: var(--accent); }
.footer-col h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.5;
  font-weight: 500;
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  color: var(--bone); text-decoration: none;
  font-size: 14px;
  opacity: 0.85;
  transition: color .2s, opacity .2s;
}
.footer-col a:hover { color: var(--accent); opacity: 1; }

/* Contact email glow pulse — triggered only when arriving via a #contact CTA.
   Uses the existing --accent token (same orange as the footer "building"/"read" em). */
#contact-email.is-highlighting {
  animation: email-glow 2s ease-in-out 1;
}

@keyframes email-glow {
  0%,
  100% {
    color: var(--bone);
    text-shadow: 0 0 0 transparent;
  }
  16%,
  50%,
  83% {
    color: var(--accent);
    text-shadow: 0 0 16px var(--accent), 0 0 6px var(--accent);
    opacity: 1;
  }
  33%,
  66% {
    color: var(--bone);
    text-shadow: 0 0 0 transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* No animation for reduced-motion users — apply a brief static highlight instead.
     JS removes .is-highlighting via a fallback timeout (~2.2s). */
  #contact-email.is-highlighting {
    animation: none;
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent);
    opacity: 1;
  }
}

.footer-bot {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.55;
}

.footer-mark {
  font-family: var(--serif);
  font-size: 160px;
  line-height: 0.8;
  letter-spacing: -0.04em;
  text-align: center;
  margin: 40px 0 0;
  background: linear-gradient(180deg, rgba(244,239,230,0.5) 0%, rgba(244,239,230,0) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 400;
  font-size: clamp(180px, 22vw, 380px);
}

/* ---------- Mood switcher (bottom) ---------- */
.mood-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  gap: 6px;
  background: rgba(10,11,13,0.72);
  border: 1px solid rgba(244,239,230,0.18);
  border-radius: 999px;
  padding: 6px;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(244,239,230,0.14), 0 8px 32px rgba(0,0,0,0.45);
}
.mood-bar button {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: var(--bone);
  opacity: 0.6;
  cursor: pointer;
  transition: all .25s;
}
.mood-bar button:hover { opacity: 0.9; }
.mood-bar button.active {
  background: var(--bone);
  color: var(--ink);
  opacity: 1;
}

/* ---------- Tweaks panel ---------- */
.tweaks {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: 280px;
  background: rgba(10,11,13,0.85);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 20px;
  display: none;
  font-family: var(--mono);
  color: var(--bone);
}
.tweaks.on { display: block; }
.tweaks h5 {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 14px;
  font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
}
.tweaks .row { margin-bottom: 14px; }
.tweaks label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 6px;
}
.tweaks input[type=range] { width: 100%; accent-color: var(--accent); }
.tweaks input[type=color] {
  width: 100%; height: 30px; background: transparent;
  border: 1px solid var(--line); cursor: pointer; padding: 0;
}
.tweaks .fonts { display: flex; gap: 4px; }
.tweaks .fonts button {
  flex: 1;
  padding: 8px 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.7;
  transition: all .2s;
}
.tweaks .fonts button:hover { opacity: 1; }
.tweaks .fonts button.active {
  background: var(--bone); color: var(--ink); border-color: var(--bone);
}
.tweaks .val {
  float: right;
  opacity: 0.8;
  font-size: 10px;
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero { padding: 120px 20px 80px; }
  .hero-bottom { grid-template-columns: 1fr; gap: 32px; }
  .hero-ctas { justify-content: flex-start; }
  .cases-head { grid-template-columns: 1fr; }
  .case.big, .case.sm, .case.med { grid-column: span 12; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .tweaks { right: 12px; bottom: 80px; width: calc(100% - 24px); max-width: 300px; }
}

/* ---------- Demo (reserved) & Studio sections ---------- */
.demo {
  background: rgba(5,7,10,0.45);
  border-top: 1px solid var(--line);
}
.studio {
  background: rgba(5,7,10,0.98);
  border-top: 1px solid var(--line);
}
.demo-frame {
  max-width: 1400px;
  margin: 0 auto;
  min-height: 200px;
  align-items: center;
  justify-content: center;
}
.demo-note {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  opacity: 0.35;
}
.studio-copy { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Footer: info text & coming-soon items ---------- */
.footer-col .footer-txt {
  font-size: 14px;
  opacity: 0.85;
}
.footer-col .footer-soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  opacity: 0.45;
  cursor: default;
}
.footer-col .soon-tag {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.8;
  border: 1px solid var(--line);
  padding: 2px 5px;
  border-radius: 2px;
}

/* font applications via tweaks */
body.f-editorial { --serif: 'Instrument Serif', serif; --sans: 'DM Sans', sans-serif; }
body.f-modern    { --serif: 'DM Serif Display', serif; --sans: 'Space Grotesk', sans-serif; --mono: 'JetBrains Mono', monospace; }
body.f-classic   { --serif: 'EB Garamond', serif; --sans: 'Work Sans', sans-serif; }
body.f-brutal    { --serif: 'Bodoni Moda', serif; --sans: 'Archivo', sans-serif; }
