/* ============================================================
   Mike Storm — main stylesheet
   Refined editorial. Bone paper, near-black ink, one green accent.
   Type: Fraunces (display) · Hanken Grotesk (body) · IBM Plex Mono (accents)
   ============================================================ */

:root {
  /* surfaces */
  --bg: #f5f3ee;
  --bg-alt: #ece8df;
  --dark-bg: #15130f;

  /* ink */
  --ink: #1a1815;
  --body: #3a3833;
  --muted: #635f58;
  --line: rgba(26, 24, 21, 0.14);

  /* on dark */
  --paper: #f5f3ee;
  --muted-on-dark: rgba(245, 243, 238, 0.56);
  --line-on-dark: rgba(245, 243, 238, 0.16);

  /* accent */
  --green: #2f6b4f;
  --green-soft: rgba(47, 107, 79, 0.12);

  /* type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* layout */
  --container: 1240px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-y: clamp(4.5rem, 11vw, 9.5rem);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--body);
  font-size: clamp(1.02rem, 0.96rem + 0.3vw, 1.18rem);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* whisper-light paper grain for depth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

::selection { background: var(--ink); color: var(--bg); }

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- shared layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
section { position: relative; z-index: 1; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.4rem;
  display: block;
}

/* display headings */
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); font-weight: 600; }
h2.section-title {
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.35rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 80;
  max-width: 14ch;
}
.lede {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
  margin-top: 1.5rem;
  max-width: 34ch;
}

/* two-column editorial layout (sticky heading + scrolling body) */
.split { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(2rem, 6vw, 6rem); }
.split__aside { position: sticky; top: clamp(5rem, 8vw, 7.5rem); align-self: start; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: clamp(64px, 7vw, 76px);
}
.brand {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand img { max-height: 38px; width: auto; }

.nav { display: flex; gap: clamp(1.5rem, 3vw, 2.75rem); align-items: center; }
.nav a {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  position: relative;
  padding: 0.35rem 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--ink);
  transition: width 0.28s ease;
}
.nav a:hover::after, .nav a:focus-visible::after { width: 100%; }

/* hamburger */
.nav-toggle {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  width: 44px; height: 44px;
  cursor: pointer;
  color: var(--ink);
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 110;
}
.nav-toggle svg { width: 26px; height: 26px; }
.nav-toggle .icon-close { display: none; }
body.menu-open .nav-toggle .icon-open { display: none; }
body.menu-open .nav-toggle .icon-close { display: block; }

@media (max-width: 820px) {
  /* backdrop-filter on an ancestor traps position:fixed children;
     remove it on mobile so the menu overlay covers the full viewport */
  .site-header {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed;
    inset: 0;
    z-index: 105;
    /* SOLID background — fixes the old transparent-menu bug */
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.5rem;
    padding: var(--gutter);
    padding-top: 25vh;
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform 0.42s cubic-bezier(0.6, 0, 0.2, 1), visibility 0s linear 0.42s;
  }
  body.menu-open .nav {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .nav a {
    font-family: var(--font-display);
    font-size: clamp(2rem, 9vw, 2.75rem);
    font-weight: 500;
    color: var(--ink);
    padding: 0.4rem 0;
  }
  .nav a::after { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(3rem, 7vw, 6rem); padding-bottom: var(--section-y); }
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(3rem, 1.6rem + 7vw, 6.5rem);
  line-height: 0.96;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
  margin-bottom: 1.8rem;
}
.hero p.intro {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--body);
  max-width: 40ch;
}
.hero p.standfirst {
  margin-top: 1.5rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 44ch;
}
.hero__media {
  position: relative;
  aspect-ratio: 4 / 4.6;
  overflow: hidden;
}
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.03);
}

/* primary / ghost CTAs */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.95rem 1.6rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.btn:hover, .btn:focus-visible { background: transparent; color: var(--ink); }
.btn .arrow { transition: transform 0.25s ease; }
.btn:hover .arrow { transform: translateX(4px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover, .btn--ghost:focus-visible { background: var(--ink); color: var(--bg); }
.hero .btn { margin-top: 2.2rem; }

/* ============================================================
   STORIES (How I Operate)
   ============================================================ */
.stories { padding-block: var(--section-y); border-top: 1px solid var(--line); }
.story { padding-block: clamp(2.25rem, 4vw, 3.25rem); }
.story + .story { border-top: 1px solid var(--line); }
.story h3 {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
  font-weight: 500;
  line-height: 1.12;
  font-variation-settings: "opsz" 60;
  margin-bottom: 1.4rem;
}
.story p { margin-bottom: 1.05rem; max-width: 60ch; }
.story p:last-of-type { margin-bottom: 0; }
.story p.hook { color: var(--ink); font-weight: 600; }
.principle {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  margin-top: 1.9rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.principle::before {
  content: "";
  flex: none;
  width: 1.6rem; height: 2px;
  background: var(--green);
  transform: translateY(-0.4em);
}
.principle span {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.5;
}

/* ============================================================
   WHAT I SOLVE
   ============================================================ */
.solve { background: var(--bg-alt); padding-block: var(--section-y); }
.solve__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.solve__head { max-width: var(--container); }
.solve .card h3 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 1rem;
}
.solve .card p { color: var(--body); max-width: 46ch; }

/* ============================================================
   TECHNOLOGY
   ============================================================ */
.tech { padding-block: var(--section-y); }
.tech__intro { color: var(--body); max-width: 38ch; margin-top: 1.6rem; }
.platform { padding-block: clamp(1.75rem, 3.5vw, 2.5rem); display: grid; grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); }
.platform + .platform { border-top: 1px solid var(--line); }
.platform__name {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.05;
  margin-bottom: 0.85rem;
}
.platform__cat {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 1rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-soft);
  padding: 0.4rem 0.7rem;
  border-radius: 100px;
}
.pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .pill::before { animation: none; } }
.platform__body p { color: var(--body); max-width: 52ch; }
.platform__link {
  display: inline-block;
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.25s ease;
}
.platform__link:hover, .platform__link:focus-visible { border-color: var(--ink); }
.inncue {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(2rem, 4vw, 2.75rem);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: center;
}
.inncue p { color: var(--muted); max-width: 52ch; }
.inncue p strong { color: var(--ink); font-weight: 600; }

