/* ---------- Tokens ---------- */
:root {
  --bg: #f4efe6;
  --bg-2: #ede5d6;
  --paper: #faf6ee;
  --ink: #1f1d18;
  --ink-2: #3a362d;
  --muted: #6b6557;
  --rule: #d9d1bd;
  --accent: #c8553d;
  --accent-soft: oklch(0.65 0.16 35);
  --serif: 'Cormorant Garamond', 'Source Han Serif SC', 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --sans: 'Inter Tight', 'PingFang SC', 'Helvetica Neue', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  --pad: clamp(20px, 4vw, 56px);
  --pad-y: clamp(80px, 10vw, 160px);
}

[data-theme="dark"] {
  --bg: #181612;
  --bg-2: #221f19;
  --paper: #1f1c16;
  --ink: #f1ece0;
  --ink-2: #d6cfbe;
  --muted: #8e8676;
  --rule: #322d23;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
  transition: background 400ms ease, color 400ms ease;
}

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

a { color: inherit; }

/* ---------- Layout ---------- */
.wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

section { padding: var(--pad-y) 0; position: relative; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; line-height: 1.05; margin: 0; text-wrap: pretty; }
h2.section-title { font-size: clamp(40px, 5.5vw, 84px); margin: 18px 0 10px; }
h3.lede { font-family: var(--sans); font-weight: 400; font-size: clamp(15px, 1.3vw, 18px); color: var(--muted); max-width: 60ch; line-height: 1.55; margin: 0; }

p { line-height: 1.65; color: var(--ink-2); }

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: clamp(40px, 5vw, 80px);
  max-width: 1100px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background 200ms ease;
}
.nav.scrolled { border-bottom-color: var(--rule); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--pad);
  max-width: 1320px;
  margin: 0 auto;
  gap: 24px;
}
.brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--bg);
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  display: inline-block;
  padding: 8px 14px;
  font-size: 13.5px;
  text-decoration: none;
  color: var(--ink-2);
  border-radius: 999px;
  transition: color 180ms;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  transition: transform 180ms, background 180ms;
}
.nav-cta:hover { transform: translateY(-1px); }

.theme-tog {
  appearance: none;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background 180ms;
}
.theme-tog:hover { background: var(--bg-2); }

/* ---------- Hero ---------- */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 60px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: end;
}
.hero h1 {
  font-size: clamp(56px, 11vw, 192px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  font-weight: 500;
}
.hero h1 .accent { color: var(--accent); font-style: italic; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.hero-slogan {
  font-family: var(--serif);
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.45;
  font-style: italic;
  color: var(--ink-2);
  max-width: 38ch;
  flex: 1 1 360px;
}
.hero-slogan small {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: 12px;
}

.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 15px;
  text-decoration: none;
  transition: transform 200ms ease, background 200ms;
  font-weight: 500;
}
.cta-primary:hover { transform: translateY(-2px); }
.cta-primary .arr {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); display: inline-grid; place-items: center;
  transition: transform 240ms;
}
.cta-primary:hover .arr { transform: rotate(-45deg); }

.hero-marquee {
  margin-top: 80px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  gap: 36px;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.hero-marquee-track { display: inline-flex; gap: 36px; animation: marq 40s linear infinite; }
@keyframes marq { to { transform: translateX(-50%); } }
.hero-marquee span::after { content: '·'; margin-left: 36px; opacity: 0.5; }

/* ambient hero ornament */
.hero-orn {
  position: absolute;
  right: -8vw;
  top: 8vh;
  width: 46vw;
  max-width: 720px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--accent), transparent 62%);
  opacity: 0.18;
  filter: blur(20px);
  pointer-events: none;
  animation: float 18s ease-in-out infinite;
}
@keyframes float { 50% { transform: translate(-3%, -2%); } }

/* ---------- Experience ---------- */
.exp-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 56px;
  padding: 5px;
  background: var(--bg-2);
  border-radius: 999px;
  width: fit-content;
}
.exp-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13px;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms, color 180ms;
}
.exp-tabs button.active { background: var(--ink); color: var(--bg); }
.exp-tabs button:not(.active):hover { color: var(--ink); }

.timeline {
  position: relative;
  padding-left: 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 11.5%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--rule);
}
.tl-item {
  display: grid;
  grid-template-columns: 11.5% 1fr;
  gap: 6%;
  padding: 36px 0 56px;
  position: relative;
}
.tl-period {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
  padding-top: 10px;
  text-align: right;
  padding-right: 24px;
}
.tl-dot {
  position: absolute;
  left: 11.5%;
  top: 14px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  transform: translateX(-50%);
  transition: background 200ms, transform 240ms;
}
.tl-item:hover .tl-dot { background: var(--accent); transform: translateX(-50%) scale(1.25); }

.tl-card {
  padding-left: 0;
}
.tl-card h3 {
  font-family: var(--serif);
  font-size: clamp(26px, 2.5vw, 38px);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}
