/* ==========================================================================
   myuxd.work — Master Stylesheet
   Vanilla CSS. Design tokens via custom properties. Mobile-first.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Color — Light Mode (default) */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F5F5;
  --text-primary: #111111;
  --text-secondary: #555555;
  --accent: #0066FF;
  --placeholder-frame: #C8D0D8;
  --placeholder-label: #888888;
  --border: #E4E4E4;

  /* The hero is its own always-dark zone, so these are deliberately NOT
     overridden per theme. Text sits on this colour directly rather than on an
     image, which is what makes the contrast structural (white on #0D0D0D is
     18.9:1) instead of something a scrim has to negotiate.

     --hero-accent is --accent lifted for use on near-black. #0066FF is only
     3.2:1 on #0D0D0D, which fails for text; #4D94FF is 6.5:1 and passes AA at
     any size. The two blues are close enough to read as one brand colour. */
  --hero-bg: #0D0D0D;
  --hero-accent: #4D94FF;

  /* Type scale — fluid via clamp() */
  /* The name is the only graphic element in the hero now that the image is
     gone, so it can carry a little more size than it could over a photo. */
  --fs-hero: clamp(2.5rem, 7.4vw, 5rem);
  /* Hero sub-headline. Deliberately larger than --fs-lead: at 300 weight it
     has to be big enough for the contrast against the 900 name to register. */
  --fs-hero-lead: clamp(1.25rem, 2.6vw, 1.875rem);
  --fs-h2: clamp(1.5rem, 3.5vw, 2.25rem);
  --fs-h3: clamp(1.15rem, 2vw, 1.4rem);
  --fs-lead: clamp(1.1rem, 2.2vw, 1.5rem);
  --fs-body: 1rem;
  --fs-small: 0.8125rem;

  /* Weights */
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;
  --fw-black: 900;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 9rem;

  /* Layout */
  --max-width: 1140px;
  --gutter: clamp(1.25rem, 5vw, 3rem);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 400ms;

  /* Misc */
  --radius-btn: 4px;
  --nav-height: 68px;
}

