/*
Theme Name: Sam Portfolio
Theme URI: https://issams.framer.website/
Author: Sam Saffouri
Description: Custom portfolio & case-study theme mirroring issams.framer.website — one-page structure (hero, work grid, about, experience, contact), a secure contact form, password-protected posts, and a persistent light/dark mode.
Version: 2.0.0
Requires PHP: 7.0
Text Domain: sam-portfolio
*/

/* ==========================================================================
   1. DESIGN TOKENS
   Two palettes (from the site's styles.json). Semantic tokens (--bg, --ink…)
   flip with [data-theme]; the site defaults to DARK, matching the reference.
   A few "ink" surfaces (hero, footer) stay dark in both modes on purpose.
   ========================================================================== */
:root {
  /* Raw palettes */
  --light-background: rgb(250, 247, 242);
  --light-surface:    rgb(241, 235, 226);
  --light-ink:        rgb(41, 29, 17);
  --light-muted:      rgb(112, 99, 84);
  --light-accent:     rgb(216, 73, 31);
  --light-hairline:   rgba(41, 29, 17, 0.15);

  --dark-background: rgb(22, 18, 14);
  --dark-surface:    rgb(33, 27, 21);
  --dark-ink:        rgb(237, 230, 220);
  --dark-muted:      rgb(162, 150, 138);
  --dark-accent:     rgb(240, 105, 60);
  --dark-hairline:   rgba(237, 230, 220, 0.16);

  /* Permanent "ink" tokens (dark panels regardless of mode) */
  --color-background-dark: var(--dark-background);
  --color-surface-dark:    var(--dark-surface);
  --color-ink-dark:        var(--dark-ink);
  --color-muted-dark:      var(--dark-muted);
  --color-accent-dark:     var(--dark-accent);
  --color-hairline-dark:   var(--dark-hairline);

  /* Semantic tokens — DARK by default */
  --bg:       var(--dark-background);
  --surface:  var(--dark-surface);
  --ink:      var(--dark-ink);
  --muted:    var(--dark-muted);
  --accent:   var(--dark-accent);
  --hairline: var(--dark-hairline);

  /* Legacy aliases kept so older template selectors keep working */
  --color-background: var(--bg);
  --color-surface:    var(--surface);
  --color-ink:        var(--ink);
  --color-muted:      var(--muted);
  --color-accent:     var(--accent);
  --color-hairline:   var(--hairline);

  --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  /* Serif display face for all headings (H1–H6) and display text. */
  --font-serif: 'Cormorant', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;

  --fs-display: 58px;
  --fs-h2: 38px;
  --fs-h3: 18px;
  --fs-body: 16px;
  --fs-body-lg: 19px;
  --fs-label: 12px;

  --radius: 8px;
  --container: 1160px;
  --transition: 420ms cubic-bezier(.2,.7,.2,1);
}

/* LIGHT mode override */
html[data-theme="light"] {
  --bg:       var(--light-background);
  --surface:  var(--light-surface);
  --ink:      var(--light-ink);
  --muted:    var(--light-muted);
  --accent:   var(--light-accent);
  --hairline: var(--light-hairline);
}

