/* ============================================================
   TANUSH PRADHAN — PORTFOLIO
   main.css — shared design system, all pages
   Last updated: May 2026
   ============================================================ */

/* ---------- Design Tokens (Light theme — default) ---------- */
:root {
  --bg: #f6f0dc;
  --bg-alt: #ede4c6;
  --ink: #112942;
  --ink-soft: #1d3a5a;
  --muted: #5e7585;
  --muted-soft: #8ca0ad;
  --line: #d8ceaa;
  --line-soft: #e8e0c2;
  --accent: #126767;
  --accent-deep: #0d4f4f;
  --gold: #c79431;
  --gold-soft: #d4a847;
  --yellow: #e6b432;

  /* Surface-specific tokens that flip in dark mode */
  --footer-bg: #112942;
  --footer-fg: #f6f0dc;
  --footer-line: rgba(246, 240, 220, 0.15);
  --footer-muted: rgba(246, 240, 220, 0.55);
  --footer-cta-border: rgba(246, 240, 220, 0.3);
  --nav-bg: rgba(246, 240, 220, 0.78);
  --grain-blend: multiply;
  --grain-opacity: 0.35;

  /* Typography */
  --serif: 'Fraunces', 'Times New Roman', serif;
  --sans: 'Manrope', -apple-system, system-ui, sans-serif;

  /* Layout */
  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 56px);
}

/* ---------- Dark theme ---------- */
:root[data-theme="dark"] {
  --bg: #0d1f33;
  --bg-alt: #16293f;
  --ink: #f0e8d0;
  --ink-soft: #d6cfb6;
  --muted: #8ca0b0;
  --muted-soft: #6a7d8a;
  --line: #243a52;
  --line-soft: #1a2d44;
  --accent: #2da5a5;
  --accent-deep: #1f8585;
  --gold: #d4a847;
  --gold-soft: #e0b966;
  --yellow: #f0c14a;

  --footer-bg: #060f1c;
  --footer-fg: #f0e8d0;
  --footer-line: rgba(240, 232, 208, 0.12);
  --footer-muted: rgba(240, 232, 208, 0.5);
  --footer-cta-border: rgba(240, 232, 208, 0.25);
  --nav-bg: rgba(13, 31, 51, 0.82);
  --grain-blend: screen;
  --grain-opacity: 0.08;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.5s ease, color 0.5s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  transition: opacity 0.5s ease;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 2;
}

/* ---------- Typography ---------- */
.display {
  font-family: var(--serif);
  font-weight: 350;
  letter-spacing: -0.02em;
  line-height: 0.95;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.display em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 0.04em;
}

/* ---------- Navigation ---------- */
nav.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 22px var(--gutter);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease, padding 0.3s ease, background-color 0.5s ease;
}
nav.site-nav.scrolled {
  border-bottom-color: var(--line);
  padding: 16px var(--gutter);
}
nav.site-nav .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.logo span { color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}
.navlinks {
  display: flex;
  gap: 28px;
  font-size: 14px;
  font-weight: 500;
}
.navlinks a {
  position: relative;
  padding: 4px 0;
  transition: color 0.3s;
}
.navlinks a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.navlinks a:hover,
.navlinks a.active { color: var(--accent); }
.navlinks a:hover::after,
.navlinks a.active::after { right: 0; }

.menu-btn { display: none; font-size: 22px; }

/* Theme toggle */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.4s ease, border-color 0.3s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-toggle .thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
}
:root[data-theme="dark"] .theme-toggle .thumb { transform: translateX(24px); }
.theme-toggle svg {
  width: 12px;
  height: 12px;
  stroke: var(--bg);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }

@media (max-width: 820px) {
  .navlinks { display: none; }
  .menu-btn { display: block; }
  .navlinks.open {
    display: flex;
    position: absolute;
    flex-direction: column;
    top: 100%; left: 0; right: 0;
    background: var(--bg);
    padding: 24px var(--gutter) 32px;
    gap: 20px;
    border-bottom: 1px solid var(--line);
  }
}

/* ---------- Side mark ---------- */
.side-mark {
  position: fixed;
  left: 24px;
  bottom: 32px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted-soft);
  z-index: 10;
  pointer-events: none;
}
@media (max-width: 900px) { .side-mark { display: none; } }

