/* ==========================================================================
   Deploy Tech — styles.css
   Tokens and layout per DESIGN.md v2 (approved).
   ========================================================================== */

/* ---- Font: Archivo variable (self-hosted, latin subset) ---- */
@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens (DESIGN.md §2–4) ---- */
:root {
  /* palette */
  --ink: #0d1b2a;
  --paper: #f2f4f4;
  --slate: #3c4b58;
  --petrol: #10565c;
  --petrol-ice: #62b6bc;
  --hairline: #d7dddc;

  /* type */
  --font: "Archivo", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --t-hero: clamp(2rem, 0.5rem + 5.6vw, 5.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-h2: clamp(1.9rem, 1rem + 3.6vw, 3.6rem);
  --t-lede: clamp(1.3rem, 1rem + 1.6vw, 2.1rem);
  --t-h3: clamp(1.25rem, 1rem + 1vw, 1.7rem);
  --t-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --t-label: 0.8125rem;

  /* spacing */
  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2.5rem;
  --s5: 4rem;
  --s6: 6.5rem;
  --s7: 10.5rem;
  --pad-section: clamp(5rem, 12vh, 8.5rem);
  --margin: clamp(2rem, 5vw, 6rem);

  /* ledger line x-position: boundary between grid columns 4 and 5,
     centered in the gutter (12 cols, 11 gutters of --s3) */
  --spine-x: calc((100% - 11 * var(--s3)) / 12 * 4 + 3.5 * var(--s3));
}

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

* {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100svh;
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper) var(--tex-paper) repeat;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* Materials (owner-approved textures, v2.7) — both generated, no images.
   Paper: two scales of dark-alpha noise (fine tooth + soft fiber mottle)
   painted on the body surface, so the porcelain reads as stock and the
   texture scrolls with the page like real paper.
   Velvet: light-alpha noise on the ink sections — a vertically brushed
   anisotropic nap plus large soft pooling, like light falling on cloth. */
:root {
  --tex-paper: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='720'%20height='720'%3E%3Cfilter%20id='m'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.0125'%20numOctaves='3'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.012%200.012%200.012%200%200'/%3E%3C/filter%3E%3Cfilter%20id='g'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.9'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.02%200.02%200.02%200%200'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23m)'/%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23g)'/%3E%3C/svg%3E");
  --tex-velvet: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1800'%20height='1800'%3E%3Cfilter%20id='v'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.017778%200.004444'%20numOctaves='4'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20values='0%200%200%200%201%200%200%200%200%201%200%200%200%200%201%200.018%200.018%200.018%200%200'/%3E%3C/filter%3E%3Cfilter%20id='p'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.003333'%20numOctaves='3'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20values='0%200%200%200%201%200%200%200%200%201%200%200%200%200%201%200.012%200.012%200.012%200%200'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23v)'/%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23p)'/%3E%3C/svg%3E");
}

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

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

/* Netlify honeypot — functional, not aesthetic */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Focus (WCAG: visible on all interactive elements) ---- */
:focus-visible {
  outline: 2px solid var(--petrol);
  outline-offset: 3px;
}

.ink :focus-visible {
  outline-color: var(--petrol-ice);
}

/* ---- Ink sections ---- */
.ink {
  background: var(--ink) var(--tex-velvet) repeat;
  color: var(--paper);
  --spine-color: rgb(242 244 244 / 0.15);
}

/* ---- Grid container + the ledger line (DESIGN.md §5–6) ---- */
.grid {
  position: relative;
  width: min(1240px, calc(100% - 2 * var(--margin)));
  margin-inline: auto;
  padding-block: var(--pad-section);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--s3);
  row-gap: 0;
  align-content: start;
}

/* spine segment: spans the section's full padded height; segments stack
   into one continuous line down the document */
.grid::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--spine-x);
  width: 1px;
  background: var(--spine-color, var(--hairline));
}

/* register mark at each section boundary (not at page top) */
main > section:not(.hero) .grid::after,
.site-footer .grid::after {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--spine-x) - 12px);
  width: 25px;
  height: 1px;
  background: var(--spine-color, var(--hairline));
}

/* ---- Display type (Archivo expanded: wdth 120 / wght 630) ---- */
.display,
.hero-headline,
.item h3,
.sectors-line {
  font-stretch: 120%;
  font-weight: 630;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

/* ---- Section labels ---- */
.label {
  grid-column: 1 / 5;
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--petrol);
}

.ink .label {
  color: var(--petrol-ice);
}

