/* ============================================================
   szymonrucinski.ai — design system
   Structure & tokens adapted from ilialarchenko.com (bento hero,
   numbered sections, system fonts, single warm accent).
   Modern polish blended from the MiMo TTS page: gradient headline,
   soft hero glow, lifting cards, flat "›" CTAs. Restraint over effects.
   Self-contained: system fonts only, zero external requests.
   ============================================================ */

:root {
  /* ─── surfaces (MiMo warm cream, brightened to feel cheerful) ─── */
  --bg:           #FCFAF7;
  --surface:      #FFFFFF;
  --surface-2:    #F4EFEA;

  /* ─── foreground (MiMo warm near-black brown) ─── */
  --fg-1: #1D0601;
  --fg-2: rgba(29, 6, 1, 0.70);
  --fg-3: #8A7F78;
  --fg-4: #B8ADA4;

  /* ─── lines (warm hairlines) ─── */
  --line:      #E7DFD6;
  --line-soft: #F0EAE3;

  /* ─── accent (MiMo orange) + warm single-hue gradient (no rainbow) ─── */
  --accent:      #FF6700;
  --accent-soft: #FFEAD6;
  --grad: linear-gradient(120deg, #FF8A3D 0%, #FF6700 55%, #E8430E 100%);

  /* ─── type — system sans + mono + serif (no web fonts: zero external requests) ─── */
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-serif: Georgia, "Times New Roman", serif;

  /* ─── radii / motion / shadow (Apple: big soft corners, layered shadow) ─── */
  --r-3: 20px;
  --r-pill: 999px;
  --shadow-soft: 0 2px 12px rgba(120,60,20,0.05);
  --shadow-1: 0 1px 2px rgba(120,60,20,0.05);
  --shadow-2: 0 18px 50px rgba(120,60,20,0.14), 0 4px 12px rgba(120,60,20,0.06);
  --dur-fast: 140ms;
  --dur-base: 260ms;
  --ease: cubic-bezier(0.2, 0.0, 0.2, 1.0);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);   /* Apple ease-out-expo */
}

/* Always light & cheerful — no dark mode by request. The warm cream palette
   stays bright in any OS theme. (color-scheme: light pins form controls too.) */
:root { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.mono { font-family: var(--font-mono); }
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ─── Sticky nav ─── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.wordmark { font-family: var(--font-mono); font-weight: 700; font-size: 20px; letter-spacing: 0.02em; text-decoration: none; color: var(--fg-1); flex: 0 0 auto; }
.wordmark .dot { color: var(--accent); }
.nav-sections { display: flex; gap: 22px; margin-left: 8px; }
.nav-sections a { font-size: 14px; color: var(--fg-2); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
.nav-sections a:hover { color: var(--fg-1); }
.nav-spacer { flex: 1; }
.nav-socials { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-socials a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--fg-1); text-decoration: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.nav-socials a:hover { background: var(--fg-1); color: var(--bg); border-color: var(--fg-1); box-shadow: 0 4px 12px rgba(0,0,0,.2); transform: translateY(-1px); }
.nav-socials a svg { width: 15px; height: 15px; fill: currentColor; }
@media (max-width: 920px) { .nav-sections { display: none; } }

/* ─── Hero — bento, with soft MiMo glow ─── */
/* overflow:clip (not hidden) + a clip-margin lets the drifting glow stay
   contained while still allowing card hover-shadows to bleed past the edges
   instead of being trimmed. */
.hero { position: relative; padding: 56px 0 24px; overflow: clip; overflow-clip-margin: 80px; }
/* One soft, slowly drifting warm glow — subtle, single-hue (no rainbow) */
.hero::before {
  content: ""; position: absolute; z-index: 0; border-radius: 50%;
  top: -180px; right: -120px; width: 560px; height: 560px;
  background: radial-gradient(circle at center, rgba(255,103,0,0.16), rgba(255,138,61,0.07) 45%, transparent 70%);
  filter: blur(60px); opacity: 0.8; pointer-events: none;
  animation: drift-a 16s var(--ease) infinite alternate;
}
@keyframes drift-a { to { transform: translate(-36px, 30px) scale(1.1); } }
.hero .container { position: relative; z-index: 1; }
.bento { display: grid; gap: 12px; }
.bento-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.bento-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 130px; gap: 12px; }
.bento-stats > .tile { grid-column: span 2; }
.bento-stats > .tile[data-size="wide"] { grid-column: span 3; }
@media (max-width: 900px) { .bento-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bento-stats > .tile, .bento-stats > .tile[data-size="wide"] { grid-column: span 1; } }
@media (max-width: 520px) { .bento-stats { grid-template-columns: 1fr; } .bento-stats > .tile, .bento-stats > .tile[data-size="wide"] { grid-column: span 1; } }

.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: 22px 24px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; min-width: 0;
  box-shadow: var(--shadow-soft);
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-spring), border-color var(--dur-base) var(--ease-spring);
}
/* Lift every stat tile on hover (links and plain divs alike) so they're
   consistent; the big hero name/photo tiles stay put. */