@media (min-width: 810px) and (max-width: 1199px) {
  :root { --fs-display: 38px; --fs-h2: 34px; }
}
@media (min-width: 1200px) {
  :root { --fs-display: 46px; --fs-h2: 34px; --fs-body-lg: 17px; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-family);
  font-size: var(--fs-body);
  line-height: 1.7em;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ==========================================================================
   2. TYPE SCALE
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.fs-display, .fs-h2, .fs-h3 {
  font-family: var(--font-serif);
}
h1, .fs-display {
  font-weight: 600;
  font-size: var(--fs-display);
  letter-spacing: -0.01em;
  line-height: 1.08em;
  margin: 0;
  color: var(--ink);
}
h2, .fs-h2 {
  font-weight: 500;
  font-size: var(--fs-h2);
  letter-spacing: -0.005em;
  line-height: 1.15em;
  margin: 0 0 24px;
  color: var(--ink);
}
h3, .fs-h3 {
  font-weight: 500;
  font-size: var(--fs-h3);
  letter-spacing: -0.01em;
  line-height: 1.4em;
  margin: 0 0 16px;
  color: var(--ink);
}
h4, h5, h6 { font-weight: 600; color: var(--ink); margin: 0 0 12px; }
p, .fs-body {
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.7em;
  color: var(--muted);
  margin: 0 0 18px;
}
.fs-body-lg {
  font-weight: 400;
  font-size: var(--fs-body-lg);
  letter-spacing: -0.005em;
  line-height: 1.65em;
  color: var(--muted);
  margin: 0 0 20px;
}
.serif { font-family: var(--font-serif); font-weight: 500; letter-spacing: 0; }

.label, .eyebrow {
  display: block;
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  line-height: 1.4em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 20px;
}
.section-ink .label,
.section-ink .eyebrow { color: var(--color-muted-dark); }

/* Section label with a short accent bar, like the reference's "— SELECTED WORK" */
.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 36px;
}
.section-label::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--accent);
  flex: none;
}

ul, ol { color: var(--muted); line-height: 1.7em; padding-left: 20px; }
ul li, ol li { margin-bottom: 8px; }

/* ==========================================================================
   3. LAYOUT
   ========================================================================== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 96px 0; }
.section-hairline { border-top: 1px solid var(--hairline); }
@media (max-width: 640px) { .section { padding: 60px 0; } }

.section-ink {
  background: var(--color-background-dark);
  color: var(--color-ink-dark);
}
.section-ink h1, .section-ink h2, .section-ink h3 { color: var(--color-ink-dark); }
.section-ink p, .section-ink .fs-body-lg { color: var(--color-muted-dark); }
.section-surface { background: var(--surface); }

hr.hairline {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 40px 0;
}
.section-ink hr.hairline { border-top-color: var(--color-hairline-dark); }

/* ==========================================================================
   4. HEADER / FOOTER
   ========================================================================== */
.site-header {
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background var(--transition), border-color var(--transition), opacity 320ms cubic-bezier(.2,.7,.2,1);
}
/* Homepage only: the header sits after the hero in normal flow (see
   index.php), so it exists in the DOM well before it's actually pinned to
   the top. Keep it invisible until inc/header-stick.js confirms — via the
   sentinel just before it — that it has reached the viewport's top edge. */
.home .header-stick-sentinel { position: relative; height: 1px; }
.home .site-header { opacity: 0; pointer-events: none; }
.home .site-header.is-stuck { opacity: 1; pointer-events: auto; }
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.site-branding {
  font-family: var(--font-family);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.site-branding img { height: 30px; width: 30px; border-radius: 50%; }
.header-right { display: flex; align-items: center; gap: 28px; }
.main-nav ul { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  font-size: 14px; font-weight: 500; color: var(--muted);
  transition: color var(--transition);
}
.main-nav a:hover, .main-nav a:focus-visible { color: var(--accent); }
.back-link { font-size: 14px; color: var(--muted); }
.back-link:hover { color: var(--accent); }

/* Animated burger ↔ arrow toggle (adapted from the menu-toggle component).
   Hidden on desktop; shown only on responsive screens via the media query below. */
.nav-toggle {
  display: none;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink);
  width: 40px; height: 40px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition);
}
.nav-toggle:hover { color: var(--accent); }
.nav-toggle-icon {
  width: 24px; height: 24px; display: block;
  transition: transform 0.6s ease-out;
}
.nav-toggle-top {
  stroke-dasharray: 12 63;
  transition: stroke-dasharray 0.6s ease-out, stroke-dashoffset 0.6s ease-out;
}
.site-header.nav-open .nav-toggle-icon { transform: rotate(-45deg); }
.site-header.nav-open .nav-toggle-top {
  stroke-dasharray: 20 300;
  stroke-dashoffset: -32.42px;
}
@media (prefers-reduced-motion: reduce) {
  .nav-toggle-icon, .nav-toggle-top { transition: none; }
}