.tl-role {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}
.tl-role .sep { color: var(--rule); }
.tl-summary {
  margin: 14px 0 18px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 68ch;
}
.tl-bullets {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-top: 1px solid var(--rule);
  padding-top: 22px;
}
.tl-bullets li { display: grid; grid-template-columns: 18ch 1fr; gap: 24px; }
.tl-bullets h4 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
  line-height: 1.5;
}
.tl-bullets p { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--ink-2); }

.tl-bullets-simple {
  list-style: none; padding: 0; margin: 14px 0 0;
  display: flex; flex-direction: column; gap: 8px;
}
.tl-bullets-simple li {
  position: relative; padding-left: 18px;
  font-size: 14.5px; color: var(--ink-2); line-height: 1.65;
}
.tl-bullets-simple li::before {
  content: ''; position: absolute; left: 0; top: 11px;
  width: 6px; height: 1px; background: var(--accent);
}

.stack-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 18px;
}
.tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--ink-2);
}

/* ---------- Projects ---------- */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}
.proj-card {
  padding: 40px 32px 36px;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  position: relative;
  background: transparent;
  transition: background 240ms;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 460px;
}
.proj-card:nth-child(2n) { border-right: 0; }
.proj-card:hover { background: var(--paper); }

.proj-thumb {
  aspect-ratio: 16/10;
  background: var(--bg-2);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  background-image:
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in oklab, var(--ink) 6%, transparent) 14px 15px);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.proj-kicker { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.14em; text-transform: uppercase; }
.proj-card h3 { font-family: var(--serif); font-size: 32px; font-weight: 500; line-height: 1.1; }
.proj-card p { font-size: 14.5px; line-height: 1.65; color: var(--ink-2); margin: 0; }
.proj-foot { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-top: auto; padding-top: 8px; }
.proj-links { display: flex; gap: 14px; }
.proj-links a {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--rule);
  display: grid; place-items: center;
  text-decoration: none; color: var(--ink-2);
  transition: background 180ms, color 180ms, border-color 180ms;
}
.proj-links a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Blog ---------- */
.posts { display: flex; flex-direction: column; }
.post {
  display: grid;
  grid-template-columns: 18% 1fr 14%;
  gap: 5%;
  padding: 38px 0;
  border-top: 1px solid var(--rule);
  align-items: start;
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: padding 240ms ease;
}
.post:last-child { border-bottom: 1px solid var(--rule); }
.post:hover { padding-left: 20px; }
.post:hover h3 { color: var(--accent); }

.post-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; padding-top: 10px; }
.post-meta .cat { display: block; color: var(--accent); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.14em; }
.post h3 {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 14px;
  letter-spacing: -0.015em;
  transition: color 200ms;
}
.post p { font-size: 15.5px; line-height: 1.65; color: var(--muted); margin: 0; max-width: 60ch; }
.post-read { font-family: var(--mono); font-size: 11px; color: var(--muted); padding-top: 14px; text-align: right; letter-spacing: 0.06em; }
.post-arrow {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--rule);
  display: grid; place-items: center;
  opacity: 0; transition: opacity 220ms, background 200ms, color 200ms;
}
.post:hover .post-arrow { opacity: 1; background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- About ---------- */
.about {
  background: var(--paper);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: start;
}
.portrait {
  aspect-ratio: 4/5;
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, color-mix(in oklab, var(--ink) 7%, var(--bg-2)) 0 18px, var(--bg-2) 18px 19px);
  position: relative;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  overflow: hidden;
}
.portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  border: 1px solid var(--rule);
}
.about-body p {
  font-family: var(--serif);
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 22px;
  max-width: 32ch;
}
.about-body p.small {
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 56ch;
}
.about-cta { margin-top: 36px; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: start;
}
.contact-side h3 {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1;
  margin-bottom: 28px;
}
.contact-side .meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form { display: grid; gap: 22px; }
.field { display: grid; gap: 8px; }
.field label { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }
.field input, .field textarea {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 10px 0 14px;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  outline: none;
  transition: border-color 200ms;
  font-weight: 500;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); font-style: italic; opacity: 0.7; }
.field textarea { resize: none; min-height: 100px; line-height: 1.4; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.submit {
  appearance: none;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 18px 28px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 15px;
  cursor: pointer;
  margin-top: 8px;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: transform 200ms;
}
.submit:hover { transform: translateY(-2px); }

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--rule);
  padding: 56px 0 36px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.foot-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}
.foot-big {
  font-family: var(--serif);
  font-size: clamp(64px, 12vw, 200px);
  line-height: 0.9;
  color: var(--ink);
  letter-spacing: -0.025em;
  margin: 0 0 40px;
  font-weight: 500;
}
.socials { display: flex; gap: 22px; flex-wrap: wrap; }
.socials a { color: var(--ink-2); text-decoration: none; padding: 6px 0; border-bottom: 1px solid var(--rule); transition: border-color 200ms, color 200ms; letter-spacing: 0.06em; }
.socials a:hover { border-color: var(--accent); color: var(--accent); }

.colophon { display: flex; justify-content: space-between; padding-top: 28px; margin-top: 36px; border-top: 1px solid var(--rule); flex-wrap: wrap; gap: 12px; }