.tile-stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.tile-art { position: absolute; top: -8px; right: 8px; width: 94px; height: 94px; color: #fff; opacity: 0.32; pointer-events: none; transition: opacity var(--dur-base) var(--ease-spring), transform var(--dur-base) var(--ease-spring); }
.tile:hover .tile-art { opacity: 0.45; transform: rotate(-4deg) scale(1.04); }
.tile.solid { background: var(--fg-1); color: #fff; border-color: var(--fg-1); }
.tile.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.tile .meta { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.tile.solid .meta, .tile.accent .meta { color: rgba(255,255,255,0.65); }
.tile-stat .num { font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; color: var(--fg-1); text-wrap: balance; }
.tile.accent .num, .tile.solid .num { color: #fff; }
.tile-stat .num .accent { color: var(--accent); }
.tile.accent .num .accent, .tile.solid .num .accent { color: #fff; }
.tile-stat .num .src { color: var(--fg-2); font-weight: 500; }
.tile.accent .num .src, .tile.solid .num .src { color: rgba(255,255,255,0.85); }
.tile-stat .num .plus { color: var(--accent); margin-left: 1px; }
.tile.accent .num .plus, .tile.solid .num .plus { color: #fff; }
.tile-stat .num .ord { font-size: 0.65em; vertical-align: 0.4em; margin-left: 1px; font-weight: 500; }
.tile-stat .sub { font-size: 13px; color: var(--fg-2); margin-top: 6px; }
.tile.solid .sub, .tile.accent .sub { color: rgba(255,255,255,0.78); }

/* Name + photo */
.tile-name { padding: 36px 40px; justify-content: center; min-height: 300px; }

/* LeRobot SO-101 — WebGL canvas container (renderer mounts here, see assets/lerobot/arm.js) */
.robot-arm {
  position: absolute; right: 24px; top: 56px;
  width: 372px; height: 212px;        /* base aligned to the "Ruciński" baseline; clean right margin */
  pointer-events: none; z-index: 1;
}
.robot-arm canvas { display: block; width: 100% !important; height: 100% !important; }
@media (max-width: 1080px) { .robot-arm { display: none; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  padding: 5px 12px; border-radius: var(--r-pill); margin-bottom: 18px;
}
.tile-name h1 { margin: 0; font-size: clamp(40px, 6vw, 64px); font-weight: 700; line-height: 0.95; letter-spacing: -0.035em; color: var(--fg-1); }
.tile-name h1 .accent { color: var(--accent); }
.tile-name p { margin: 18px 0 0; font-family: var(--font-serif); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.6; color: var(--fg-2); max-width: 560px; }
.tile-photo { padding: 0; overflow: hidden; background: var(--surface-2); min-height: 300px; }
.tile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; display: block; }
@media (max-width: 720px) {
  .bento-top { grid-template-columns: 1fr; }
  /* photo first, then name + description */
  .tile-photo { order: -1; aspect-ratio: 4 / 5; height: auto; min-height: 0; }
  .tile-name { min-height: 0; padding: 28px 24px; }
  .bento-stats { grid-auto-rows: 120px; }
}

/* ─── Section header ─── */
section { padding: 56px 0; position: relative; }
section + section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 32px; }
.section-head .num { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; color: var(--accent); }
.section-head h1, .section-head h2 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -0.02em; color: var(--fg-1); }
.section-head .rule { flex: 1; height: 1px; background: var(--line); }
.section-head .more { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); text-decoration: none; white-space: nowrap; transition: color var(--dur-fast) var(--ease); }
.section-head .more:hover { color: var(--fg-1); }

/* ─── About ─── */
.about-grid { columns: 2; column-gap: 56px; }
.about-grid p { font-family: var(--font-serif); font-size: 18px; line-height: 1.7; color: var(--fg-1); margin: 0 0 18px; max-width: 70ch; break-inside: avoid; }
.about-grid p .accent { color: var(--accent); font-weight: 500; }
@media (max-width: 720px) { .about-grid { columns: 1; } .about-grid p { max-width: none; } }

/* ─── Career timeline ─── */
.timeline { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 116px 1fr; column-gap: 24px; row-gap: 9px; padding: 22px 0; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.tl-row .tl-when { grid-column: 1; grid-row: 1; }
.tl-row .tl-logo { grid-column: 1; grid-row: 2; }   /* logo sits just under the date, left side */
.tl-row .tl-body { grid-column: 2; grid-row: 1 / span 2; }
.tl-row:first-child { padding-top: 0; }
.tl-row:last-child { border-bottom: 0; }
.tl-when { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--accent); padding-top: 4px; }
.tl-body h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.005em; color: var(--fg-1); }
.tl-body .org { font-size: 14px; color: var(--fg-2); margin-top: 2px; }
.tl-body p { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--fg-2); max-width: 56ch; }
@media (max-width: 640px) { .tl-row { grid-template-columns: 92px 1fr; column-gap: 14px; } .tl-logo img { width: 46px; height: 46px; } }

/* ─── Cards: competitions + projects (award-card) ─── */
.award-list { display: flex; flex-direction: column; gap: 18px; }
.award-card {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px;
  padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  align-items: start;
  box-shadow: var(--shadow-soft);
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-spring), border-color var(--dur-base) var(--ease-spring);
}
.award-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.award-card.featured { border-color: var(--accent); }
.award-body { display: flex; flex-direction: column; gap: 12px; }
.award-eyebrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.award-eyebrow .place { background: var(--accent); color: #fff; padding: 3px 8px; border-radius: var(--r-pill); font-size: 10px; white-space: nowrap; }
.award-eyebrow .place.silver { background: #9aa0a8; }
.award-eyebrow .place.bronze { background: #b3752e; }
.award-eyebrow .place.repo { background: var(--fg-1); }
.award-card h3 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; color: var(--fg-1); }
.award-card p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--fg-2); }
.award-card p b { color: var(--fg-1); font-weight: 500; }
.award-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.award-tags span { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); border: 1px solid var(--line); padding: 4px 9px; border-radius: var(--r-pill); }
.award-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.award-links a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; text-decoration: none; padding: 8px 14px; border: 1px solid var(--fg-1); border-radius: var(--r-pill); color: var(--fg-1); background: var(--bg); transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.award-links a:hover { background: var(--fg-1); color: var(--bg); }
.award-links a.subtle { border-color: var(--line); color: var(--fg-2); }
.award-links a.subtle:hover { background: var(--surface-2); color: var(--fg-1); }
.award-media { position: relative; border-radius: var(--r-3); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); aspect-ratio: 16 / 9; display: grid; place-items: center; }
@media (max-width: 760px) { .award-card { grid-template-columns: 1fr; gap: 20px; padding: 22px; } }