/* Responsive: collapse the inline nav into a burger-triggered dropdown panel. */
@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.14);
    padding: 4px 24px 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
  }
  .site-header.nav-open .main-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav li { border-top: 1px solid var(--hairline); }
  .main-nav li:first-child { border-top: none; }
  .main-nav a { display: block; padding: 16px 2px; font-size: 16px; }

  /* Keep the long site title on one line beside the controls. */
  .site-branding { font-size: 19px; white-space: nowrap; }
}

/* Theme toggle button */
.theme-toggle {
  appearance: none;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), transform 260ms cubic-bezier(.34,1.56,.64,1);
  flex: none;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: scale(1.1); }
.theme-toggle:active { transform: scale(0.86); }

/* Animated sun↔moon morph (adapted from the animated-theme-toggler component).
   State is driven entirely by html[data-theme]; spring-like easing approximates
   motion/react's stiffness:380 / damping:30. */
.theme-toggle .att-svg {
  width: 20px; height: 20px; display: block; overflow: visible;
  transition: transform 520ms cubic-bezier(.34,1.4,.5,1);
}
.theme-toggle .att-body { transition: r 520ms cubic-bezier(.34,1.4,.5,1); }
.theme-toggle .att-mask-circle {
  transition: cx 520ms cubic-bezier(.34,1.4,.5,1), cy 520ms cubic-bezier(.34,1.4,.5,1);
}
.theme-toggle .att-rays {
  transform-box: view-box; transform-origin: 12px 12px;
  transition: opacity 420ms ease, transform 520ms cubic-bezier(.34,1.4,.5,1);
}

/* Light = sun */
.theme-toggle .att-svg { transform: rotate(0deg); }
.theme-toggle .att-body { r: 5px; }
.theme-toggle .att-mask-circle { cx: 33px; cy: 0px; }
.theme-toggle .att-rays { opacity: 1; transform: rotate(0deg) scale(1); }

/* Dark = moon */
html[data-theme="dark"] .theme-toggle .att-svg { transform: rotate(270deg); }
html[data-theme="dark"] .theme-toggle .att-body { r: 9px; }
html[data-theme="dark"] .theme-toggle .att-mask-circle { cx: 17px; cy: 8px; }
html[data-theme="dark"] .theme-toggle .att-rays { opacity: 0; transform: rotate(-30deg) scale(0); }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle .att-svg,
  .theme-toggle .att-body,
  .theme-toggle .att-mask-circle,
  .theme-toggle .att-rays { transition: none; }
}

.site-footer {
  background: var(--color-background-dark);
  color: var(--color-muted-dark);
  padding: 44px 0;
  font-size: 14px;
  border-top: 1px solid var(--color-hairline-dark);
}
.site-footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.site-footer p { color: var(--color-muted-dark); margin: 0; }
.site-footer a { color: var(--color-muted-dark); transition: color var(--transition); }
.site-footer a:hover { color: var(--color-accent-dark); }
.footer-social { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }

/* ==========================================================================
   5. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), opacity var(--transition);
}
.btn:hover { transform: translateY(-2px); opacity: 0.92; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ink);
}
.section-ink .btn-outline { color: var(--color-ink-dark); border-color: var(--color-hairline-dark); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: transparent; transform: translateY(-2px); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 8px; }

/* text link with arrow, e.g. "Case study →" */
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent);
  transition: gap var(--transition);
}
.link-arrow svg { width: 15px; height: 15px; transition: transform var(--transition); }
.link-arrow:hover { gap: 12px; }

/* ==========================================================================
   6. HERO BANNER — animated typing headline (Introduction)
   Theme-aware: colours follow the Background/Ink/Muted/Accent tokens, so the
   banner adapts to light and dark mode. Roboto throughout, no italics.
   ========================================================================== */
