/* ————————————————————————————————
   Mark Zumwalt — markzumwalt.com
   One viewport, three views (home / profile / contact).
   Brand pink #E86BC1 now lives in a WebGL shader (CSS fallback).
———————————————————————————————— */

:root {
  --paper: #FAF8F5;
  --ink: #171717;
  --ink-soft: #3F3F3F;
  --pink: #E86BC1;
  --pink-deep: #C93F9C;        /* accents, borders, decorative only */
  --pink-text: #B02E86;        /* text-safe pink — AA (5.5:1) on paper */
  --hairline: rgba(23, 23, 23, 0.18);
  --display: "Space Grotesk", sans-serif;
  --mono: "Space Mono", monospace;
  --panel-w: 44vw;
  --pad: clamp(20px, 3.4vw, 52px);
  --ease: cubic-bezier(0.2, 0.65, 0.25, 1);
}

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

html { height: 100%; }

body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* every view is strictly one viewport on desktop; if a secondary
   view's text column is too tall it scrolls internally, the page never does */
@media (min-width: 720px) and (min-height: 620px) {
  body { overflow: clip; height: 100dvh; }
  .stage { height: 100dvh; min-height: 0; }
}

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

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 99;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; font: 13px var(--mono);
}
.skip:focus { left: 8px; }

/* ——— stage ——— */

.stage {
  position: relative;
  min-height: 100dvh;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  overflow: clip;
}

/* shader panel */
.panel {
  position: absolute;
  top: 0; right: 0;
  width: var(--panel-w);
  height: 100%;
  z-index: 1;
  /* fallback + flash-of-unstyled cover; shader canvas paints over this */
  background: linear-gradient(160deg, #F2A0D6 0%, var(--pink) 42%, #D14FA8 100%);
}
#shader { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.panel-grain {
  position: absolute; inset: 0; opacity: 0.26;
  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.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* giant name */
.name {
  position: absolute;
  z-index: 2;
  inset: 0;
  padding: calc(var(--pad) + 44px) var(--pad) 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  font-family: var(--display);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: 0.005em;
  color: var(--ink);
}
.name-line {
  font-size: clamp(64px, 12.2vw, 190px);
  white-space: nowrap;
  transition: font-size 0.55s var(--ease);
}

/* secondary views: masthead compresses to a header and joins the
   layout flow so content can never slide underneath it */
body[data-view="profile"] .name,
body[data-view="contact"] .name {
  position: relative;
  inset: auto;
  padding: 14px 0 0;
  flex-direction: row;
  gap: 0.32em;
}
body[data-view="profile"] .name-line,
body[data-view="contact"] .name-line {
  font-size: clamp(34px, 4.2vw, 58px);
}

/* portrait */
.portrait {
  position: absolute;
  z-index: 3;
  right: calc(var(--panel-w) * 0.5);
  transform: translateX(50%);
  bottom: 0;
  height: min(90dvh, 54vw);
  display: block;
  filter: drop-shadow(0 22px 44px rgba(23, 23, 23, 0.18));
  transition: height 0.55s var(--ease);
}
body[data-view="profile"] .portrait,
body[data-view="contact"] .portrait {
  height: min(78dvh, 46vw);
}
.portrait img {
  height: 100%; width: auto; display: block;
  user-select: none; -webkit-user-drag: none;
}

/* rail / nav */
.rail {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
  width: calc(100% - var(--panel-w) - var(--pad));
}
.rail-nav { display: flex; gap: 22px; }
.nav-link {
  appearance: none; border: none; background: none; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: var(--ink); text-decoration: none; padding: 0;
  transition: color 0.18s var(--ease), transform 0.12s var(--ease);
}
.nav-link:hover, .nav-link:focus-visible { color: var(--pink-text); }
.nav-link:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}
.nav-link:active { transform: translateY(1px); }
.nav-link[aria-current="true"] {
  color: var(--pink-text);
  border-bottom: 2px solid var(--pink-text);
}

/* ——— views ——— */

.view {
  position: relative;
  z-index: 4;
  margin-top: auto;
  max-width: calc(100% - var(--panel-w));
  padding-bottom: clamp(24px, 5dvh, 64px);
}
body:not([data-view="home"]) .view {
  margin-top: clamp(16px, 3dvh, 30px);
  margin-bottom: auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
  padding-bottom: clamp(16px, 3dvh, 36px);
  padding-right: 6px;
}
.view[hidden] { display: none; }
.view-anim { animation: view-in 0.45s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(16px); } }

/* home */
.view-home { max-width: min(46ch, calc(100% - var(--panel-w))); }
.tagline { font-size: clamp(16px, 1.5vw, 22px); color: var(--ink); text-wrap: balance; }
.sub {
  margin-top: 14px;
  font-size: clamp(12px, 1vw, 14px);
  line-height: 1.7;
  color: rgba(23, 23, 23, 0.62);
  max-width: 38ch;
  text-wrap: pretty;
}

/* profile */
.view-kicker {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(17px, 1.5vw, 24px);
  text-wrap: balance;
}
.profile-lede {
  margin-top: 10px;
  font-size: clamp(12px, 0.95vw, 14px);
  line-height: 1.58;
  color: var(--ink-soft);
  max-width: 62ch;
  text-wrap: pretty;
}
.creds {
  margin-top: clamp(12px, 2dvh, 22px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 2.4vw, 44px);
  border-top: 1px solid var(--hairline);
  padding-top: clamp(10px, 1.6dvh, 18px);
}
.creds h2 {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink-text);
  margin-bottom: 8px;
}
.creds ul { list-style: none; margin-bottom: clamp(10px, 1.6dvh, 16px); }
.creds ul:last-child { margin-bottom: 0; }
.creds li {
  font-size: clamp(11.5px, 0.9vw, 13.5px);
  line-height: 1.5;
  padding: 2px 0;
}
.creds a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hairline); }
.creds a:hover { color: var(--pink-text); border-color: var(--pink-text); }
.industries {
  margin-top: clamp(10px, 1.6dvh, 18px);
  padding-top: clamp(10px, 1.4dvh, 14px);
  border-top: 1px solid var(--hairline);
  font-size: clamp(11px, 0.85vw, 12.5px);
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.industries span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pink-text);
  margin-bottom: 6px;
}