/* ─── Solo cards (no media column) + gradient award badge panel ─── */
.award-card.solo { grid-template-columns: 1fr; }
.award-media.badge-panel { align-self: stretch; aspect-ratio: auto; min-height: 100%; border: 0; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; background: var(--grad); color: #fff; }
.badge-panel .trophy { font-size: 38px; line-height: 1; }
.badge-panel .place { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.badge-panel .ven { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.92; }

/* ─── Publication / link meta line ─── */
.pub-meta { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.03em; color: var(--fg-3); line-height: 1.5; }
.pub-meta a { color: var(--accent); text-decoration: none; }
.pub-meta a:hover { opacity: 0.65; }

/* ─── Chip list (certifications) ─── */
.chip-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.chip-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 10px 16px; font-size: 14px; color: var(--fg-2); box-shadow: var(--shadow-soft); }
.chip-list li b { color: var(--fg-1); font-weight: 600; }

/* ─── Timeline company logos — small monochrome mark tucked under the date ─── */
.tl-logo { display: flex; align-items: center; justify-content: center; }
.tl-logo img { width: 54px; height: 54px; object-fit: contain; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 7px; filter: grayscale(100%); opacity: 0.9; transition: opacity var(--dur-base) var(--ease); }
.tl-row:hover .tl-logo img { opacity: 1; }

/* ─── "Worked with & for" logo band (real SVGs, grayscale → color on hover) ─── */
.collab { margin-top: 46px; padding-top: 32px; border-top: 1px solid var(--line); }
.collab-label { display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 22px; }
.collab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; align-items: center; justify-items: center; }
.collab-item { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 92px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-soft); transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-spring); }
.collab-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.collab-logo { width: 118px; height: 42px; object-fit: contain; filter: grayscale(100%); opacity: 0.72; transition: filter var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.collab-item:hover .collab-logo { filter: grayscale(0%); opacity: 1; transform: scale(1.06); }
@media (max-width: 768px) { .collab-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } .collab-logo { width: 84px; height: 32px; filter: grayscale(0%); opacity: 1; } .collab-item { min-height: 74px; border-radius: 14px; } }
@media (max-width: 480px) { .collab-grid { grid-template-columns: repeat(2, 1fr); } }