:root[data-theme="dark"] {
  --bg-primary: #0D0D0D;
  --bg-secondary: #1A1A1A;
  --text-primary: #F5F5F5;
  --text-secondary: #999999;
  --accent: #0066FF;
  --placeholder-frame: #2A2A2A;
  --placeholder-label: #888888;
  --border: #262626;
  /* --hero-bg / --hero-accent are intentionally absent here: the hero zone
     renders the same in both themes, so it inherits the single value from
     :root. */
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: var(--fw-regular);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul {
  list-style: none;
}

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

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

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

.eyebrow {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  letter-spacing: 0.02em;
  border-radius: var(--radius-btn);
  transition: background-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
}

.btn--primary {
  background-color: var(--accent);
  color: #FFFFFF;
}

.btn--primary:hover {
  background-color: #0052cc;
}

.btn--secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   5. Header / Nav
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: color-mix(in srgb, var(--bg-primary) 90%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav__brand {
  font-weight: var(--fw-bold);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav__link {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--text-primary);
}

/* Dropdown */
.nav__dropdown {
  position: relative;
}

.nav__dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav__dropdown-toggle:hover,
.nav__dropdown-toggle[aria-expanded="true"] {
  color: var(--text-primary);
}

.nav__dropdown-toggle .caret {
  font-size: 0.6em;
  transition: transform 0.2s ease;
}

.nav__dropdown-toggle[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}

.nav__dropdown-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 0;
  min-width: 220px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.nav__dropdown-menu[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__dropdown-menu a {
  display: block;
  padding: 0.6rem 0.75rem;
  font-size: var(--fs-small);
  color: var(--text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav__dropdown-menu a:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

/* Groups the product stories apart from the items that follow. Inset to the
   same 0.75rem as the link padding so the rule lines up with the label text. */
.nav__dropdown-sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0.4rem 0.75rem;
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--text-secondary);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* Mobile nav toggle */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
}

.nav__hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--text-primary);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* --------------------------------------------------------------------------
   6. Placeholder frames
   -------------------------------------------------------------------------- */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: var(--placeholder-frame);
  color: var(--placeholder-label);
  font-size: var(--fs-small);
  font-weight: var(--fw-regular);
  letter-spacing: 0.02em;
  padding: var(--space-md);
  transition: background-color 0.3s ease;
}

.placeholder--card {
  aspect-ratio: 16 / 10;
  width: 100%;
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
/* Typography-only, and always dark in both themes.

   There is no image behind this copy on purpose. The montage we had was a
   bright white-studio shot, so every scrim strong enough to carry white text
   also flattened the image into grey mush — the contrast was being negotiated
   rather than designed. It was also a mockup of a single project that already
   has its own card in the work grid below, so leading with it introduced the
   client before it introduced Mark.

   What replaces it is structure: weight contrast between a 900 name and a 300
   sub-headline, one accent used twice, and two CSS light layers for depth.
   Nothing here can fail to load, and nothing has to fight anything else. */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  /* min-height with no max. The copy is now the only thing sizing this zone,
     so a fixed height (or a max) would clip it on short windows or at large
     text-zoom settings — it just grows instead. 76vh fills the fold without
     pushing the work section entirely below it. */
  min-height: clamp(30rem, 76vh, 46rem);
  background-color: var(--hero-bg);
  /* Scopes the z-index: -1 light layers below, so they stay inside the hero
     rather than sliding behind the page background. */
  isolation: isolate;
  overflow: hidden;
}

/* Key light. One wide, very low-alpha radial pushed off-axis to the upper
   right, so the zone reads as lit from somewhere instead of as a flat black
   rectangle. Sits far enough from the left-aligned copy to never touch it. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    55rem 42rem at 72% 28%,
    rgba(77, 148, 255, 0.22),
    rgba(77, 148, 255, 0) 68%
  );
  pointer-events: none;
}

/* Floor. Darkens the bottom edge so the hero settles rather than stopping on
   a hard line, and hands off cleanly to the section beneath it. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.5) 100%
  );
  pointer-events: none;
}

/* Left-aligned rather than centred. A centred stack of short lines reads as a
   landing-page template; anchoring to the container gutter gives the headline
   a strong ragged right edge and puts the hero on the same vertical line as
   every section below it. .container supplies the max-width and gutter. */
.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: left;
  padding-block: var(--space-lg);
}

/* Hero copy sits on an always-dark zone, so it is white in both themes rather
   than following --text-primary / --text-secondary. Hierarchy comes from size,
   weight, and tracking instead of from colour. */

/* Rule and role travel together as one animated unit — a flex row rather than
   two separately staggered elements, so the eye reads them as a single mark. */
.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  /* Slightly held back from pure white so it introduces the name instead of
     competing with it. 0.72 alpha on #0D0D0D still clears 10:1. */
  color: rgba(255, 255, 255, 0.72);
}

.hero__rule {
  flex: none;
  width: 2.75rem;
  height: 2px;
  background-color: var(--hero-accent);
}

.hero__name {
  margin-top: 0.85rem;
  font-size: var(--fs-hero);
  font-weight: var(--fw-black);
  /* Sub-1 leading and negative tracking pull the letterforms into a single
     mass, which is what makes the name read as a mark rather than as text. */
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #FFFFFF;
}

/* 300 against the name's 900 is the whole design — the size step alone would
   not carry it. Capped near 36ch so it holds a block shape rather than running
   out as one thin measure, and balanced so the last line never strands a
   single word (at 28ch it orphaned "work." on a line of its own). balance is
   progressively enhanced: browsers without it just get the plain greedy wrap
   inside the same measure. */
.hero__headline {
  margin-top: var(--space-md);
  max-width: 36ch;
  font-size: var(--fs-hero-lead);
  font-weight: var(--fw-light);
  line-height: 1.35;
  text-wrap: balance;
  color: rgba(255, 255, 255, 0.92);
}

/* The one place the accent appears in the copy, on the clause that carries
   the actual claim. --hero-accent, not --accent, so it passes on near-black. */
.hero__headline em {
  font-style: normal;
  font-weight: var(--fw-regular);
  color: var(--hero-accent);
}

.hero__ctas {
  margin-top: var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* The default secondary button is --text-primary on --border, which is #111
   on a near-invisible grey in light mode — unreadable in an always-dark zone.
   Scope it to the hero rather than touching the global button. */
.hero .btn--secondary {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.32);
}