/* contact */
.contact-note { margin-top: 10px; font-size: 13px; color: var(--ink-soft); line-height: 1.6; text-wrap: pretty; }
#contact-form { margin-top: clamp(16px, 2.6dvh, 26px); display: grid; gap: 14px; max-width: 58ch; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#contact-form label { display: grid; gap: 6px; }
#contact-form label span {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft);
}
#contact-form input, #contact-form textarea {
  font: 14px/1.5 var(--mono);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: 11px 13px;
  transition: border-color 0.15s;
  width: 100%;
}
#contact-form input:focus, #contact-form textarea:focus {
  outline: none;
  border-color: var(--pink-deep);
  box-shadow: 0 0 0 1px var(--pink-deep);
}
#contact-form textarea { resize: vertical; }

.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

/* CTAs */
.cta-row { margin-top: clamp(20px, 4dvh, 34px); display: flex; gap: 34px; align-items: center; flex-wrap: wrap; }
#contact-form .cta-row { margin-top: 6px; }
.cta {
  appearance: none; border: none; background: none; cursor: pointer;
  font: 500 clamp(15px, 1.25vw, 18px) var(--display);
  letter-spacing: 0.01em;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 0 12px;
  border-bottom: 2px solid var(--ink);
  transition: color 0.2s, border-color 0.2s, gap 0.2s, background 0.2s, transform 0.14s var(--ease);
}
.cta:hover, .cta:focus-visible { color: var(--pink-text); border-color: var(--pink-text); gap: 20px; }
.cta:focus-visible { outline: 2px dashed var(--pink-text); outline-offset: 6px; }
.cta--ghost { color: rgba(23,23,23,0.66); border-color: transparent; }
.cta--solid {
  background: var(--ink); color: var(--paper);
  border: none; padding: 14px 24px;
}
.cta--solid:hover, .cta--solid:focus-visible { background: var(--pink-text); color: var(--paper); }
.cta:active { transform: translateY(1px); }
.cta--solid:active { transform: translateY(1px) scale(0.99); }

.form-status { font-size: 13px; line-height: 1.5; min-height: 1.2em; }
.form-status.ok { color: #0d7a3f; }
.form-status.err { color: #b3261e; }

/* footer */
.foot {
  position: relative; z-index: 4;
  margin-top: 14px;
  display: flex; gap: 10px;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(23, 23, 23, 0.66);
}
.foot-sep { color: var(--pink-deep); }

/* ——— load reveal ——— */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal 0.7s var(--ease) forwards;
  animation-delay: calc(var(--i) * 90ms);
}
.portrait { animation: portrait-in 0.9s var(--ease) 0.15s backwards; }
.panel { animation: panel-in 0.7s cubic-bezier(0.65, 0, 0.35, 1) backwards; }

@keyframes reveal { to { opacity: 1; transform: none; } }
@keyframes portrait-in { from { opacity: 0; transform: translateX(50%) translateY(34px); } }
@keyframes panel-in { from { transform: translateX(30%); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  [data-reveal], .portrait, .panel { animation: none; opacity: 1; }
  .portrait { transform: translateX(50%); }
  [data-reveal], .panel { transform: none; }
  .name-line, .portrait, .view-anim { transition: none; animation: none; }
}

/* ——— tablet band: desktop layout is active, but a 44vw panel starves
   the rail and text column between the mobile breakpoint and full desktop ——— */

@media (min-width: 720px) and (max-width: 900px) {
  :root { --panel-w: 38vw; }
  .rail { font-size: 12px; letter-spacing: 0.05em; }
  .rail-loc { white-space: nowrap; }
  .rail-nav { gap: 16px; }
}

/* ——— mobile ——— */

@media (max-width: 719px) {
  :root { --panel-w: 100vw; }

  .stage { padding-bottom: 0; }

  .panel { top: auto; bottom: 0; width: 100%; height: 46dvh; }

  .name { position: relative; inset: auto; padding: 16px 0 0; order: 1; }
  .name-line { font-size: clamp(48px, 14vw, 88px); }
  body[data-view="profile"] .name-line,
  body[data-view="contact"] .name-line { font-size: clamp(30px, 9vw, 44px); }

  .rail { width: 100%; order: 0; flex-wrap: wrap; gap: 8px; }
  .rail-nav { gap: 16px; }
  /* grow touch targets to ~35px without shifting the baseline layout */
  .nav-link { padding: 7px 0; margin: -7px 0; }

  .view { order: 2; max-width: 100%; margin-top: 16px; padding-bottom: 0; }
  .view-home { max-width: 100%; }
  .creds { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  #contact-form { max-width: 100%; }

  .portrait {
    position: relative; order: 3;
    right: auto; transform: none;
    align-self: center;
    height: auto; margin-top: 20px;
    transition: none;
  }
  body[data-view="profile"] .portrait,
  body[data-view="contact"] .portrait { height: auto; }
  .portrait img { height: 40dvh; width: auto; }
  @keyframes portrait-in { from { opacity: 0; transform: translateY(34px); } }
  @media (prefers-reduced-motion: reduce) { .portrait { transform: none; } }

  .foot {
    order: 4;
    justify-content: center;
    padding: 16px 0 18px;
    color: rgba(250, 248, 245, 0.92);
  }
}