.hero-banner {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  align-items: center;
  height: 100vh;
  padding: 120px 0 100px;
  font-family: var(--font-serif); /* all hero text uses Cormorant */
}
/* Looping background video (muted, autoplay). Sits behind the scrim + content.
   The solid --bg above is the fallback if the video is blocked or hidden. */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 1;
  pointer-events: none;
  transition: opacity 600ms linear; /* cross-dissolve for the seamless loop */
  /* Fade the video into the page background at top + bottom so the banner has
     no hard edge / visible separator with the header above or Work below. */
  /*-webkit-mask-image: linear-gradient(180deg, transparent 0%, #fff 24%, #fff 75%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #fff 24%, #fff 75%, transparent 100%);*/
}
/* Theme-aware contrast scrim. Flat (no gradient) uniform tint, tuned so the
   hero body/headline text (--ink) keeps WCAG AA (>=4.5:1) even over a
   worst-case bright (dark mode) or dark (light mode) video frame. */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(22, 18, 14, 0.78);
  /* Fade with the video so the whole overlay stack dissolves into --bg. */
  /*-webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);*/
}
html[data-theme="light"] .hero-scrim {
  background: rgba(250, 247, 242, 0.74);
}
/* Keep hero content above the video + scrim. */
.hero-banner > .container { position: relative; z-index: 2; }

/* ---- Decorative memphis-style shapes (X / circle / square / dot clusters) ---
   Sit above the scrim (so they read) but below the text (z-index 2). Float
   gently and parallax to the mouse via inc/hero-decor.js. */
.hero-decor {
  position: absolute;
  inset: 0;
  z-index: 1;            /* == scrim; later in DOM so it paints on top of it */
  pointer-events: none;
  overflow: hidden;
}
.decor-item {
  position: absolute;
  top: 0;
  left: 0;
  /* Hidden until inc/hero-decor.js has measured the real content box and
     placed shapes clear of it — avoids a flash at the unpositioned (0,0)
     corner before that first measurement runs. */
  visibility: hidden;
  /* --x/--y: JS-computed rest position, already guaranteed clear of the
     hero content. --px/--py: live parallax + cursor-proximity offset,
     clamped by JS so it can never move a shape back over the content. */
  transform: translate3d(calc(var(--x, 0px) + var(--px, 0px)), calc(var(--y, 0px) + var(--py, 0px)), 0);
  transition: transform 260ms cubic-bezier(.2, .7, .2, 1);
  will-change: transform;
}
.hero-decor.is-placed .decor-item { visibility: visible; }
.decor-item svg { display: block; width: 100%; height: auto; }
.decor-item.is-accent { color: var(--accent); opacity: 0.85; }
.decor-item.is-ink    { color: var(--ink);    opacity: 0.5; }
.decor-item.is-muted  { color: var(--muted);  opacity: 0.55; }

/* Inner wrapper carries the idle float so it composes with the parallax.
   All shapes drift in the SAME direction (up-right); only the timing varies,
   so the motion reads as one cohesive movement rather than scattered. */
.decor-float { display: block; will-change: transform; }
.decor-float--1 { animation: decor-drift 13s ease-in-out infinite; }
.decor-float--2 { animation: decor-drift 17s ease-in-out infinite; }
.decor-float--3 { animation: decor-drift 21s ease-in-out infinite; }
@keyframes decor-drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(9px, -16px); }
}

/* Constant rotation for the corner X shapes. Applied to the inner <svg> so it
   composes with the parent's idle float (translate) and the parallax translate
   on .decor-item. Top-left spins clockwise, bottom-right counter-clockwise. */
.decor-item.is-spin .decor-float svg { transform-origin: 50% 50%; }
.decor-item.spin-cw  .decor-float svg { animation: decor-spin-cw 16s linear infinite; }
.decor-item.spin-ccw .decor-float svg { animation: decor-spin-ccw 20s linear infinite; }
@keyframes decor-spin-cw  { to { transform: rotate(360deg); } }
@keyframes decor-spin-ccw { to { transform: rotate(-360deg); } }

