/* ───────────────────────────────────────────────────────────
   Michal Yoffe — graphic design portfolio
   Aesthetic: warm editorial gallery. Cream paper, charcoal
   ink, coral accent, Frank Ruhl Libre italic for accents.
   ─────────────────────────────────────────────────────────── */

:root {
  /* palette */
  --paper:        #F5F1EA;
  --paper-2:      #EFE9DD;
  --paper-3:      #E6DECC;
  --ink:          #1A1815;
  --ink-soft:     #2E2A24;
  --muted:        #7A6F5C;
  --muted-2:      #9C8F76;
  --coral:        #E8634A;
  --coral-deep:   #C24A33;
  --coral-soft:   #F5C2B5;
  --bronze:       #B89968;
  --line:         rgba(26, 24, 21, 0.14);
  --line-soft:    rgba(26, 24, 21, 0.07);

  /* typography */
  --serif:    "Frank Ruhl Libre", "Cormorant Garamond", "Times New Roman", serif;
  --display:  "Cormorant Garamond", "Frank Ruhl Libre", Georgia, serif;
  --sans:     "Heebo", "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:     "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* rhythm */
  --r-1: 8px;
  --r-2: 16px;
  --r-3: 24px;
  --r-4: 40px;
  --r-5: 64px;
  --r-6: 96px;
  --r-7: 140px;

  --max:      1320px;
  --max-text: 720px;

  --radius-sm: 6px;
  --radius:    14px;
  --radius-lg: 24px;
}

/* ─── reset + base ─────────────────────────────────────── */

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

html, body {
  min-height: 100%;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  margin: 0;
  padding: 0;
}
@supports (overflow-x: clip) {
  html, body { overflow-x: clip; }
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-weight: 400;
  position: relative;
  transform: translateZ(0);
  /* paper grain */
  background-image:
    radial-gradient(circle at 20% 10%, rgba(184, 153, 104, 0.06) 0, transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(232, 99, 74, 0.04) 0, transparent 40%),
    var(--paper);
}

img, svg, video { display: block; max-width: 100%; height: auto; }
img { color: transparent; }

a { color: inherit; text-decoration: none; transition: color .25s ease, opacity .25s ease; }
a:hover { color: var(--coral-deep); }

button { font: inherit; cursor: pointer; }

h1, h2, h3, h4, h5, h6, p { margin: 0; overflow-wrap: anywhere; }

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

/* ─── layout primitives ────────────────────────────────── */

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--r-3); }
.wrap-narrow { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 var(--r-3); }
.wrap-text   { width: 100%; max-width: var(--max-text); margin: 0 auto; padding: 0 var(--r-3); }

.section { padding: var(--r-6) 0; position: relative; }
.section-sm { padding: var(--r-5) 0; }

@media (max-width: 720px) {
  .section { padding: var(--r-5) 0; }
  .section-sm { padding: var(--r-4) 0; }
}

/* ─── editorial type ───────────────────────────────────── */

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.eyebrow-coral { color: var(--coral-deep); }