/* ─── "Now & next" carousel ─── */
.now-section { padding: 48px 0; }
.now-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.now-head h2 { display: flex; align-items: center; gap: 11px; margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg-1); }
.now-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); flex: 0 0 auto; }
.now-nav { display: flex; gap: 8px; }
.now-nav button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--fg-1); font-size: 18px; line-height: 1; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow-soft); transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.now-nav button:hover { background: var(--fg-1); color: var(--bg); border-color: var(--fg-1); }
/* Generous top/bottom padding so the hover lift + shadow aren't clipped by the
   scroll container (overflow-x:auto forces overflow-y to clip). */
.now-rail { display: flex; align-items: stretch; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 28px; scroll-behavior: smooth; padding: 26px 28px 46px; margin: 0 -28px; scrollbar-width: none; }
.now-rail::-webkit-scrollbar { display: none; }
.now-card { flex: 0 0 340px; scroll-snap-align: start; position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 28px 24px 24px; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; gap: 10px; transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-spring); }
.now-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px -6px rgba(120, 60, 20, 0.18); }
.now-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); z-index: 1; }
.now-thumb { display: block; width: calc(100% + 48px); height: 160px; object-fit: cover; margin: -28px -24px 0; }
/* Clickable video thumbnail with a play badge */
.now-thumb-link { display: block; position: relative; width: calc(100% + 48px); margin: -28px -24px 0; overflow: hidden; }
.now-thumb-link .now-thumb { width: 100%; margin: 0; }
.now-thumb-link .play-badge { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%; background: rgba(0,0,0,0.5); display: grid; place-items: center; transition: background var(--dur-base) var(--ease-spring), transform var(--dur-base) var(--ease-spring); }
.now-thumb-link .play-badge::after { content: ""; width: 0; height: 0; border-left: 17px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 4px; }
.now-thumb-link:hover .play-badge { background: var(--accent); transform: scale(1.08); }
.now-eyebrow { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.now-card h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: var(--fg-1); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.now-card p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--fg-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.now-card .now-link { margin-top: auto; padding-top: 4px; font-size: 13px; font-weight: 500; color: var(--accent); }
.now-dots { display: flex; justify-content: center; gap: 8px; margin-top: -18px; }
.now-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--line); cursor: pointer; transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.now-dots button.active { background: var(--accent); transform: scale(1.3); }
@media (max-width: 640px) { .now-card { flex: 0 0 84%; } }