.hero .btn--secondary:hover {
  color: #FFFFFF;
  border-color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.08);
}

@media (min-width: 720px) {
  .hero__content {
    padding-block: var(--space-xl);
  }
}

/* --------------------------------------------------------------------------
   8. Positioning statement
   -------------------------------------------------------------------------- */
.positioning {
  background-color: var(--bg-secondary);
  transition: background-color 0.3s ease;
}

.positioning__text {
  font-size: var(--fs-lead);
  font-weight: var(--fw-light);
  line-height: 1.5;
}

.positioning__text strong {
  font-weight: var(--fw-medium);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   9. Featured Product Stories
   -------------------------------------------------------------------------- */
.work__header {
  margin-bottom: var(--space-lg);
}

.work__title {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
  margin-top: var(--space-xs);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

/* position: relative anchors the stretched .card__link overlay below. */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  transition: transform var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

/* The whole card is one hit target, so the focus ring belongs on the card
   rather than on the link text it originates from. */
.card:focus-within {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card:focus-within .card__link:focus-visible {
  outline: none;
}

.card__media {
  display: block;
  border-bottom: 1px solid var(--border);
}

.card__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* A placeholder standing in for a card thumbnail keeps the centered label
   from .placeholder — .card__media's display would otherwise win on order. */
.card__media.placeholder {
  display: flex;
}

.card__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card__name {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}

.card__descriptor {
  margin-top: var(--space-xs);
  color: var(--text-secondary);
  font-size: var(--fs-body);
  flex: 1;
}

.card__link {
  margin-top: var(--space-md);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  align-self: flex-start;
  transition: gap 0.2s ease;
}

/* Stretch the link over the whole card so the entire surface is tappable,
   without nesting an <a> around the other card content. The link keeps its
   own semantics and stays the single tab stop. */
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.card:hover .card__link {
  gap: 0.7rem;
}

/* --------------------------------------------------------------------------
   10. Contact CTA
   -------------------------------------------------------------------------- */
.contact-cta {
  background-color: var(--bg-secondary);
  text-align: center;
  transition: background-color 0.3s ease;
}

.contact-cta__title {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}

.contact-cta__text {
  margin-top: var(--space-sm);
  margin-inline: auto;
  max-width: 46ch;
  color: var(--text-secondary);
  font-size: var(--fs-lead);
  font-weight: var(--fw-light);
}

.contact-cta__email {
  margin-top: var(--space-lg);
  display: inline-block;
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.25rem;
  transition: color 0.2s ease;
}

.contact-cta__email:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-md);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-small);
  color: var(--text-secondary);
}

.site-footer__links {
  display: flex;
  gap: var(--space-md);
}

.site-footer__links a {
  transition: color 0.2s ease;
}

.site-footer__links a:hover {
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   11b. Resume page
   -------------------------------------------------------------------------- */
.resume {
  padding-block: var(--space-xl) var(--space-lg);
}

/* Masthead */
.resume-head {
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--text-primary);
}