/* ---- Wordmark ---- */
.wordmark {
  position: absolute;
  top: var(--s4);
  left: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

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

.dot {
  color: var(--petrol-ice);
}

/* ==========================================================================
   Sections
   ========================================================================== */

/* ---- §1 Hero ---- */
.hero .grid {
  min-height: 100svh;
  align-content: center;
}

.hero-display {
  grid-column: 5 / 13;
  position: relative;
}

.hero-headline {
  font-size: var(--t-hero);
}

.hero-subline {
  grid-column: 6 / 11;
  margin-top: var(--s5);
  color: rgb(242 244 244 / 0.78);
  max-width: 44ch;
}

/* hero write-in-place (DESIGN.md §8 v2.3): the final layout is frozen from
   the first frame; script.js wraps the completion letters in spans that
   already occupy their exact space and fade in left-to-right. Without JS
   or with reduced motion no spans/classes exist and the finished headline
   simply shows. */
.hh-rest span {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.hero.write .hh-rest span {
  opacity: 1;
}

/* idle state A (owner-selected, revised): once the headline has written
   itself, the brand stem "Deploy tech" breathes between paper and
   petrol-ice — the name surfacing inside the sentence */
.hero.write .hh-head {
  animation: brand-breathe 5s ease-in-out 3s infinite;
}

@keyframes brand-breathe {
  0%,
  100% {
    color: var(--paper);
  }
  50% {
    color: var(--petrol-ice);
  }
}

/* idle state C (owner-selected): a pooling-light layer drifts one slow
   pass across the hero velvet — never visibly moving, never frozen */
.hero {
  overflow: hidden;
}

.js .hero::before {
  content: "";
  position: absolute;
  inset: -90px;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='1800'%20height='1800'%3E%3Cfilter%20id='p'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.003333'%20numOctaves='3'%20stitchTiles='stitch'/%3E%3CfeColorMatrix%20values='0%200%200%200%201%200%200%200%200%201%200%200%200%200%201%200.012%200.012%200.012%200%200'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23p)'/%3E%3C/svg%3E") repeat;
  animation: velvet-drift 75s ease-in-out infinite;
  pointer-events: none;
}

@keyframes velvet-drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(60px, 40px, 0);
  }
}

.js .hero.pending .hero-subline {
  opacity: 0;
  transform: translateY(12px);
}

.js .hero.write .hero-subline {
  opacity: 1;
  transform: none;
  transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
  transition-delay: 1.5s;
}

/* ---- §2 Positioning ---- */
.lede {
  grid-column: 5 / 12;
  font-size: var(--t-lede);
  font-stretch: 110%;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

/* ---- §3 What we do (stepped cascade) ---- */
.item {
  position: relative;
  padding-bottom: var(--s4);
}

/* underline as pseudo-element so it can draw in with the section reveal */
.item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--hairline);
}

.item h3 {
  font-size: var(--t-h3);
  margin-bottom: var(--s2);
}

.item p {
  color: var(--slate);
  max-width: 55ch;
}

.item-1 {
  grid-column: 5 / 11;
}

.item-2 {
  grid-column: 6 / 12;
  margin-top: var(--s5);
}

.item-3 {
  grid-column: 7 / 13;
  margin-top: var(--s5);
}

/* ---- §4 Sectors (short band, full-bleed hairlines as drawable rules) ---- */
.sectors {
  position: relative;
}

.sectors::before,
.sectors::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--hairline);
}

.sectors::before {
  top: 0;
}

.sectors::after {
  bottom: 0;
}

.sectors .grid {
  padding-block: clamp(3.5rem, 8vh, 5.5rem);
}

.sectors .grid::after {
  display: none; /* band already opens with a full-bleed hairline */
}

.sectors-line {
  grid-column: 5 / 13;
  font-size: var(--t-lede);
  margin-top: var(--s4);
}

.ip {
  color: var(--petrol);
}

.nw {
  white-space: nowrap;
}

.sectors-note {
  grid-column: 6 / 12;
  margin-top: var(--s4);
  color: var(--slate);
  max-width: 48ch;
}

/* ---- §5 Approach ---- */
.approach .display {
  grid-column: 5 / 11;
  font-size: var(--t-h2);
  margin-top: var(--s4);
}

/* two sentences, two deliberate lines (text unchanged) */
.approach .display span {
  display: block;
}

.approach-body {
  grid-column: 6 / 12;
  margin-top: var(--s4);
  color: var(--slate);
  max-width: 58ch;
}