/* The scattered shapes rely on the wide two-column negative space to stay
   clear of the copy; below the desktop layout they'd crowd the text, so hide
   the whole decorative layer there. */
@media (max-width: 1024px) {
  .hero-decor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .decor-float { animation: none; }
  .decor-item .decor-float svg { animation: none; }
  .decor-item { transition: none; }
}
/* Subtle legibility shadow (perceptual safety margin on top of the AA scrim). */
.hero-headline,
.hero-bio-text { text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35); }
html[data-theme="light"] .hero-headline,
html[data-theme="light"] .hero-bio-text { text-shadow: 0 1px 12px rgba(250, 247, 242, 0.55); }
/* Respect reduced-motion: drop the video, fall back to the solid --bg + scrim. */
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
}
/* Centered portrait + name, sits above the headline/bio row. */
.hero-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 0 auto 48px;
  text-align: center;
}
.hero-portrait-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(1);
  border: 1px solid var(--hairline);
}
.hero-portrait-name {
  margin: 0;
  font-family: var(--font-family);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}
html[data-theme="light"] .hero-portrait-name { text-shadow: 0 1px 12px rgba(250, 247, 242, 0.55); }
.hero-portrait-name strong { font-weight: 700; }

.hero-banner-inner { display: inline-flex; gap: 40px; }
.hero-headline {
  margin: 0;
  text-align: left;
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 600;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex; flex-direction: column; align-items: flex-start;
}
/* .hero-im / .hero-role sized at 48px — equivalents (16px root):
   48px = 3rem = 300% = 36pt = 3pc = 0.5in. rem is used so it stays responsive. */
.hero-headline .hero-im { font-family: var(--font-serif); font-style: normal; font-weight: 600; font-size: 3rem; /* 48px */ color: var(--muted); }
.hero-typed-line { display: inline-flex; align-items: baseline; justify-content: flex-start; white-space: nowrap; min-height: 1.05em; }
.hero-typed-word { color: var(--ink); }
.hero-caret {
  display: inline-block; width: 0.07em; height: 0.82em; margin-left: 0.06em;
  border-radius: 2px; background: var(--accent); vertical-align: -0.08em;
  animation: hero-caret-blink 1s steps(1) infinite;
}
@keyframes hero-caret-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.hero-headline .hero-role { font-size: 3rem; /* 48px = 300% = 36pt = 3pc = 0.5in */ color: var(--accent); }

.hero-bio { max-width: 720px; font-family: var(--font-family); }
.hero-bio .eyebrow { color: var(--muted); }
.hero-bio-text { margin: 0 0 20px; font-family: var(--font-family); font-style: normal; font-size: var(--fs-body-lg); line-height: 1.6; color: var(--ink); }
.hero-previously { margin: 0; font-size: var(--fs-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.hero-previously span { color: var(--accent); }

@media (min-width: 810px) {
  /* Flipped columns: headline first (left), bio second (right). */
  .hero-banner-inner { grid-template-columns: 1fr 1fr; align-items: center; gap: 56px; }
  .hero-headline { order: -1; }
  .hero-bio { text-align: left; }
}
@media (max-width: 640px) {
  /* Below this width the stacked content (portrait + 3-line headline + bio)
     is routinely taller than 100vh. A fixed height + overflow:hidden with
     vertical centering was cropping the top of the portrait photo and the
     bottom of the bio equally — let the section grow to fit its content
     instead of clipping it. */
  .hero-banner {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 72px 0 60px;
  }
  .hero-banner-inner{display: inline-grid;}

  /* 3 stacked lines: "I'm" / animated word / "Designer" — centered. */
  .hero-headline {
    align-items: center;
    text-align: center;
  }
}

/* ==========================================================================
   7. SELECTED WORK — post grid (kept in grid style)
   ========================================================================== */
.work-section { padding-top: 96px; }
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 56px 40px;
}
@media (max-width: 780px) { .post-grid { grid-template-columns: 1fr; gap: 44px; } }

.post-card {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms cubic-bezier(.2,.7,.2,1), transform 700ms cubic-bezier(.2,.7,.2,1);
}
.post-card.is-visible { opacity: 1; transform: translateY(0); }
.post-card-media {
  border-radius: var(--radius);
  /* Featured images are 4:3. `contain` (not `cover`) means an image of any
     other ratio is shown whole rather than sliced; 4:3 ones fill the frame. */
  aspect-ratio: 4 / 3;
  margin-bottom: 22px;
  position: relative;
}
.post-card-media img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform 600ms cubic-bezier(.2,.7,.2,1);
}
.post-card:hover .post-card-media img { transform: scale(1.04); }
.post-card-media .lock-badge {
  position: absolute; top: 14px; right: 14px;
  background: rgba(22,18,14,0.72);
  color: #fff; font-size: 11px; font-weight: 500;
  padding: 6px 10px; border-radius: 999px;
  display: flex; align-items: center; gap: 6px;
  backdrop-filter: blur(4px);
}
.post-card-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.post-card-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.post-card h3 { font-family: var(--font-serif); font-weight: 500; font-size: 30px; line-height: 1.15; letter-spacing: 0; margin-bottom: 12px; transition: color var(--transition); }
.post-card:hover h3 { color: var(--accent); }
.post-card .excerpt { font-size: 15px; margin-bottom: 18px; color: var(--muted); }
.post-card .link-arrow { font-size: 13px; }
.no-posts { text-align: center; padding: 80px 0; color: var(--muted); }

