/* ============================================================
   Suerto OS — landing page
   Self-hosted fonts · responsive · 960px mobile breakpoint
   ============================================================ */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "PP Neue Montreal";
  src: url("../fonts/PPNeueMontreal-Book.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Neue Montreal";
  src: url("../fonts/PPNeueMontreal-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Supply Mono";
  src: url("../fonts/PPSupplyMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --color-bg: #000000;
  --color-fg: #ffffff;
  --color-body: #e5e5e5;
  --color-muted: #454545;
  --color-rule: #262626;
  --color-panel: #161616;

  --font-sans: "PP Neue Montreal", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "PP Supply Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --weight-book: 400;
  --weight-medium: 500;

  --max-width: 1512px;
  --gutter: clamp(1rem, 9.27vw - 1.25rem, 7.5rem);   /* 16px @390 → 120px @1512 */
  --section-space: clamp(5rem, 12vw, 11rem);

  --radius-pill: 1000px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-weight: var(--weight-book);
  font-size: 1rem;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }

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

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

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

:focus-visible {
  outline: 2px solid var(--color-fg);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.section { padding-block: var(--section-space); }

/* ---------- Typography helpers ---------- */
.section__title {
  font-weight: var(--weight-medium);
  font-size: clamp(2.25rem, 1.9rem + 1.4vw, 2.625rem);   /* 36px → 42px */
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.body {
  font-weight: var(--weight-book);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0.04em;                        /* ~0.8px @16 */
  max-width: 62ch;
}
.body--muted { color: var(--color-body); }

.mono-label {
  font-family: var(--font-mono);
  font-weight: var(--weight-book);
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.1em;                          /* ~1.2px @12 */
  text-transform: uppercase;
}
.mono-label--dim { color: var(--color-muted); }

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  background: var(--color-fg);
  color: var(--color-bg);
  font-size: 1rem;
  line-height: 1;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.btn:hover { opacity: 0.86; }
.btn:active { transform: translateY(1px); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; color: var(--color-fg); }
.logo--muted { color: var(--color-muted); }
.logo__mark {
  display: block;
  width: 128px;
  height: 24px;
  fill: currentColor;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding-block: 2.5rem;
  transition: padding-block 0.3s ease, background-color 0.3s ease;
}
.site-header.is-scrolled {
  padding-block: 1.25rem;
  background-color: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.nav {
  display: flex;
  gap: 2rem;
}
.nav__link {
  font-weight: var(--weight-medium);
  font-size: 1rem;
  transition: opacity 0.2s ease;
}
.nav__link:hover { opacity: 0.7; }
.nav__link.is-active {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
}
/* Fixed backdrop — holds still while the page scrolls over it, then fades out */
.hero__media {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #000 url("../assets/img/hero.jpg") center / cover no-repeat;
  will-change: opacity, transform;
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  /* left-side darkening + bottom fade to black, per design */
  background:
    linear-gradient(0deg, #000 0%, rgba(0,0,0,0) 18%),
    linear-gradient(90deg, #000 0%, rgba(0,0,0,0.85) 30%, rgba(0,0,0,0) 72%);
}
.hero__inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: clamp(9rem, 40vh, 26rem);
  padding-bottom: clamp(3rem, 6vh, 5rem);
}
.hero__title {
  font-weight: var(--weight-medium);
  font-size: clamp(3rem, 2.15vw + 2.45rem, 4.5rem);   /* 48px @390 → 72px @1512 */
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
  margin-top: clamp(4rem, 10vh, 8rem);
}
.hero__intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2.25rem;
}
.hero__stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  flex-shrink: 0;
}
.stat {
  font-weight: var(--weight-medium);
  font-size: clamp(2.25rem, 5.53vw + 0.9rem, 6.125rem);   /* 36px @390 → 98px @1512 */
  line-height: 1;
  letter-spacing: -0.02em;
}

/* ---------- Problem ---------- */
.problem__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(2.5rem, 5vw, 5.5rem);
  align-items: center;
}
.problem__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}
.problem__media {
  position: relative;
  margin: 0;
  /* Bleed to the right viewport edge (per Figma) */
  margin-right: calc(var(--gutter) * -1);
}
.problem__media img {
  width: 100%;
  aspect-ratio: 728 / 509;
  object-fit: cover;
}

/* ---------- Solution ---------- */
.solution__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: clamp(2.5rem, 5vw, 5.5rem);
  align-items: center;
}
.solution__media {
  position: relative;
  margin: 0;
  /* Bleed to the left viewport edge (per Figma) */
  margin-left: calc(var(--gutter) * -1);
}
.solution__media img {
  width: 100%;
  aspect-ratio: 1060 / 640;
  object-fit: cover;
}

/* Edge-to-black fade so images blend into the background (per Figma) */
.problem__media::after,
.solution__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 11%),
    linear-gradient(to top, rgba(0, 0, 0, 0) 89%, #000 100%),
    linear-gradient(to left, #000 0%, rgba(0, 0, 0, 0.85) 13%, rgba(0, 0, 0, 0) 45%),
    linear-gradient(to left, rgba(0, 0, 0, 0) 59%, rgba(0, 0, 0, 0.85) 88%, #000 100%);
}
.solution__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3rem;
}
.solution__head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.parts {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.part {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding-block: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.part:first-child { padding-top: 0; border-top: 0; }
.part:last-child { padding-bottom: 0; }
.part__title {
  font-weight: var(--weight-medium);
  font-size: clamp(1.5rem, 2.4vw, 2rem);          /* → 32px */
  line-height: 1.2;
}

/* ---------- Capacity ---------- */
.capacity__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}
.capacity__inner .body { max-width: 40ch; }
.capacity__inner .btn { margin-top: 0.75rem; }

/* ---------- Footer ---------- */
.site-footer { padding-bottom: clamp(3rem, 5vw, 4rem); }
.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.75rem;
}
.footer__rule {
  width: 100%;
  height: 1px;
  margin: 0 0 0.25rem;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
}
.footer__copy {
  color: var(--color-muted);
  letter-spacing: 0.04em;
}

/* ============================================================
   Sub-pages (Approach / Company / Inquiry)
   Centred ~800px reading column over a short image hero.
   ============================================================ */
.page-shell {
  width: 100%;
  max-width: 848px;                 /* 800px content + 2×24 padding */
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 1.5rem);
}