/* ---------- Image slot (user-uploadable) ---------- */
.img-slot {
  position: relative;
  width: 100%;
  background: var(--bg-2);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px dashed transparent;
  background-image:
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in oklab, var(--ink) 6%, transparent) 14px 15px);
  transition: border-color 200ms, background-color 200ms;
  outline: none;
}
.img-slot:focus-visible { border-color: var(--accent); }
.img-slot.over { border-color: var(--accent); background-color: color-mix(in oklab, var(--accent) 8%, var(--bg-2)); }
.img-slot.filled { background-image: none; cursor: default; }
.img-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.img-slot-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); padding: 20px; text-align: center; pointer-events: none;
}
.img-slot-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--paper); display: grid; place-items: center;
  border: 1px solid var(--rule);
  color: var(--ink-2);
}
.img-slot-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.img-slot-hint { font-family: var(--sans); font-size: 11.5px; color: var(--muted); opacity: 0.85; }
.img-slot-clear {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,0.55); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  opacity: 0; transition: opacity 200ms, background 200ms;
}
.img-slot:hover .img-slot-clear, .img-slot.filled:focus-within .img-slot-clear { opacity: 1; }
.img-slot-clear:hover { background: rgba(0,0,0,0.78); }

/* portrait variant */
.portrait.img-slot { aspect-ratio: 4/5; }
.portrait.img-slot::after { display: none; }

/* project demo link */
.proj-demo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 14px 16px;
  background: var(--bg-2);
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
  transition: background 200ms, color 200ms;
}
.proj-demo-link:hover { background: var(--ink); color: var(--bg); }
.proj-demo-link:hover .proj-demo-arrow { color: var(--bg); }
.proj-demo-text { flex: 1; }
.proj-demo-text strong { display: block; font-weight: 500; color: inherit; margin-bottom: 2px; }
.proj-demo-text span { font-size: 11.5px; color: var(--muted); }
.proj-demo-link:hover .proj-demo-text span { color: color-mix(in oklab, var(--bg) 70%, transparent); }
.proj-demo-arrow { color: var(--accent); transition: transform 200ms; }
.proj-demo-link:hover .proj-demo-arrow { transform: translateX(3px); }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 800ms cubic-bezier(.2,.7,.2,1), transform 800ms cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: 80ms; }
.reveal.delay-2 { transition-delay: 160ms; }
.reveal.delay-3 { transition-delay: 240ms; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .timeline::before { left: 8px; }
  .tl-item { grid-template-columns: 1fr; gap: 4px; padding-left: 28px; }
  .tl-dot { left: 8px; top: 8px; }
  .tl-period { text-align: left; padding: 0 0 6px; }
  .tl-bullets li { grid-template-columns: 1fr; gap: 4px; }
  .proj-grid { grid-template-columns: 1fr; }
  .proj-card { border-right: 0 !important; min-height: 0; }
  .post { grid-template-columns: 1fr; gap: 8px; }
  .post-meta, .post-read { padding: 0; text-align: left; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 320px; }
}

/* ---------- Post View ---------- */
.post-view {
  padding: 80px 0 120px;
  min-height: 80vh;
}
.post-view-header {
  max-width: 760px;
  margin: 0 auto 56px;
  text-align: center;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 32px;
  transition: color 200ms;
}
.back-btn:hover { color: var(--accent); }
.post-view-title {
  font-family: var(--serif);
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 1.15;
  margin-bottom: 24px;
}
.post-view-meta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  gap: 16px;
}
.post-view-meta .cat { color: var(--accent); }
.post-view-content {
  max-width: 680px;
  margin: 0 auto;
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--ink-2);
}
.post-view-content h2 {
  font-family: var(--serif);
  font-size: 28px;
  margin: 48px 0 20px;
  color: var(--ink);
}
.post-view-content h3 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 36px 0 16px;
  color: var(--ink);
}
.post-view-content p {
  margin-bottom: 24px;
}
.post-view-content code {
  font-family: var(--mono);
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.post-view-content pre {
  background: var(--bg-2);
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 32px 0;
}
.post-view-content pre code {
  background: transparent;
  padding: 0;
  font-size: 14px;
}
.post-view-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 32px 0;
  padding-left: 20px;
  font-style: italic;
  color: var(--muted);
}
.post-view-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 32px 0;
}

/* ---------- Lightbox / Modal ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}
.lightbox-content {
  position: relative;
  max-width: 95%;
  max-height: 95%;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
  animation: zoomIn 0.3s cubic-bezier(0.2, 0, 0.2, 1);
}
.lightbox-content img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}
.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  color: white;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Improved Project Thumb (Browser Frame) */
.proj-thumb {
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: var(--bg-2);
  padding-top: 24px; /* Browser bar space */
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.proj-thumb::before {
  content: '•••';
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--muted);
  opacity: 0.5;
  z-index: 10;
}
.proj-thumb:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}
.proj-thumb img {
  object-fit: contain !important; /* Ensure full image visibility */
  background: #fff;
}