/* ---------- Hero (used on home + page heros) ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
  position: relative;
}
.hero .meta {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 40px;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(230, 180, 50, 0.22);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(230, 180, 50, 0.22); }
  50% { box-shadow: 0 0 0 9px rgba(230, 180, 50, 0.06); }
}
.hero h1 {
  font-size: clamp(56px, 11vw, 168px);
  margin: 0 0 40px -6px;
}
.hero h1 .l1, .hero h1 .l2 {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: rise 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero h1 .l2 { animation-delay: 0.15s; padding-left: clamp(40px, 12vw, 180px); }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.hero .lead {
  max-width: 540px;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--ink-soft);
  margin-left: auto;
  margin-top: 60px;
  opacity: 0;
  animation: rise 1.1s 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero .lead::before {
  content: '— ';
  color: var(--accent);
  font-family: var(--serif);
  font-style: italic;
}
.hero-corner {
  position: absolute;
  top: 140px;
  right: var(--gutter);
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  opacity: 0;
  animation: fadein 1.5s 0.8s forwards;
}
@keyframes fadein { to { opacity: 1; } }
.hero-corner .label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-soft);
  margin-bottom: 4px;
}
@media (max-width: 820px) {
  .hero-corner { position: static; text-align: left; margin-top: 24px; }
}

/* ---------- Page hero (smaller, for inner pages) ---------- */
.page-hero {
  padding: 160px 0 80px;
  border-bottom: 1px solid var(--line);
}
.page-hero .eyebrow { margin-bottom: 24px; display: block; }
.page-hero h1 {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(48px, 9vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}
.page-hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}
.page-hero .lead {
  max-width: 640px;
  font-size: clamp(17px, 1.7vw, 21px);
  color: var(--ink-soft);
  font-weight: 300;
}

/* ---------- Section ---------- */
section.block {
  padding: clamp(80px, 12vw, 160px) 0;
  position: relative;
}
section.block-sm { padding: clamp(60px, 8vw, 100px) 0; }

.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: baseline;
  margin-bottom: 64px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-size: clamp(36px, 6vw, 72px);
  grid-column: 2;
}
.section-head .num { align-self: flex-start; padding-top: 18px; }

/* ---------- About-style two-column ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 7vw, 100px);
  align-items: start;
}
@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; }
}
.portrait {
  aspect-ratio: 4/5;
  background: linear-gradient(135deg, #1a5d6a 0%, #0d2f4a 100%);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.5);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portrait.placeholder::after {
  content: '[ YOUR PHOTO ]';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(246, 240, 220, 0.65);
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0.08em;
}
.long-text p {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 24px;
  font-weight: 300;
}
.long-text p:first-of-type::first-letter {
  font-family: var(--serif);
  font-style: italic;
  font-size: 4em;
  float: left;
  line-height: 0.85;
  padding-right: 12px;
  padding-top: 6px;
  color: var(--accent);
}
.long-text p.no-drop-cap::first-letter {
  font-family: inherit;
  font-style: inherit;
  font-size: inherit;
  float: none;
  padding: 0;
  color: inherit;
}

/* ---------- Stats row ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; gap: 16px; }
}
.stat .n {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  line-height: 1;
  margin-bottom: 8px;
}
.stat .l {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ---------- Experience timeline ---------- */
.timeline { display: flex; flex-direction: column; }
.role {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: clamp(20px, 4vw, 60px);
  padding: 32px 0;
  border-top: 1px solid var(--line);
  align-items: start;
  transition: background 0.3s, padding 0.3s;
}
.role:last-child { border-bottom: 1px solid var(--line); }
.role:hover { padding-left: 16px; padding-right: 16px; background: var(--bg-alt); }
.role .when {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  padding-top: 8px;
}
.role h3 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 8px;
}
.role .company {
  color: var(--accent);
  font-weight: 500;
}
.role p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-top: 12px;
  max-width: 65ch;
}
.role .tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  align-self: start;
  margin-top: 4px;
}
@media (max-width: 820px) {
  .role { grid-template-columns: 1fr; gap: 8px; }
  .role .tag { justify-self: start; }
}

/* ---------- Project cards ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 3vw, 40px);
}
@media (max-width: 760px) { .projects-grid { grid-template-columns: 1fr; } }

.project {
  background: var(--bg-alt);
  padding: clamp(28px, 4vw, 44px);
  border-radius: 4px;
  position: relative;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.project::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, rgba(199, 148, 49, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s;
}
.project:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.35);
}
.project:hover::before { opacity: 1; }
.project > * { position: relative; z-index: 1; }
.project .pn {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.project .pn::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--line);
}
.project h3 {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 14px;
}
.project p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 24px;
  flex: 1;
}
.project .stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.project .stack span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--bg);
  padding: 6px 10px;
  border-radius: 2px;
}
.project .link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  width: fit-content;
  transition: color 0.3s, gap 0.3s;
}
.project .link:hover { color: var(--accent); gap: 12px; }

/* ---------- Achievements ---------- */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
@media (max-width: 760px) { .achievements-grid { grid-template-columns: 1fr; } }
.achievement {
  padding: 36px clamp(0px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  position: relative;
}
.achievement:nth-child(2n) { border-right: none; }
@media (max-width: 760px) {
  .achievement { border-right: none; }
}
.achievement .badge {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  margin-bottom: 20px;
  box-shadow: 0 6px 18px -8px rgba(199, 148, 49, 0.5);
}
.achievement h3 {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 10px;
}
.achievement p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.achievement .year {
  position: absolute;
  top: 36px;
  right: clamp(0px, 3vw, 32px);
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted-soft);
}