/* generic scroll-reveal utility */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms cubic-bezier(.2,.7,.2,1), transform 700ms cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
/* Optional stagger for a group of .reveal siblings that should cascade in
   one after another (e.g. the hero's portrait -> headline -> bio). */
.reveal-d1 { transition-delay: 90ms; }
.reveal-d2 { transition-delay: 200ms; }
.reveal-d3 { transition-delay: 320ms; }

/* ==========================================================================
   8. ABOUT
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
@media (min-width: 860px) {
  .about-grid { grid-template-columns: 0.9fr 1.1fr; gap: 64px; }
}
.about-grid > h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 400; line-height: 1.12; margin: 0; }
.about-body p { font-size: var(--fs-body-lg); line-height: 1.7; color: var(--muted); }
.about-body p:last-of-type { margin-bottom: 0; }
.about-education { margin-top: 40px; }
.about-education .section-label { margin-bottom: 20px; }
.about-education ul { list-style: none; padding: 0; margin: 0; }
.about-education li {
  padding: 16px 0;
  border-top: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}
.about-education li span { display: block; color: var(--muted); font-weight: 400; font-size: 14px; margin-top: 4px; }

/* ==========================================================================
   9. EXPERIENCE / RESUME
   ========================================================================== */
.resume-list { display: flex; flex-direction: column; }
.resume-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 40px;
  padding: 32px 0;
  border-top: 1px solid var(--hairline);
}
.resume-item:last-child { border-bottom: 1px solid var(--hairline); }
@media (min-width: 760px) {
  .resume-item { grid-template-columns: 200px 1fr; gap: 12px 48px; }
}
.resume-period { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; color: var(--accent); padding-top: 4px; }
.resume-role { font-family: var(--font-serif); font-weight: 500; font-size: 28px; line-height: 1.2; margin: 0 0 6px; color: var(--ink); }
.resume-company { font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 14px; }
.resume-company span { color: var(--muted); font-weight: 400; }
.resume-desc { font-size: 15px; line-height: 1.7; color: var(--muted); margin: 0; max-width: 640px; }

/* ==========================================================================
   10. CONTACT (one-page section)
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 48px; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; } }
.contact-lead h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 400; line-height: 1.12; margin: 0 0 20px; }
.contact-lead .fs-body-lg { color: var(--muted); margin-bottom: 28px; }
.contact-email {
  display: inline-block;
  font-size: 18px; font-weight: 500; color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 3px;
  transition: color var(--transition);
}
.contact-email:hover { color: var(--accent); }

/* ==========================================================================
   11. SINGLE CASE STUDY
   ========================================================================== */

.tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; padding: 32px 0; border-top: 1px solid var(--hairline); }
.tools-row .label { margin: 0; }
.tools-row ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 24px; flex-wrap: wrap; }
.tools-row li { font-size: 14px; font-weight: 500; color: var(--ink); margin: 0; }

.step-block { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: start; }
@media (max-width: 780px) { .step-block { grid-template-columns: 1fr; gap: 28px; } }
.step-block img { border-radius: var(--radius); }

.case-body img { border-radius: var(--radius); margin: 8px 0 24px; }
.case-body figure { margin: 0 0 24px; }
.case-body figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
@media (max-width: 640px) { .stats-grid { grid-template-columns: 1fr; } }
.stat-box { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 28px 20px; text-align: center; }
.stat-box .stat-number { font-size: 44px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; color: var(--ink); }
.stat-box .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.post-nav { display: flex; justify-content: space-between; align-items: center; padding: 32px 0; border-top: 1px solid var(--hairline); margin-top: 40px; }
.post-nav a { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.post-nav .nav-arrow { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hairline); display: flex; align-items: center; justify-content: center; transition: border-color var(--transition); }
.post-nav a:hover .nav-arrow { border-color: var(--accent); }

.post-password-form { max-width: 420px; padding: 60px 0; }
.post-password-form p { margin-bottom: 14px; }
.post-password-form input[type="password"] {
  width: 100%; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink);
  font-family: var(--font-family); font-size: 15px; margin-bottom: 14px;
}
.post-password-form input[type="submit"] {
  padding: 13px 22px; border-radius: 999px; border: none;
  background: var(--accent); color: #fff; font-weight: 500; cursor: pointer;
}
.post-password-form input[type="submit"]:hover { opacity: 0.92; }

/* ==========================================================================
   12. BLOCK PATTERNS (author-facing section styles)
   ========================================================================== */
.wp-block-group.section-dark-block {
  background: var(--color-background-dark);
  color: var(--color-ink-dark);
  padding: 56px 40px;
  border-radius: var(--radius);
}
.wp-block-group.section-dark-block h2,
.wp-block-group.section-dark-block h3 { color: var(--color-ink-dark); }
.wp-block-group.section-dark-block p { color: var(--color-muted-dark); }
.wp-block-group.section-light-block {
  background: var(--surface);
  padding: 56px 40px;
  border-radius: var(--radius);
}

/* ==========================================================================
   13. CONTACT FORM
   ========================================================================== */
.contact-form { max-width: 560px; }
.form-row { margin-bottom: 20px; }
.form-row label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 10px; color: var(--muted);
}
.form-row input, .form-row textarea {
  width: 100%; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--hairline); background: var(--surface);
  font-family: var(--font-family); font-size: 15px; color: var(--ink);
  transition: border-color var(--transition), background var(--transition);
}
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); }
.form-row textarea { min-height: 140px; resize: vertical; }
.form-honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 16px; font-size: 14px; }
.form-status.success { color: #3aa06b; }
.form-status.error { color: var(--accent); }
.form-submit[disabled] { opacity: 0.6; cursor: not-allowed; }

/* Focus visibility (accessibility) */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   14. PASSWORD MODAL (locked posts on the grid)
   ========================================================================== */
.post-card[data-locked] { cursor: pointer; }

.sp-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.sp-modal[hidden] { display: none; }
.sp-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 4, 0.6);
  backdrop-filter: blur(4px);
  animation: sp-fade-in 240ms ease;
}
.sp-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: calc(var(--radius) + 6px);
  padding: 40px 36px 36px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  animation: sp-modal-in 320ms cubic-bezier(.2,.7,.2,1);
}
.sp-modal-dialog .eyebrow { color: var(--accent); margin-bottom: 12px; }
.sp-modal-dialog h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 12px;
}
.sp-modal-desc { font-size: 15px; color: var(--muted); margin: 0 0 24px; }
.sp-modal-desc strong { color: var(--ink); font-weight: 600; }
.sp-modal-form .form-row { margin-bottom: 18px; }
.sp-modal-submit { width: 100%; justify-content: center; }
.sp-modal-status { min-height: 20px; }
.sp-modal-status.error { color: var(--accent); }
.sp-modal-status.success { color: #3aa06b; }
.sp-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 34px; height: 34px;
  border: none; background: transparent;
  color: var(--muted);
  font-size: 26px; line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: color var(--transition), background var(--transition);
}
.sp-modal-close:hover { color: var(--ink); background: var(--surface); }