/* Short image hero with the page title */
.page-hero {
  --page-hero-h: clamp(360px, 44vw, 600px);
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--page-hero-h);
  padding-top: clamp(7rem, 12vw, 9rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.page-hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #000 center / cover no-repeat;
}
.page-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0) 18%),
    linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.85) 30%, rgba(0, 0, 0, 0) 72%);
}
.page-hero__title {
  font-weight: var(--weight-medium);
  font-size: clamp(3rem, 5.4vw, 4.5rem);   /* 48px → 72px */
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Reading column */
.page-body {
  display: flex;
  flex-direction: column;
  gap: clamp(5.5rem, 14vw, 8.75rem);        /* → 140px */
  padding-bottom: clamp(5rem, 12vw, 9rem);
}

.block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3rem;                                 /* title → content */
  width: 100%;
}
.block--tight { gap: 1.5rem; }               /* intro / capacity */
.block__lead {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.block__lead .body,
.body--lead { line-height: 1.6; letter-spacing: 0.06em; max-width: none; }

/* Info panel (e.g. "The record") */
.panel {
  width: 100%;
  border: 1px solid var(--color-panel);
}
.panel__head {
  padding: 1rem;
  background: var(--color-panel);
  font-weight: var(--weight-medium);
  font-size: 1rem;
  line-height: 1.2;
}
.panel__body {
  padding: 1rem;
  color: var(--color-body);
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.05em;
}
.panel__body p { margin: 0; }
.panel__body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}
.panel__body a:hover { opacity: 0.7; }

/* Numbered lists (Principles, How engagement works) */
.steps {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding-block: 2rem;
  border-top: 1px solid var(--color-rule);
}
.step:first-child { padding-top: 0; border-top: 0; }
.step:last-child { padding-bottom: 0; }
.step__title,
.item__title {
  font-weight: var(--weight-medium);
  font-size: 2rem;                           /* 32px */
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.step .body { max-width: none; }

/* Scope table */
.scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  gap: 1px;
  width: 100%;
  background: var(--color-panel);
  border: 1px solid var(--color-panel);
}
.scope__cell {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}
.scope__cell-head {
  padding: 1rem;
  background: var(--color-panel);
  font-weight: var(--weight-medium);
  font-size: 1rem;
  line-height: 1.2;
}
.scope__cell-body {
  flex: 1;
  padding: 1rem;
  color: var(--color-body);
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.block .btn { margin-top: 0.5rem; }

/* Tighter rhythm for short pages (e.g. Inquiry) */
.page-body--sm-gap { gap: 5rem; }

/* Large inline mail link (Inquiry) */
.mail-link {
  font-weight: var(--weight-medium);
  font-size: clamp(2.25rem, 1.9rem + 1.4vw, 2.625rem);   /* 36px → 42px */
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: underline;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
  transition: opacity 0.2s ease;
}
.mail-link:hover { opacity: 0.7; }

/* ============================================================
   Mobile — 960px breakpoint
   ============================================================ */
@media (max-width: 960px) {
  .hero__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 2.5rem;
  }
  .hero__stat { gap: 0.5rem; }

  .problem__grid,
  .solution__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* Full-bleed images edge-to-edge when stacked */
  .problem__media,
  .solution__media {
    margin-inline: calc(var(--gutter) * -1);
  }

  /* Solution: copy first, image below (per Home mobile) */
  .solution__content { order: -1; }

  .body { max-width: none; }

  /* Sub-pages: scope table stacks to a single column */
  .scope {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-auto-flow: row;
  }
  .block { gap: 2.5rem; }
}

@media (max-width: 600px) {
  /* Two-row header: logo, then nav (per mobile designs) */
  .site-header { padding-block: 1.25rem; }
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
  }
  .nav { gap: 1.25rem; }
  .logo__mark { width: 112px; height: 21px; }

  /* Full-width CTA buttons */
  .hero .btn,
  .solution__content .btn,
  .capacity .btn,
  .block .btn { width: 100%; }
}

/* ============================================================
   Initial load
   Pure CSS — every base state below is the *visible* one, so if
   animations never run the page simply appears, never stuck.
   ============================================================ */
@keyframes veil-out {
  from { opacity: 1; visibility: visible; }
  to   { opacity: 0; visibility: hidden; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Black veil lifts off the page on first paint */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-bg);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  animation: veil-out 0.9s ease 0.05s both;
}

.hero__title,
.page-hero__title {
  animation: rise-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}
.hero__bottom {
  animation: rise-in 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}
.site-header {
  animation: fade-in 0.8s ease 0.55s both;
}

/* Safety net (set by js/site.js once the intro should be over): hard-clears
   the entrance animation so a renderer that never advances animations can't
   leave the veil up or the hero text hidden. */
.motion-done body::after { display: none; }
.motion-done .hero__title,
.motion-done .page-hero__title,
.motion-done .hero__bottom,
.motion-done .site-header {
  animation: none;
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  body::after { display: none !important; }
  html { scroll-behavior: auto; }
}