/* ---------- Certificates ---------- */
.certs { display: grid; gap: 0; }
.cert {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  transition: color 0.3s, padding 0.4s ease;
}
.cert:last-child { border-bottom: 1px solid var(--line); }
.cert:hover { padding-left: 16px; color: var(--accent); }
.cert .cnum {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 14px;
}
.cert h4 {
  font-family: var(--serif);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 400;
}
.cert h4 .in-progress {
  display: inline-block;
  margin-left: 10px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 9px;
  vertical-align: middle;
  opacity: 0.85;
}
.cert .date {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 14px;
}
@media (max-width: 760px) {
  .cert { grid-template-columns: 40px 1fr; }
  .cert .date { grid-column: 2; font-size: 12px; }
  .cert-logo { grid-column: 2; }
}

/* Brand logos */
.cert-logo {
  height: 26px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  object-position: left center;
  transition: filter 0.4s ease, opacity 0.4s ease;
}
.company-logo {
  height: 22px;
  width: auto;
  max-width: 80px;
  vertical-align: middle;
  margin-left: 12px;
  display: inline-block;
  object-fit: contain;
  transition: filter 0.4s ease, opacity 0.4s ease;
}
:root[data-theme="dark"] img.invert-dark {
  filter: brightness(0) invert(0.92);
}
:root[data-theme="dark"] .cert-logo:not(.invert-dark),
:root[data-theme="dark"] .company-logo:not(.invert-dark) {
  filter: brightness(1.08) contrast(0.95);
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 80px;
  gap: 14px;
}
.g {
  border-radius: 3px;
  background: linear-gradient(135deg, var(--bg-alt), #c8bd95);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.g img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.g::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  background: linear-gradient(180deg, transparent 60%, rgba(17,41,66,0.12));
  pointer-events: none;
}
.g.has-image::after { display: none; }
.g.has-image { background: var(--bg-alt); }
.g.has-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.5));
  z-index: 1;
  pointer-events: none;
}
.g.has-image .lbl { z-index: 2; }
.g:hover { transform: scale(0.98); }
.g1 { grid-column: span 5; grid-row: span 4; background: linear-gradient(160deg, #1a5d6a, #0d3a47); }
.g2 { grid-column: span 4; grid-row: span 3; background: linear-gradient(135deg, #c79431, #8c6a23); }
.g3 { grid-column: span 3; grid-row: span 3; background: linear-gradient(200deg, #c8bd95, #8a8166); }
.g4 { grid-column: span 4; grid-row: span 3; background: linear-gradient(160deg, #2a5a78, #112942); }
.g5 { grid-column: span 3; grid-row: span 4; background: linear-gradient(135deg, #e6b432, #b8881e); }
.g6 { grid-column: span 5; grid-row: span 3; background: linear-gradient(195deg, #6a8390, #3a525e); }
.g .lbl {
  position: absolute;
  bottom: 14px;
  left: 16px;
  color: rgba(255,255,255,0.9);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  z-index: 2;
}
@media (max-width: 820px) {
  .gallery { grid-auto-rows: 60px; gap: 10px; }
  .g1, .g2, .g3, .g4, .g5, .g6 { grid-column: span 6; grid-row: span 3; }
}

/* ---------- Five things block ---------- */
.five-things {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 4vw, 56px);
}
@media (max-width: 760px) { .five-things { grid-template-columns: 1fr; } }
.thing {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.thing .label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 10px;
}
.thing h3 {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 8px;
}
.thing p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- Bookshelf ---------- */
.bookshelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(16px, 2vw, 28px);
}
.book {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.book .title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 4px;
}
.book .author {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 10px;
}
.book .note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Now page entry ---------- */
.now-entry {
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.now-entry .label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 12px;
}
.now-entry h3 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 12px;
}
.now-entry p {
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 65ch;
  font-weight: 300;
}
.now-stamp {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 40px;
  display: block;
}

/* ---------- Contact form ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-side h3 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 400;
  margin-bottom: 20px;
}
.contact-side p {
  color: var(--ink-soft);
  font-size: 16px;
  margin-bottom: 32px;
  font-weight: 300;
}
.contact-direct {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.contact-direct .row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contact-direct .row .label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.contact-direct .row a {
  font-family: var(--serif);
  font-size: 18px;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  width: fit-content;
  transition: color 0.3s;
}
.contact-direct .row a:hover { color: var(--accent); }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.contact-form label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 10px 0 14px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  transition: border-color 0.3s;
}
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.contact-form textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--sans);
}
.contact-form .submit {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 32px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  align-self: start;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 12px 28px -14px rgba(18, 103, 103, 0.6);
}
.contact-form .submit:hover {
  background: var(--accent-deep);
  transform: translateY(-3px);
}
.contact-form .submit .arrow { transition: transform 0.3s; font-family: var(--serif); font-style: italic; }
.contact-form .submit:hover .arrow { transform: translateX(4px); }

/* ---------- Case study page ---------- */
.case-hero-image {
  margin: 0 calc(-1 * var(--gutter)) 0;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-alt);
  position: relative;
}
.case-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (min-width: 1240px) {
  .case-hero-image {
    margin: 0;
    border-radius: 2px;
  }
}
.case-inline-image {
  margin: 32px 0;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-alt);
  border-radius: 2px;
}
.case-inline-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.case-inline-image .caption {
  display: block;
  margin-top: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 3vw, 40px);
  padding: 32px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 64px;
}
@media (max-width: 760px) {
  .case-meta { grid-template-columns: repeat(2, 1fr); }
}
.case-meta .item .label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.case-meta .item .val {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.4;
}
.case-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(40px, 6vw, 100px);
  margin-bottom: 80px;
}
@media (max-width: 820px) {
  .case-body { grid-template-columns: 1fr; gap: 16px; }
}
.case-body .heading {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 400;
  font-style: italic;
  color: var(--accent);
  line-height: 1.1;
  align-self: start;
  position: sticky;
  top: 100px;
}
@media (max-width: 820px) {
  .case-body .heading { position: static; }
}
.case-body .body p {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 24px;
  font-weight: 300;
  max-width: 65ch;
}
.case-body .body ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.case-body .body ul li {
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--ink-soft);
  padding: 10px 0 10px 28px;
  position: relative;
  line-height: 1.55;
}
.case-body .body ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--serif);
  font-style: italic;
}

.case-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 60px);
  padding: 48px 0;
  border-top: 1px solid var(--line);
}
@media (max-width: 600px) {
  .case-nav { grid-template-columns: 1fr; }
}
.case-nav a {
  display: block;
  padding: 24px 0;
  transition: color 0.3s;
}
.case-nav a:hover { color: var(--accent); }
.case-nav a.next { text-align: right; }
.case-nav a .dir {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.case-nav a .ttl {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 400;
}

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  margin-top: 80px;
  padding: clamp(80px, 12vw, 140px) 0 40px;
  position: relative;
  overflow: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}