@keyframes sp-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .sp-modal-backdrop, .sp-modal-dialog { animation: none; }
}

/* ==========================================================================
   15. ELEMENTOR CONTENT — let Elementor's own colours win
   The theme gives bare <p>, <ul>/<ol> and headings a default colour (--muted /
   --ink). A colour set directly on an element always beats one it merely
   inherits, and Elementor's "Text Color" control sets the colour on the widget
   wrapper — so the picker had no visible effect. Inside Elementor, hand the
   colour back to `inherit` so whatever Elementor sets is what shows.
   ========================================================================== */
.elementor p,
.elementor ul,
.elementor ol,
.elementor li,
.elementor-widget-text-editor h1,
.elementor-widget-text-editor h2,
.elementor-widget-text-editor h3,
.elementor-widget-text-editor h4,
.elementor-widget-text-editor h5,
.elementor-widget-text-editor h6 { color: inherit; }

/* Optional theme-aware colours. In Elementor, open the widget → Advanced →
   CSS Classes and add one of these; the text then follows light/dark mode
   automatically instead of staying one fixed colour. */
.sp-text-ink,    .sp-text-ink *    { color: var(--ink) !important; }
.sp-text-muted,  .sp-text-muted *  { color: var(--muted) !important; }
.sp-text-accent, .sp-text-accent * { color: var(--accent) !important; }

/* ==========================================================================
   16. ELEMENTOR — BRAND FONTS
   Elementor pages carry their own typography (kit fonts, per-widget fonts,
   and hard-coded inline fonts like Tahoma/Calibri). While the body has
   .sp-elementor-fonts (Customize → Theme — Mode & Colours, on by default),
   everything in .elementor uses Roboto and headings use Cormorant.
   Icon fonts (i, .eicon, .fa*) and code are left alone.
   ========================================================================== */
body.sp-elementor-fonts[class*="elementor-kit-"] {
  --e-global-typography-primary-font-family:   'Cormorant', Georgia, serif;
  --e-global-typography-secondary-font-family: 'Roboto', sans-serif;
  --e-global-typography-text-font-family:      'Roboto', sans-serif;
  --e-global-typography-accent-font-family:    'Roboto', sans-serif;
}

/* Body text: :where() keeps this at zero extra specificity so headings win. */
body.sp-elementor-fonts .elementor :where(*:not(i):not([class*="eicon"]):not([class*="fa-"]):not(code):not(pre):not(kbd)) {
  font-family: var(--font-family) !important;
}

/* Headings and everything inside them; text that Elementor styled with its
   "primary" font (heading-style spans in text widgets) stays serif too. */
body.sp-elementor-fonts .elementor h1,
body.sp-elementor-fonts .elementor h2,
body.sp-elementor-fonts .elementor h3,
body.sp-elementor-fonts .elementor h4,
body.sp-elementor-fonts .elementor h5,
body.sp-elementor-fonts .elementor h6,
body.sp-elementor-fonts .elementor h1 *,
body.sp-elementor-fonts .elementor h2 *,
body.sp-elementor-fonts .elementor h3 *,
body.sp-elementor-fonts .elementor h4 *,
body.sp-elementor-fonts .elementor h5 *,
body.sp-elementor-fonts .elementor h6 *,
body.sp-elementor-fonts .elementor .elementor-heading-title,
body.sp-elementor-fonts .elementor [style*="--e-global-typography-primary-font-family"] {
  font-family: var(--font-serif) !important;
}