.approach-body p + p {
  margin-top: var(--s3);
}

/* ---- §6 Principal ---- */
/* Portrait prints into the paper: grayscale + multiply dissolves the
   photo's light backdrop into the page, so no box edge shows; the bust
   sits on a hairline baseline rule instead of a frame. */
.portrait {
  grid-column: 1 / 4;
  grid-row: 2 / 5;
  margin-top: var(--s4);
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(1) brightness(1.08) contrast(1.05);
  mix-blend-mode: multiply;
  border-bottom: 1px solid var(--hairline);
}

.principal .name {
  grid-column: 5 / 11;
  font-size: var(--t-h2);
  margin-top: var(--s4);
}

.role {
  grid-column: 5 / 11;
  margin-top: var(--s2);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--petrol);
}

.role-row {
  grid-column: 5 / 11;
  margin-top: var(--s2);
  display: flex;
  align-items: baseline;
  gap: var(--s3);
}

.role-row .role {
  grid-column: auto;
  margin-top: 0;
}

.li-link {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-left: 1px solid var(--hairline);
  padding-left: var(--s3);
}

.li-link a {
  color: var(--petrol);
  text-decoration: none;
}

.li-link a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.bio {
  grid-column: 6 / 12;
  margin-top: var(--s4);
  color: var(--slate);
  max-width: 65ch;
}

/* ---- §7 Contact ---- */
.contact .display {
  grid-column: 5 / 12;
  font-size: var(--t-h2);
  margin-top: var(--s4);
}

.contact form {
  grid-column: 5 / 9;
  grid-row: 3;
  margin-top: var(--s4);
}

.field + .field {
  margin-top: var(--s4);
}

.field label {
  display: block;
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(242 244 244 / 0.72);
  margin-bottom: var(--s1);
}

.field input,
.field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgb(242 244 244 / 0.3);
  padding: var(--s1) 0 var(--s2);
  color: var(--paper);
  caret-color: var(--petrol-ice);
  border-radius: 0;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-bottom-color: var(--petrol-ice);
}

.contact button {
  margin-top: var(--s4);
  background: var(--petrol-ice);
  color: var(--ink);
  border: none;
  padding: 0.875rem 2.75rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
}

.contact button:hover {
  background: var(--paper);
}

.form-success {
  margin-top: var(--s4);
}