footer.site-footer .display { color: var(--footer-fg); font-size: clamp(48px, 10vw, 140px); }
footer.site-footer .display em { color: var(--yellow); }
footer.site-footer .lead {
  max-width: 540px;
  color: var(--footer-muted);
  font-size: clamp(16px, 1.6vw, 19px);
  margin-top: 40px;
}
.email-cta {
  margin-top: 56px;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  border: 1px solid var(--footer-cta-border);
  border-radius: 999px;
  transition: all 0.4s;
  font-size: 16px;
}
.email-cta:hover {
  background: var(--footer-fg);
  color: var(--footer-bg);
  border-color: var(--footer-fg);
  transform: translateY(-2px);
}
.email-cta .arrow {
  transition: transform 0.4s;
  font-family: var(--serif);
  font-style: italic;
}
.email-cta:hover .arrow { transform: translateX(6px); }

/* Secondary CV download button — sits alongside email CTA */
.cv-cta {
  margin-left: 12px;
  font-size: 14px;
  padding: 16px 26px;
  opacity: 0.85;
  background: transparent;
}
.cv-cta:hover .arrow { transform: translateY(3px) translateX(0); }
@media (max-width: 640px) {
  .cv-cta { margin-left: 0; margin-top: 12px; }
}

.foot {
  margin-top: 100px;
  padding-top: 32px;
  border-top: 1px solid var(--footer-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 13px;
  color: var(--footer-muted);
}
.socials { display: flex; gap: 28px; }
.socials a {
  position: relative;
  color: var(--footer-fg);
  opacity: 0.85;
  transition: opacity 0.3s;
}
.socials a:hover { opacity: 1; }
.socials a[href^="http"]::after {
  content: '↗';
  margin-left: 4px;
  font-family: var(--serif);
  font-style: italic;
  opacity: 0.6;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Utility ---------- */
.divider {
  height: 1px;
  background: var(--line);
  margin: clamp(40px, 6vw, 80px) 0;
}
.center-link {
  display: block;
  text-align: center;
  margin-top: 48px;
}
.center-link a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  transition: gap 0.3s, color 0.3s;
}
.center-link a:hover { color: var(--accent); gap: 14px; }