.display-xxl {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(54px, 9.5vw, 148px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.display-xl {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 6.5vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.display-lg {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 4.5vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.display-md {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.15;
}

.accent-italic {
  font-style: italic;
  font-family: var(--display);
  font-weight: 400;
  color: var(--coral-deep);
}

.lead {
  font-family: var(--sans);
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.55;
  color: var(--ink-soft);
  font-weight: 400;
}

.muted { color: var(--muted); }

.body-text p { margin-bottom: 1em; line-height: 1.65; color: var(--ink-soft); }
.body-text p:last-child { margin-bottom: 0; }
.body-text strong { color: var(--ink); font-weight: 600; }
.body-text h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.2;
  margin: 2em 0 0.6em;
  color: var(--ink);
}
.body-text h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  margin: 1.5em 0 0.4em;
  color: var(--ink);
}
.body-text ul, .body-text ol { padding-inline-start: 1.4em; margin: 0.6em 0 1em; }
.body-text li { margin-bottom: 0.4em; line-height: 1.6; color: var(--ink-soft); }
.body-text li::marker { color: var(--coral); }

/* ─── topbar ───────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 241, 234, 0.85);
  backdrop-filter: saturate(120%) blur(14px);
  -webkit-backdrop-filter: saturate(120%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
  overflow-x: clip;
  max-width: 100%;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: var(--r-3);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand .brand-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--coral);
  border-radius: 50%;
  transform: translateY(-2px);
}
.brand i {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 15px;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--r-3);
}
.nav a {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}
.nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 -2px 0;
  height: 1px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s cubic-bezier(.6,.2,.2,1);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--coral-deep); }

.nav a.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background .25s ease, transform .25s ease, color .25s ease;
}
.nav a.nav-cta::after { display: none; }
.nav a.nav-cta:hover { background: var(--coral-deep); color: var(--paper); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  width: 44px; height: 44px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

@media (max-width: 820px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.open {
    display: flex;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 49;
    flex-direction: column;
    align-items: stretch;
    padding: var(--r-3);
    gap: 4px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 40px rgba(26, 24, 21, 0.12);
    animation: nav-drop .25s cubic-bezier(.2,.7,.2,1);
  }
  .nav.open a { padding: 12px 0; font-size: 18px; border-bottom: 1px solid var(--line-soft); }
  .nav.open a:last-child { border-bottom: none; }
  .nav a.nav-cta { justify-content: center; margin-top: 12px; padding: 14px 18px; font-size: 14px; }
  body.nav-locked { overflow: hidden; }
}
@keyframes nav-drop {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── HOMEPAGE: hero ───────────────────────────────────── */

.hero {
  padding: var(--r-5) 0 var(--r-6);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: var(--r-5);
  align-items: center;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: var(--r-3);
}

.hero-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-meta-row .dot {
  width: 6px; height: 6px;
  background: var(--coral);
  border-radius: 50%;
}

.hero h1.display-xxl {
  margin: 12px 0 var(--r-3);
}
.hero h1 .line { display: block; }
.hero h1 .stamp {
  display: inline-block;
  border: 1.5px solid var(--ink);
  padding: 4px 16px 7px;
  border-radius: 100px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.62em;
  color: var(--ink);
  vertical-align: middle;
  margin: 0 4px;
  transform: translateY(-0.05em);
}

.hero-blurb {
  max-width: 540px;
  margin-bottom: var(--r-4);
}

.hero-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1.5px solid transparent;
  transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}
.btn-primary { background: var(--coral); color: var(--paper); }
.btn-primary:hover { background: var(--coral-deep); color: var(--paper); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn .arr { font-family: var(--display); font-style: italic; font-size: 18px; }

.hero-portrait-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-portrait {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 887/786;
  display: block;
}
.hero-portrait img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 30px 60px rgba(26, 24, 21, 0.12));
}
.hero-portrait::before {
  content: "";
  position: absolute;
  inset: 8% 6% 8% 6%;
  background: radial-gradient(ellipse at center, rgba(232, 99, 74, 0.16), transparent 70%);
  z-index: 1;
  border-radius: 50%;
  filter: blur(20px);
}
.hero-portrait::after {
  content: "";
  position: absolute;
  inset: -4% 8% 12% -4%;
  border: 1.5px solid var(--coral);
  border-radius: 50% 40% 55% 45%;
  opacity: 0.4;
  z-index: 0;
  animation: gentle-rotate 24s linear infinite;
}

@keyframes gentle-rotate {
  to { transform: rotate(360deg); }
}

.hero-tag {
  position: absolute;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  z-index: 3;
  box-shadow: 0 8px 24px rgba(26, 24, 21, 0.06);
}
.hero-tag::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--coral);
  border-radius: 50%;
  margin-inline-end: 8px;
  transform: translateY(-1px);
  vertical-align: middle;
}
.hero-tag.tag-1 { top: 6%;   left: -4%; }
.hero-tag.tag-2 { bottom: 14%; right: -8%; }
.hero-tag.tag-3 { top: 42%; right: -2%; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--r-4); }
  .hero-portrait-wrap { order: -1; }
  .hero-portrait { max-width: 360px; }
  .hero-tag.tag-1 { left: 2%; top: -4%; }
  .hero-tag.tag-2 { right: 2%; bottom: 4%; }
  .hero-tag.tag-3 { display: none; }
}

/* marquee divider */

.marquee-divider {
  border-block: 1px solid var(--line);
  background: var(--paper);
  padding: 22px 0;
  overflow: hidden;
}
.marquee-track {
  display: flex;
  gap: 64px;
  white-space: nowrap;
  animation: marquee 38s linear infinite;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(22px, 3.4vw, 44px);
  color: var(--ink);
}
.marquee-track .star { color: var(--coral); font-style: normal; font-family: var(--sans); }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── section header (editorial) ───────────────────────── */