/* ─── Blog index ─── */
.blog-head { padding-top: 8px; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; padding-bottom: 16px; }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; box-shadow: var(--shadow-soft); transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-spring); }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.post-card-img { aspect-ratio: 16 / 9; background: var(--surface-2) center / cover no-repeat; }
.post-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 9px; }
.post-card-body h2, .post-card-body h3 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--fg-1); }
.post-card-body p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--fg-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--fg-3); text-transform: uppercase; }
.post-cat { color: var(--accent); font-weight: 600; }

/* ─── Blog post (article) ─── */
.post-wrap { padding-top: 20px; }
.post-back { display: inline-block; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--fg-2); margin: 6px 0 22px; transition: color var(--dur-fast) var(--ease); }
.post-back:hover { color: var(--accent); }
.post { max-width: 720px; margin: 0 auto; padding-bottom: 8px; }
.post-head { margin-bottom: 20px; }
.post-head h1 { font-size: clamp(28px, 5vw, 42px); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; margin: 10px 0 0; color: var(--fg-1); }
.post-banner { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--r-3); border: 1px solid var(--line); margin: 6px 0 30px; }
.post h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; margin: 40px 0 14px; color: var(--fg-1); }
.post h3 { font-size: 20px; font-weight: 600; margin: 30px 0 10px; color: var(--fg-1); }
.post p, .post ul, .post ol { font-family: var(--font-serif); font-size: 18px; line-height: 1.75; color: var(--fg-1); margin: 0 0 18px; }
.post ul, .post ol { padding-left: 1.35em; }
.post li { margin: 6px 0; }
.post strong { font-weight: 600; }
.post a { color: var(--accent); }
.post a:hover { opacity: 0.7; }
.post blockquote { border-left: 3px solid var(--accent); padding: 2px 0 2px 18px; margin: 0 0 18px; color: var(--fg-2); font-style: italic; }
.post code { font-family: var(--font-mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.post pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-3); padding: 16px 18px; overflow-x: auto; margin: 0 0 18px; }
.post pre code { background: none; border: 0; padding: 0; font-size: 13px; }
.post img { max-width: 100%; height: auto; border-radius: var(--r-3); border: 1px solid var(--line); display: block; margin: 10px auto 6px; }
.post em { color: var(--fg-2); font-size: 0.9em; }
.post table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14.5px; }
.post th, .post td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; }
.post th { background: var(--surface-2); font-weight: 600; }

/* ─── Footer ─── */
footer.site-foot { border-top: 1px solid var(--line); padding: 48px 0 64px; background: var(--bg); }
.foot-grid { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; }
.foot-mark { font-family: var(--font-mono); font-weight: 700; font-size: 26px; color: var(--fg-1); }
.foot-mark .dot { color: var(--accent); }
.foot-mark small { display: block; font-family: var(--font-sans); font-weight: 400; font-size: 12px; color: var(--fg-3); margin-top: 6px; letter-spacing: 0; }
.foot-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.foot-links a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--fg-1); text-decoration: none; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.foot-links a:hover { background: var(--fg-1); color: var(--bg); border-color: var(--fg-1); box-shadow: 0 4px 12px rgba(0,0,0,.2); transform: translateY(-1px); }
.foot-links a svg { width: 16px; height: 16px; fill: currentColor; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; } .foot-links { justify-content: flex-start; } }

/* ─── Scroll reveal (JS adds .reveal, then .in when in view) ─── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease-spring), transform 0.7s var(--ease-spring); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