/* ============================================================
   CAREER
   ============================================================ */
.career { background: var(--bg-alt); padding-block: var(--section-y); }
.role { padding-block: clamp(1.4rem, 3vw, 2rem); display: grid; grid-template-columns: minmax(0, 0.35fr) minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.5rem); }
.role + .role { border-top: 1px solid var(--line); }
.role__period { font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.05em; color: var(--muted); padding-top: 0.4rem; }
.role__title { font-family: var(--font-body); font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem); font-weight: 600; color: var(--ink); line-height: 1.2; }
.role__org { color: var(--body); margin-top: 0.3rem; font-weight: 500; }
.role__detail { color: var(--muted); margin-top: 0.75rem; max-width: 58ch; font-size: 0.98rem; }
.role__metric { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.04em; color: var(--ink); margin-top: 0.9rem; }

/* ============================================================
   CONNECT + FOOTER (dark)
   ============================================================ */
.connect { background: var(--dark-bg); color: var(--paper); padding-top: var(--section-y); padding-bottom: clamp(3rem, 6vw, 4.5rem); }
.connect .eyebrow { color: var(--muted-on-dark); }
.connect h2 { color: var(--paper); font-size: clamp(2.4rem, 1.6rem + 4vw, 4rem); font-weight: 600; line-height: 1.02; letter-spacing: -0.02em; font-variation-settings: "opsz" 144; }
.connect p.invite { color: var(--muted-on-dark); max-width: 40ch; margin-top: 1.75rem; font-size: 1.08rem; line-height: 1.6; }

.connect__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}

.connect__links { display: flex; flex-direction: column; gap: 1.4rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.connect__links a {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--paper);
  text-decoration: none;
  width: -moz-fit-content;
  width: fit-content;
}
.connect__links a .label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
  margin-bottom: 0.45rem;
}
.connect__links a span:not(.label),
.connect__links a {
  border-bottom-color: transparent;
}
.connect__links a:hover, .connect__links a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }

/* contact form */
.connect__form form { display: grid; gap: 1.25rem; }
.field { display: grid; gap: 0.5rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
}
.field input, .field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--paper);
  background: rgba(245, 243, 238, 0.05);
  border: 1px solid var(--line-on-dark);
  border-radius: 2px;
  padding: 0.85rem 1rem;
  width: 100%;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.field input::placeholder, .field textarea::placeholder { color: rgba(245, 243, 238, 0.3); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: rgba(245, 243, 238, 0.5);
  background: rgba(245, 243, 238, 0.08);
}
.field textarea { resize: vertical; min-height: 130px; }
.connect__form .btn { margin-top: 0.25rem; background: var(--paper); color: var(--dark-bg); border-color: var(--paper); width: -moz-fit-content; width: fit-content; }
.connect__form .btn:hover, .connect__form .btn:focus-visible { background: transparent; color: var(--paper); }
.connect__form .btn:disabled { opacity: 0.5; cursor: default; }
.form-status { font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.5; margin: 0; min-height: 1.2em; }
.form-status.is-ok { color: #7fc8a0; }
.form-status.is-err { color: #e2a89c; }
/* honeypot — hidden from people, visible to bots */
.hp { position: absolute !important; left: -9999px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

.site-footer { background: var(--dark-bg); color: var(--muted-on-dark); }
.site-footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding-block: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line-on-dark); font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; }
.site-footer a.to-top { color: var(--muted-on-dark); text-decoration: none; transition: color 0.25s ease; }
.site-footer a.to-top:hover, .site-footer a.to-top:focus-visible { color: var(--paper); }

/* generic page (page.php / 404) */
.page-body { padding-block: var(--section-y); min-height: 50vh; }
.page-body h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.5rem); margin-bottom: 1.5rem; }
.page-body :is(p, ul, ol) { max-width: 65ch; margin-bottom: 1.1rem; }

/* ---------- focus ---------- */
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 1px; }

/* ============================================================
   MOTION — reveal is progressive enhancement only.
   Content is fully visible by default; the from-state is added
   by JS via .reveal-on, and only when motion is allowed.
   ============================================================ */
.reveal-on .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-on .reveal.is-visible { opacity: 1; transform: none; }

.reveal-on .stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-on .stagger.is-visible > * { opacity: 1; transform: none; }
.reveal-on .stagger.is-visible > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-on .stagger.is-visible > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-on .stagger.is-visible > *:nth-child(4) { transition-delay: 0.24s; }
.reveal-on .stagger.is-visible > *:nth-child(5) { transition-delay: 0.32s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .split { grid-template-columns: 1fr; gap: clamp(2rem, 6vw, 3rem); }
  .split__aside { position: static; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: 2; max-width: 420px; aspect-ratio: 4 / 4.4; }
  .platform { grid-template-columns: 1fr; gap: 1rem; }
  .inncue { grid-template-columns: 1fr; align-items: start; }
  .role { grid-template-columns: 1fr; gap: 0.5rem; }
  .role__period { padding-top: 0; }
  .connect__grid { grid-template-columns: 1fr; gap: clamp(2.5rem, 8vw, 3.5rem); }
}
@media (max-width: 600px) {
  .solve__grid { grid-template-columns: 1fr; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; }
}