.sec-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--r-4);
  align-items: end;
  margin-bottom: var(--r-5);
  padding-block: var(--r-3);
  border-top: 1px solid var(--line);
}
.sec-head .sec-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.sec-head .sec-aside {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 460px;
  justify-self: end;
  text-align: start;
}
@media (max-width: 820px) {
  .sec-head { grid-template-columns: 1fr; gap: var(--r-2); }
  .sec-head .sec-aside { justify-self: start; }
}

/* ─── project grid (home + projects index) ─────────────── */

.proj-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--r-3) var(--r-3);
}

.proj-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-2);
  transition: transform .5s cubic-bezier(.6,.2,.2,1), box-shadow .5s ease;
  text-decoration: none;
  color: inherit;
}
.proj-card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -20px rgba(26, 24, 21, 0.18); color: inherit; }

.proj-card .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--paper-3);
}
.proj-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.proj-card:hover .thumb img { transform: scale(1.04); }

.proj-card .meta {
  position: absolute;
  inset: 16px 16px auto auto;
  background: var(--paper);
  padding: 6px 12px;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  z-index: 2;
}

.proj-card .body {
  padding: 22px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.proj-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.proj-card h3 i {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  color: var(--coral-deep);
}
.proj-card .sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.proj-card .ar {
  font-family: var(--display);
  font-style: italic;
  color: var(--coral-deep);
  font-size: 20px;
  margin-inline-start: 6px;
  transition: transform .35s ease;
  display: inline-block;
}
.proj-card:hover .ar { transform: translateX(6px); }

/* asymmetric layout — home */

.proj-grid .pc-1 { grid-column: span 7; }
.proj-grid .pc-2 { grid-column: span 5; }
.proj-grid .pc-3 { grid-column: span 5; }
.proj-grid .pc-4 { grid-column: span 7; }

/* uniform layout — projects index */

.proj-grid.uniform .proj-card { grid-column: span 6; }
.proj-grid.uniform .proj-card .thumb { aspect-ratio: 4/3; }

@media (max-width: 820px) {
  .proj-grid .pc-1, .proj-grid .pc-2, .proj-grid .pc-3, .proj-grid .pc-4,
  .proj-grid.uniform .proj-card { grid-column: span 12; }
}

/* ─── about preview band ───────────────────────────────── */

.about-band {
  background: var(--paper-2);
  border-radius: var(--radius-lg);
  padding: var(--r-5);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--r-4);
  align-items: center;
}
.about-band .lead { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.4; font-family: var(--serif); font-weight: 500; color: var(--ink); }
.about-band .lead em { font-family: var(--display); font-style: italic; color: var(--coral-deep); font-weight: 400; }
.about-band .skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink-soft);
  background: var(--paper);
  transition: all .25s ease;
}
.skill-chip:hover { border-color: var(--coral); color: var(--coral-deep); }
@media (max-width: 820px) {
  .about-band { grid-template-columns: 1fr; padding: var(--r-4); }
}

/* ─── contact CTA ──────────────────────────────────────── */

.cta-band {
  text-align: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-lg);
  padding: var(--r-6) var(--r-4);
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 60vw; height: 60vw; max-width: 700px; max-height: 700px;
  background: radial-gradient(circle, rgba(232, 99, 74, 0.4), transparent 65%);
  filter: blur(40px);
}
.cta-band h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(38px, 6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: var(--r-3);
  position: relative;
}
.cta-band h2 em {
  font-family: var(--display);
  font-style: italic;
  color: var(--coral-soft);
  font-weight: 400;
}
.cta-band p {
  max-width: 560px;
  margin: 0 auto var(--r-4);
  color: rgba(245, 241, 234, 0.7);
  font-size: 17px;
  position: relative;
}
.cta-band .btn-primary { background: var(--coral); color: var(--paper); border-color: var(--coral); }
.cta-band .btn-ghost { color: var(--paper); border-color: var(--paper); }
.cta-band .btn-ghost:hover { background: var(--paper); color: var(--ink); }
.cta-band .btns { display: inline-flex; flex-wrap: wrap; gap: 12px; justify-content: center; position: relative; }

/* ─── footer ───────────────────────────────────────────── */

.foot {
  padding: var(--r-5) 0 var(--r-3);
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--r-4);
  margin-bottom: var(--r-4);
}
.foot h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  font-weight: 500;
}
.foot p { color: var(--ink-soft); line-height: 1.7; font-size: 15px; }
.foot a.foot-link { display: block; color: var(--ink-soft); padding: 6px 0; font-size: 15px; }
.foot a.foot-link:hover { color: var(--coral-deep); }
.foot a.foot-link .arr { font-family: var(--display); font-style: italic; color: var(--coral); margin-inline-end: 6px; }