/* success message settles in like everything else */
.js .form-success {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.js .form-success.in {
  opacity: 1;
  transform: none;
}

.form-note {
  margin-top: var(--s3);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgb(242 244 244 / 0.6);
  max-width: 44ch;
}

.form-note a {
  color: var(--petrol-ice);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* inline success state: fields give way to the confirmation */
form.sent .field,
form.sent button,
form.sent .hp,
form.sent .form-note {
  display: none;
}

/* the direct address sits right under the headline (visual row 2); DOM
   order keeps the form first so the no-JS fallback wording stays true */
.email-block {
  grid-column: 5 / 12;
  grid-row: 2;
  margin-top: var(--s3);
}

.email a {
  color: var(--petrol-ice);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.email-fallback {
  color: rgb(242 244 244 / 0.78);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid rgb(242 244 244 / 0.15);
}

.site-footer .grid {
  padding-block: var(--s4);
}

.site-footer .grid::after {
  display: none; /* footer already opens with a full-bleed hairline */
}

.footer-name,
.footer-legal {
  font-size: 0.875rem;
  color: rgb(242 244 244 / 0.7);
}

.footer-name {
  grid-column: 1 / 5;
}

.footer-legal {
  grid-column: 5 / 13;
  justify-self: end;
}

.footer-registration {
  grid-column: 5 / 13;
  margin-top: var(--s3);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgb(242 244 244 / 0.55);
}

/* ---- Privacy page ---- */
.privacy .grid {
  padding-block: clamp(6rem, 14vh, 9rem);
}

.privacy-title {
  grid-column: 5 / 12;
  font-size: var(--t-h2);
  margin-top: var(--s4);
}

.privacy-updated {
  grid-column: 5 / 12;
  margin-top: var(--s2);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--petrol);
}

.privacy-body {
  grid-column: 5 / 11;
  margin-top: var(--s4);
  color: var(--slate);
  max-width: 65ch;
}

.privacy-body p + p {
  margin-top: var(--s3);
}

.privacy-body strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---- Thanks page ---- */
.thanks-page {
  background: var(--ink) var(--tex-velvet) repeat;
}

.thanks .grid {
  min-height: 100svh;
  align-content: center;
}

.thanks-message {
  grid-column: 2 / 10;
  font-size: var(--t-h2);
}

/* ==========================================================================
   Motion (DESIGN.md §8 v2.4) — each block settles as it arrives.
   script.js observes every .reveal individually (so nothing animates
   off-screen); blocks that enter together stagger per batch in reading
   order (--stagger). Sections get .in-view for the structural draws.
   Hidden states exist only under html.js, so no JS = everything visible.
   ========================================================================== */
.js .reveal {
  opacity: 0;
  /* --rise flips sign with scroll direction (script.js), so blocks always
     settle from the side they arrive on */
  transform: translateY(var(--rise, 30px));
  transition: opacity 0.7s var(--ease-out), transform 0.9s var(--ease-out),
    filter 0.7s var(--ease-out);
  transition-delay: calc(var(--stagger, 0) * 90ms);
}

/* soft-focus settle; the portrait is excluded — it owns its filter */
.js .reveal:not(.portrait) {
  filter: blur(4px);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

.js .reveal.in:not(.portrait) {
  filter: none;
}

/* the ledger drafts itself: each section's spine segment draws downward
   as the section arrives; its register mark inks in just after */
.js main > section .grid::before,
.js .site-footer .grid::before {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.3s var(--ease-out) 0.05s;
}

.js main > section.in-view .grid::before,
.js .site-footer.in-view .grid::before {
  transform: scaleY(1);
}

.js main > section:not(.hero) .grid::after,
.js .site-footer .grid::after {
  opacity: 0;
  transition: opacity 0.7s var(--ease-out) 0.35s;
}

.js main > section.in-view .grid::after,
.js .site-footer.in-view .grid::after {
  opacity: 1;
}

/* hairline draw-ins (owner-approved): item underlines and the Sectors
   band rules draw from the left as part of their reveal */
.js .item.reveal::after {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(var(--stagger, 0) * 90ms + 250ms);
}

.js .item.reveal.in::after {
  transform: scaleX(1);
}

.js .sectors::before,
.js .sectors::after {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s var(--ease-out) 0.1s;
}

.js .sectors.in-view::before,
.js .sectors.in-view::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .reveal:not(.portrait),
  .js .hero.pending .hero-subline,
  .js .form-success {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .js .reveal.portrait {
    filter: grayscale(1) brightness(1.08) contrast(1.05);
  }

  .hh-rest span {
    opacity: 1 !important;
    transition: none;
    animation: none;
  }

  .hero.write .hh-head {
    animation: none;
  }

  .js .hero::before {
    animation: none;
  }

  .js main > section .grid::before,
  .js .site-footer .grid::before,
  .js main > section:not(.hero) .grid::after,
  .js .site-footer .grid::after,
  .js .item.reveal::after,
  .js .sectors::before,
  .js .sectors::after {
    transform: none;
    opacity: 1;
    transition: none;
  }
}

/* ==========================================================================
   Mobile collapse (< 760px): single column, spine at the left margin
   ========================================================================== */
@media (max-width: 759.98px) {
  .grid {
    display: block;
    padding-block: clamp(3.5rem, 9vh, 5rem);
  }

  .grid > * + * {
    margin-top: var(--s4);
  }

  .grid::before {
    left: calc(1rem - var(--margin));
  }

  main > section:not(.hero) .grid::after,
  .site-footer .grid::after {
    left: calc(1rem - var(--margin) - 12px);
  }

  .hero .grid {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100svh;
  }

  .hero-display,
  .hero-subline {
    grid-column: 1 / -1;
  }

  .hero-subline {
    margin-top: var(--s4);
  }

  .item-2,
  .item-3 {
    margin-top: var(--s5);
  }

  /* Principal collapses to a byline row: small square headshot beside
     name/role (editorial convention), bio full-width below — the portrait
     must never dominate a phone screen. */
  .principal .grid {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: var(--s3);
  }

  .principal .label {
    grid-column: 1 / -1;
  }

  .portrait {
    grid-column: 1;
    grid-row: 2 / 4;
    width: 88px;
    height: 88px;
    align-self: start;
    margin-top: var(--s4);
  }

  .principal .name {
    grid-column: 2;
    margin-top: var(--s4);
  }

  .role-row {
    grid-column: 2;
    margin-top: var(--s1);
  }

  .bio {
    grid-column: 1 / -1;
    margin-top: var(--s4);
  }

  .email-block {
    margin-top: var(--s4);
  }

  .footer-legal {
    justify-self: start;
  }
}