.resume-head__name {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: var(--fw-black);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.resume-head__title {
  margin-top: var(--space-sm);
  font-size: var(--fs-h3);
  font-weight: var(--fw-regular);
  color: var(--text-primary);
}

.resume-head__disciplines {
  margin-top: var(--space-xs);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.resume-head__meta {
  margin-top: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: var(--fs-small);
  color: var(--text-secondary);
}

.resume-head__meta a:hover {
  color: var(--accent);
}

.resume-head__actions {
  margin-top: var(--space-md);
}

/* Section — narrow label column + content column */
.resume-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  padding-block: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.resume-section:last-of-type {
  border-bottom: none;
}

.resume-section__title {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
}

.resume-section__body > * + * {
  margin-top: var(--space-md);
}

.resume-lead {
  font-size: var(--fs-lead);
  font-weight: var(--fw-light);
  line-height: 1.5;
}

.resume-prose p + p {
  margin-top: var(--space-sm);
}

/* Job / project entries */
.resume-entry + .resume-entry {
  margin-top: var(--space-lg);
}

.resume-entry__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem var(--space-sm);
}

.resume-entry__org {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}

.resume-entry__meta {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.resume-entry__role {
  margin-top: 0.15rem;
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--accent);
}

.resume-entry__desc {
  margin-top: var(--space-sm);
  color: var(--text-secondary);
}

.resume-subhead {
  margin-top: var(--space-md);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

/* Bullets */
.resume-bullets {
  margin-top: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.resume-bullets li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.resume-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.5rem;
  height: 2px;
  background-color: var(--accent);
}

/* Skill / tool chips */
.resume-group + .resume-group {
  margin-top: var(--space-md);
}

.resume-group__label {
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-size: var(--fs-small);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Simple stacked facts (education, military, certs) */
.resume-fact__primary {
  font-weight: var(--fw-bold);
  font-size: var(--fs-h3);
  letter-spacing: -0.01em;
}

.resume-fact__secondary {
  margin-top: 0.15rem;
  color: var(--text-secondary);
}

@media (min-width: 820px) {
  .resume-section {
    grid-template-columns: 220px 1fr;
    gap: var(--space-lg);
  }
}

/* --------------------------------------------------------------------------
   11d. Contact page
   -------------------------------------------------------------------------- */
.contact-page {
  padding-block: clamp(var(--space-xl), 12vw, var(--space-2xl));
}

.contact-page__title {
  margin-top: var(--space-xs);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: var(--fw-black);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.contact-lead {
  margin-top: var(--space-md);
  font-size: var(--fs-lead);
  font-weight: var(--fw-light);
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 46ch;
}

.contact-list {
  margin-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-list__label {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
}

.contact-list__value {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.15rem;
  transition: color 0.2s ease;
}

.contact-list__value:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   11c. Product story page
   -------------------------------------------------------------------------- */
.story {
  padding-block: var(--space-xl) var(--space-lg);
}

/* Full-width content column, matching the site container */
.story__wrap {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Masthead */
.story-head {
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--text-primary);
}

.story-head__title {
  margin-top: var(--space-xs);
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: var(--fw-black);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.story-head__subtitle {
  margin-top: var(--space-sm);
  font-size: var(--fs-lead);
  font-weight: var(--fw-light);
  color: var(--text-secondary);
}

/* Sections divided by hairline rules; label follows the resume hierarchy */
.story-section {
  padding-top: var(--space-lg);
  margin-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

/* Stories with no hero image open straight into At a Glance, so the section's
   own hairline would stack under the masthead rule as a second, thinner line.
   The masthead rule already divides them; margin-top alone matches the
   4rem gap a hero figure leaves on the pages that have one. */
.story-head + .story-section {
  padding-top: 0;
  border-top: 0;
}

.story-section__title {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

/* Sub-headings — mirror resume entry org / subhead treatments */
.story-h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.story-h4 {
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

/* Prose */
.story p {
  line-height: 1.65;
}

.story p + p {
  margin-top: var(--space-sm);
}

.story-section__title + .story p,
.story-h3 + .story p {
  margin-top: 0;
}

/* Bullet lists — accent dash marker (matches resume) */
.story-list {
  margin-top: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.story-list li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.story-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.5rem;
  height: 2px;
  background-color: var(--accent);
}

/* At a Glance table */
.glance-panel {
  background-color: var(--bg-secondary);
  padding: var(--space-md);
  transition: background-color 0.3s ease;
}

.glance {
  width: 100%;
  border-collapse: collapse;
}

.glance th {
  text-align: left;
  vertical-align: top;
  width: 32%;
  padding: 0.85rem 1.25rem 0.85rem 0;
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.glance td {
  vertical-align: top;
  padding: 0.85rem 0;
  color: var(--text-secondary);
}

.glance tr + tr th,
.glance tr + tr td {
  border-top: 1px solid var(--border);
}

/* Comparison table — e.g. brand vocabulary (Generic vs. Corporate Dump) */
.vocab-panel {
  background-color: var(--bg-secondary);
  padding: var(--space-md);
  transition: background-color 0.3s ease;
}

.vocab-table {
  width: 100%;
  border-collapse: collapse;
}

.vocab-table th {
  width: 50%;
  text-align: left;
  padding: 0.75rem 1.25rem 0.75rem 0;
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  border-bottom: 2px solid var(--text-primary);
}

.vocab-table td {
  padding: 0.75rem 1.25rem 0.75rem 0;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.vocab-table td:last-child,
.vocab-table th:last-child {
  padding-right: 0;
}

.vocab-table td.cd {
  color: var(--text-primary);
  font-weight: var(--fw-medium);
}

/* Callout — used for the documented bug */
.story-callout {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-md);
  margin-top: var(--space-md);
}

/* Story image placeholders */
.placeholder--story {
  aspect-ratio: 16 / 9;
  width: 100%;
  margin-top: var(--space-lg);
}

.placeholder--inline {
  aspect-ratio: 16 / 9;
  width: 100%;
  margin-top: var(--space-md);
}

/* A pending screenshot sitting inside a .shot__btn trigger. The figure and
   button already carry the margin and frame, so this only sets the ratio. */
.placeholder--shot {
  aspect-ratio: 16 / 9;
  width: 100%;
}

/* Real screenshots — portrait device shots centered on a panel */
.device-shot {
  margin-top: var(--space-lg);
}

.device-shot__stage {
  display: flex;
  justify-content: center;
  padding: clamp(var(--space-md), 5vw, var(--space-xl)) var(--space-md);
  background-color: var(--bg-secondary);
  transition: background-color 0.3s ease;
}

.device-shot__img {
  width: 100%;
  max-width: 320px;
  height: auto;
  border: 1px solid var(--border);
}

.device-shot--hero .device-shot__img {
  max-width: 380px;
}

.device-shot__caption {
  margin-top: var(--space-sm);
  text-align: center;
  font-size: var(--fs-small);
  color: var(--text-secondary);
}

/* Landscape screenshots — click to expand in the lightbox */
.shot {
  margin-top: var(--space-lg);
}

/* The trigger is a button so the lightbox is keyboard-reachable.
   Reset the UA button chrome so only the image reads. */
.shot__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  background: none;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
  transition: border-color 0.2s ease;
}

.shot__btn:hover {
  border-color: var(--accent);
}

.shot__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.shot__img {
  display: block;
  width: 100%;
  height: auto;
}

/* Single column on mobile, two columns from 720px.
   Two children read as a pair; four read as a 2x2. */
.shot-grid {
  margin-top: var(--space-lg);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-sm);
}

.shot-grid .shot {
  margin-top: 0;
}

@media (min-width: 720px) {
  .shot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shot-grid--trio {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shot-grid--five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .shot-grid--five .shot {
    max-width: none;
  }
}

/* Stacked below 720px — cap and centre so a single 1:2.2 promo card
   doesn't run the full container width */
.shot-grid--five .shot {
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
}

/* These promo cards carry their own full-bleed background, so a frame
   around them reads as a double edge */
.shot-grid--five .shot__btn {
  border: none;
}

/* Portrait phone screenshots (roughly 1:2) are centered on a panel rather
   than stretched to the column width — the same treatment as .device-shot.
   At full container width an uncapped 1:2 image would run over 2000px tall. */
.shot--phone .shot__btn {
  display: flex;
  justify-content: center;
  padding: clamp(var(--space-sm), 3vw, var(--space-md));
  background-color: var(--bg-secondary);
  transition: background-color 0.3s ease, border-color 0.2s ease;
}

.shot--phone .shot__img {
  width: 100%;
  max-width: 300px;
}

/* Standalone phone shot — a little larger since it has the row to itself */
.shot--phone.shot--feature .shot__img {
  max-width: 380px;
}

/* --------------------------------------------------------------------------
   Lightbox — built and injected by js/main.js
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(var(--space-sm), 4vw, var(--space-lg));
  background-color: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__figure {
  max-width: 100%;
  max-height: 100%;
  cursor: default;
}

.lightbox__img {
  display: block;
  max-width: 100%;
  /* Cap on the viewport so tall images never overflow the overlay */
  max-height: calc(100vh - 2 * clamp(1rem, 4vw, 4rem));
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Expanded stand-in for a placeholder frame — the label is the content, so it
   scales up rather than opening an empty overlay. */
.lightbox__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: min(90vw, 1000px);
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 2 * clamp(1rem, 4vw, 4rem));
  padding: var(--space-md);
  background-color: var(--placeholder-frame);
  color: var(--placeholder-label);
  font-size: var(--fs-body);
  letter-spacing: 0.02em;
}

.lightbox__placeholder[hidden] {
  display: none;
}

.lightbox__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-btn);
  background-color: rgba(0, 0, 0, 0.5);
  color: #FFFFFF;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lightbox__close:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #FFFFFF;
}

.lightbox__close:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

/* Project materials — interactive prototype + document downloads */
.story-materials {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: flex-start;
}

.story-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* Back-to-work link at foot of story */
.story-footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.story-meta {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  line-height: 1.8;
}

.story-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--space-md);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  transition: gap 0.2s ease;
}

.story-back:hover {
  gap: 0.7rem;
}

@media (min-width: 640px) {
  .placeholder--story {
    aspect-ratio: 21 / 9;
  }
}

/* --------------------------------------------------------------------------
   12. Scroll animations
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero intro — a staggered settle on the first visit of a session.

   No blur, on anything. The previous version left the hero image softly
   blurred as its END state, which read as a broken or half-loaded image
   rather than as a treatment. Every element here finishes sharp, fully
   opaque, and in place; the animation only ever moves opacity and position.

   The rules below ARE the settled state, so a repeat visit, a no-JS visit,
   and a reduced-motion visit all render the finished hero with nothing to
   wait for. On a first visit the pre-paint script in index.html adds
   .hero-intro to <html>, which rewinds the copy, then removes it — one class
   change driving the whole stagger. */
.hero-anim {
  opacity: 1;
  transform: translateY(0);
  /* 700ms rather than --dur (400ms): with a stagger this shallow, the longer
     ease is what makes it read as one confident settle instead of four
     separate pops. */
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  /* Stagger comes from the --hero-delay the markup carries: 0/100/200/300ms. */
  transition-delay: var(--hero-delay, 0ms);
}

.hero-intro .hero-anim {
  opacity: 0;
  transform: translateY(18px);
  transition-delay: 0ms;
}

/* --------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 720px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile nav */
@media (max-width: 719px) {
  .nav__hamburger {
    display: flex;
  }

  /* Anchored to the header rather than the viewport. position: fixed detached
     the panel from the sticky header: it was pinned var(--nav-height) from the
     top of the *viewport*, so it drifted over the header — and over mobile
     browser chrome — whenever the visual viewport shifted under a collapsing
     URL bar. top: 100% on an absolute child of the positioned header puts it
     directly under the bar and keeps it there.

     max-height plus overflow-y is the other half: the panel is a long list
     once the Work dropdown expands, and fixed positioning with bottom: auto
     let the tail of it — Contact and the theme toggle — fall past the bottom
     edge with no way to reach them. dvh follows the shrinking viewport on
     mobile; the vh line above it is the fallback for browsers without dvh.

     Hiding via opacity/visibility rather than a translate, matching the
     desktop dropdown, so the closed panel can never paint over the header. */
  .nav__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: var(--space-sm) var(--gutter) var(--space-md);
    max-height: calc(100vh - var(--nav-height));
    max-height: calc(100dvh - var(--nav-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.25s var(--ease-out),
      transform 0.25s var(--ease-out), visibility 0.25s;
  }

  .nav__menu[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav__menu > * {
    width: 100%;
    padding-block: 0.6rem;
  }

  .nav__dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: none;
    padding: 0 0 0 var(--space-sm);
    display: none;
  }

  .nav__dropdown-menu[data-open="true"] {
    display: block;
  }

  .theme-toggle {
    margin-top: var(--space-xs);
  }
}

/* --------------------------------------------------------------------------
   14. Accessibility — reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .hero-anim {
    opacity: 1 !important;
    transform: none !important;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   15. Print — clean resume output
   -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .resume-head__actions {
    display: none;
  }

  .resume-section {
    grid-template-columns: 200px 1fr;
    break-inside: avoid;
    padding-block: 1rem;
  }

  .resume {
    padding-block: 0;
  }

  .chip:hover {
    border-color: var(--border);
    color: var(--text-secondary);
  }
}