.foot-bottom {
  border-top: 1px solid var(--line);
  padding-top: var(--r-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--r-2);
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.foot-mega {
  font-family: var(--serif);
  font-weight: 500;
  font-style: normal;
  font-size: clamp(80px, 18vw, 280px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin: var(--r-3) 0 0;
  text-transform: none;
  background: linear-gradient(180deg, var(--ink) 0%, rgba(26, 24, 21, 0.06) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.foot-mega i {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  -webkit-text-fill-color: var(--coral-deep);
  background: none;
}
@media (max-width: 820px) {
  .foot-grid { grid-template-columns: 1fr; gap: var(--r-3); }
}

/* ─── case study layout ────────────────────────────────── */

.case-hero {
  padding: var(--r-5) 0 var(--r-4);
}
.case-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--r-3);
  margin-bottom: var(--r-3);
  align-items: center;
}
.case-meta-row .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--paper-2);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.case-meta-row .pill .dot { width: 6px; height: 6px; background: var(--coral); border-radius: 50%; }

.case-hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(56px, 10vw, 160px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin-bottom: var(--r-3);
  color: var(--ink);
}
.case-hero h1 i { font-family: var(--display); font-style: italic; color: var(--coral-deep); font-weight: 400; }
.case-hero .case-sub { max-width: 680px; font-size: clamp(18px, 1.5vw, 22px); color: var(--ink-soft); line-height: 1.55; }

.case-cover {
  margin-top: var(--r-4);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
}
.case-cover img { width: 100%; height: auto; display: block; }

.case-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--r-3);
  margin-top: var(--r-4);
  padding: var(--r-3) var(--r-3);
  border-block: 1px solid var(--line);
}
.case-facts .fact h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.case-facts .fact p {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.5;
}
@media (max-width: 820px) {
  .case-facts { grid-template-columns: repeat(2, 1fr); }
}

.case-body {
  padding-block: var(--r-5);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--r-5);
  align-items: start;
}
.case-body .ix-side {
  position: sticky;
  top: 100px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.case-body .ix-side a {
  display: block;
  padding: 10px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}
.case-body .ix-side a:hover { color: var(--coral-deep); }

.case-body .ix-side .ix-num {
  font-family: var(--display);
  font-style: italic;
  color: var(--coral);
  font-size: 14px;
  margin-inline-end: 10px;
  letter-spacing: 0;
}

.case-section {
  padding-block: var(--r-3) var(--r-4);
  border-bottom: 1px solid var(--line-soft);
  scroll-margin-top: 100px;
}
.case-section:last-child { border: none; }
.case-section .case-num {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: var(--coral-deep);
  letter-spacing: 0;
  display: block;
  margin-bottom: 4px;
}
.case-section h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: var(--r-2);
  color: var(--ink);
}
.case-section .body-text p,
.case-section .body-text li { font-size: 17px; line-height: 1.7; }
.case-section .body-text { max-width: 680px; }

.case-pullquote {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.35;
  color: var(--ink);
  padding: var(--r-3) var(--r-4);
  border-inline-start: 3px solid var(--coral);
  background: var(--paper-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: var(--r-3) 0;
}
[dir="rtl"] .case-pullquote { border-inline-start: 3px solid var(--coral); }

.case-gallery {
  display: grid;
  gap: var(--r-3);
  margin-top: var(--r-3);
}
.case-gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
.case-gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
.case-gallery.cols-4 { grid-template-columns: repeat(4, 1fr); }
.case-gallery img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: var(--paper-2);
}
@media (max-width: 720px) {
  .case-gallery.cols-2, .case-gallery.cols-3, .case-gallery.cols-4 { grid-template-columns: 1fr; }
  .case-body { grid-template-columns: 1fr; }
  .case-body .ix-side { position: static; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: var(--r-2); }
  .case-body .ix-side a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 100px; }
}

.case-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--r-3);
  padding-block: var(--r-5);
  border-top: 1px solid var(--line);
}
.case-next a {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--r-3);
  background: var(--paper-2);
  border-radius: var(--radius-lg);
  transition: transform .35s ease, background .35s ease;
}
.case-next a:hover { transform: translateY(-4px); background: var(--paper-3); color: inherit; }
.case-next .nx-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-next .nx-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(24px, 2.4vw, 36px);
  line-height: 1.1;
}
.case-next .nx-title i { font-family: var(--display); font-style: italic; color: var(--coral-deep); }
@media (max-width: 720px) { .case-next { grid-template-columns: 1fr; } }

/* ─── about page ───────────────────────────────────────── */

.about-hero {
  padding: var(--r-5) 0 var(--r-4);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--r-5);
  align-items: end;
}
.about-hero h1 { margin-bottom: var(--r-2); }
.about-hero .meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.about-portrait img { border-radius: var(--radius-lg); width: 100%; max-width: 420px; }

.about-story {
  padding-block: var(--r-5);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--r-5);
}
.about-story h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
}
.about-story p {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 1em;
}
.about-story p strong { color: var(--ink); font-weight: 600; }
.about-story p em, .about-story p i { font-family: var(--display); font-style: italic; color: var(--coral-deep); }

.about-skills {
  background: var(--paper-2);
  border-radius: var(--radius-lg);
  padding: var(--r-5);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--r-4);
  align-items: start;
}
.about-skills h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 44px);
}
.about-skills .chips { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 820px) {
  .about-hero, .about-story, .about-skills { grid-template-columns: 1fr; gap: var(--r-3); }
}

.about-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--r-3);
  padding: var(--r-4) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-block: var(--r-4);
}
.about-details .item h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.about-details .item p {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  color: var(--ink);
  line-height: 1.3;
}
.about-details .item a { color: inherit; }
.about-details .item a:hover { color: var(--coral-deep); }
@media (max-width: 820px) {
  .about-details { grid-template-columns: 1fr; }
}

/* ─── blog ─────────────────────────────────────────────── */

.blog-hero {
  padding: var(--r-5) 0 var(--r-4);
  text-align: start;
}
.blog-hero h1 { margin-block: var(--r-3) var(--r-2); }
.blog-list { display: grid; grid-template-columns: 1fr; gap: var(--r-3); }
.blog-card {
  display: grid;
  grid-template-columns: 0.4fr 1fr;
  gap: var(--r-3);
  padding: var(--r-3);
  border-block-end: 1px solid var(--line);
  transition: background .25s ease;
}
.blog-card:hover { background: var(--paper-2); color: inherit; }
.blog-card .date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: start;
}
.blog-card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.15;
  margin-bottom: 8px;
  color: var(--ink);
}
.blog-card p { color: var(--ink-soft); line-height: 1.6; max-width: 640px; }
.blog-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coral-deep);
}
@media (max-width: 720px) { .blog-card { grid-template-columns: 1fr; } }

.post-hero { padding: var(--r-5) 0 var(--r-3); }
.post-hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 5.5vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-block: var(--r-3) var(--r-2);
}
.post-hero .meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-body { padding-block: var(--r-3) var(--r-5); }
.post-body p { font-size: 18px; line-height: 1.8; color: var(--ink-soft); margin-bottom: 1.2em; }
.post-body h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.1;
  margin: 1.5em 0 0.5em;
  color: var(--ink);
}
.post-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.2;
  margin: 1.4em 0 0.4em;
  color: var(--ink);
}
.post-body ol, .post-body ul { padding-inline-start: 1.4em; margin: 0.6em 0 1em; }
.post-body li { margin-bottom: 0.6em; font-size: 18px; line-height: 1.7; color: var(--ink-soft); }
.post-body li::marker { color: var(--coral); }

/* ─── 404 ──────────────────────────────────────────────── */
.notfound {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--r-4) var(--r-3);
}
.notfound h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(80px, 18vw, 220px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.04em;
}
.notfound h1 i { font-family: var(--display); font-style: italic; color: var(--coral-deep); }
.notfound p { color: var(--ink-soft); margin: var(--r-2) 0 var(--r-3); }

/* ─── reveal animation (fade-up on scroll) ─────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.d-1 { transition-delay: .08s; }
.reveal.d-2 { transition-delay: .16s; }
.reveal.d-3 { transition-delay: .24s; }
.reveal.d-4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .marquee-track, .hero-portrait::after { animation: none; }
}

/* ─── defensive overflow ───────────────────────────────── */
.topbar, .hero, .marquee-divider, .section, .foot, .cta-band, .about-band,
.about-hero, .about-story, .about-skills, .case-hero, .case-body, .case-next,
.blog-hero, .post-hero, .post-body, .notfound {
  overflow-x: clip; max-width: 100%;
}
h1, h2, h3, h4, p { overflow-wrap: anywhere; }
