/* ============================================================
   Mario Ramirez — portfolio
   A centred page column with a floating pill navigation and
   separate pages (Home, About, Projects, Writing, Experience).
   One teal accent on cool slate greys (light theme) or graphite
   greys with a hint of blue (dark theme). Fonts are self-hosted (no requests to third parties);
   text contrast is WCAG AA or better in both themes.

   Gradient rule: gradients only ever let the accent fade into
   the surface, at low strength (10–18%), from the top left at
   155°. They mark what matters (the page top, the featured
   tile, the hovered card, the current nav item) and are never
   used on text or as solid fills.
   ============================================================ */

@font-face{font-family:'IBM Plex Mono'; src:url("../fonts/ibm-plex-mono-400.79936b18df9f.woff2") format('woff2'); font-weight:400; font-display:swap;}
@font-face{font-family:'IBM Plex Mono'; src:url("../fonts/ibm-plex-mono-500.b1c8a895f5fd.woff2") format('woff2'); font-weight:500; font-display:swap;}
@font-face{font-family:'Source Sans 3'; src:url("../fonts/source-sans-3-400.27ab01c4cb50.woff2") format('woff2'); font-weight:400; font-display:swap;}
@font-face{font-family:'Source Sans 3'; src:url("../fonts/source-sans-3-600.9a35cba76eda.woff2") format('woff2'); font-weight:600; font-display:swap;}
@font-face{font-family:'Jost'; src:url("../fonts/jost-600.b6346d671c34.woff2") format('woff2'); font-weight:600; font-display:swap;}

/* ---- Theme tokens. Light by default; dark follows the system unless the switch chose light. ---- */
:root{
  color-scheme:light;
  --bg:#f4f6f9;            /* outside the page column */
  --surface:#ffffff;       /* the page column */
  --raised:#f8fafc;        /* cards and tiles */
  --hover:#eef2f6;
  --ink:#0f172a;
  --ink-body:#334155;      /* article text */
  --ink-soft:#475569;      /* 6.7:1 or more */
  --ink-faint:#5b6a80;     /* 4.9:1 even on --hover */
  --line:rgb(15 23 42 / 0.08);
  --line-strong:rgb(15 23 42 / 0.14);
  --accent:#0f766e;        /* accent text: 4.9:1 or more */
  --accent-rgb:20 184 166; /* accent light for washes and lines */
  --glass:rgb(255 255 255 / 0.9);
  --shadow:0 10px 24px -12px rgb(15 23 42 / 0.22);
  --glow:rgb(20 184 166 / 0.10);
  --code-bg:#f1f5f9;
  --draft-ink:#92400e;
  --draft-bg:rgb(251 191 36 / 0.16);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bg:#0b0c10; --surface:#15171d; --raised:#1d2028; --hover:#252932;
    --ink:#eef0f4; --ink-body:#d0d4dc; --ink-soft:#a6acb8; --ink-faint:#8d94a2;
    --line:rgb(255 255 255 / 0.08); --line-strong:rgb(255 255 255 / 0.15);
    --accent:#5eead4; --accent-rgb:45 212 191;
    --glass:rgb(29 32 40 / 0.88); --shadow:0 10px 24px -10px rgb(0 0 0 / 0.55);
    --glow:rgb(94 234 212 / 0.06); --code-bg:#0b0c10;
    --draft-ink:#fcd34d; --draft-bg:rgb(251 191 36 / 0.10);
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0b0c10; --surface:#15171d; --raised:#1d2028; --hover:#252932;
  --ink:#eef0f4; --ink-body:#d0d4dc; --ink-soft:#a6acb8; --ink-faint:#8d94a2;
  --line:rgb(255 255 255 / 0.08); --line-strong:rgb(255 255 255 / 0.15);
  --accent:#5eead4; --accent-rgb:45 212 191;
  --glass:rgb(29 32 40 / 0.88); --shadow:0 10px 24px -10px rgb(0 0 0 / 0.55);
  --glow:rgb(94 234 212 / 0.06); --code-bg:#0b0c10;
  --draft-ink:#fcd34d; --draft-bg:rgb(251 191 36 / 0.10);
}
:root{
  --accent-bg:rgb(var(--accent-rgb) / 0.10);
  --accent-line:rgb(var(--accent-rgb) / 0.38);
  /* the gradient rule, as reusable pieces */
  --wash-top:radial-gradient(64rem 30rem at 12% -12%, rgb(var(--accent-rgb) / 0.10), transparent 70%);
  --wash-card:linear-gradient(155deg, rgb(var(--accent-rgb) / 0.14), transparent 60%);
  --wash-line:linear-gradient(90deg, transparent, rgb(var(--accent-rgb) / 0.75), transparent);
  --radius:16px;

  --font-heading:'Jost', 'Futura', 'Century Gothic', var(--font-body);
  --font-body:'Source Sans 3', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*{box-sizing:border-box;}
html,body{margin:0; padding:0; overflow-x:clip;}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
[hidden]{display:none !important;}
h1,h2,h3{font-weight:600; text-wrap:balance; margin:0;}
p{margin:0;}
a{color:inherit;}
button, a{-webkit-tap-highlight-color:transparent; touch-action:manipulation;}
:focus-visible{outline:2px solid var(--accent); outline-offset:3px;}

.skip-link{
  position:absolute; left:16px; top:-60px; z-index:50; padding:10px 14px; border-radius:8px;
  background:var(--accent); color:var(--surface); font-weight:600; text-decoration:none;
}
.skip-link:focus{top:16px;}

/* Soft light that follows the mouse (app.js turns it on for fine pointers only). */
.glow{position:fixed; inset:0; z-index:30; pointer-events:none; opacity:0; transition:opacity .4s ease;
  background:radial-gradient(600px circle at var(--gx, 50%) var(--gy, 0), var(--glow), transparent 80%);}
.glow.on{opacity:1;}

/* ---- Page column ---- */
.frame{
  max-width:80rem; margin:0 auto; min-height:100vh;
  background:var(--wash-top), var(--surface); box-shadow:0 0 0 1px var(--line);
  display:flex; flex-direction:column;
}
.wrap{width:100%; max-width:64rem; margin:0 auto; padding:0 32px; flex:1;}
@media (max-width:640px){ .wrap{padding:0 16px;} }

/* ---- Header: avatar, floating pill navigation, theme switch ---- */
.site-header{position:sticky; top:0; z-index:20; padding-top:20px;}
.header-inner{
  max-width:64rem; margin:0 auto; padding:0 32px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.avatar, .pill-nav, .theme-toggle, .back-button, .menu summary{
  background:var(--glass);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  box-shadow:0 0 0 1px var(--line-strong), var(--shadow);
}
.avatar{display:block; width:40px; height:40px; padding:2px; border-radius:50%; flex-shrink:0;}
.avatar img{display:block; width:100%; height:100%; border-radius:50%; object-fit:cover;}
.pill-nav{display:flex; padding:0 10px; border-radius:999px;}
.pill-nav a{
  position:relative; display:block; padding:9px 12px;
  font-size:14.5px; font-weight:600; color:var(--ink); text-decoration:none;
  transition:color .15s ease;
}
.pill-nav a:hover, .pill-nav a[aria-current]{color:var(--accent);}
.pill-nav a[aria-current]::after{content:""; position:absolute; left:8px; right:8px; bottom:-1px; height:1px; background:var(--wash-line);}
.pill-nav a:focus-visible{outline-offset:-2px; border-radius:999px;}
.theme-toggle{
  display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
  width:40px; height:40px; border:0; border-radius:50%; cursor:pointer; color:var(--ink-soft);
  transition:color .15s ease;
}
.theme-toggle[hidden]{display:inline-flex !important; visibility:hidden;}   /* keeps the nav centred */
.theme-toggle:hover{color:var(--accent);}
.theme-toggle[data-current="light"] .icon-moon,
.theme-toggle[data-current="dark"] .icon-sun,
.theme-toggle:not([data-current]) .icon-moon{display:none;}
/* Narrow screens: the pill becomes a Menu button that opens the same links. */
.menu{display:none; position:relative;}
.menu summary{
  display:flex; align-items:center; gap:6px; padding:9px 18px; border-radius:999px; cursor:pointer;
  list-style:none; font-size:14.5px; font-weight:600; color:var(--ink);
}
.menu summary::-webkit-details-marker{display:none;}
.menu summary svg{transition:transform .2s ease;}
.menu[open] summary svg{transform:rotate(180deg);}
.menu summary:focus-visible{outline-offset:2px; border-radius:999px;}
.menu-panel{
  position:absolute; top:calc(100% + 8px); left:50%; transform:translateX(-50%); min-width:210px;
  display:grid; padding:8px; border-radius:var(--radius);
  background:var(--surface); box-shadow:0 0 0 1px var(--line-strong), var(--shadow);
}
.menu-panel a{padding:10px 14px; border-radius:10px; font-size:15.5px; font-weight:600; color:var(--ink); text-decoration:none;}
.menu-panel a:hover{background:var(--hover);}
.menu-panel a[aria-current]{color:var(--accent); background:var(--accent-bg);}
@media (max-width:720px){
  .pill-nav{display:none;}
  .menu{display:block;}
}
@media (max-width:640px){
  .header-inner{padding:0 16px;}
}

/* ---- Page heads and section heads ---- */
.page-head{padding:72px 0 48px; max-width:42rem;}
.page-head h1, .about h1{font-family:var(--font-heading); font-size:clamp(36px,5.6vw,54px); line-height:1.08; letter-spacing:-0.015em;}
.lead{margin-top:20px; font-size:18px; line-height:1.7; color:var(--ink-soft);}
.page-head .more-link{display:inline-block; margin-top:16px;}
.section-head{display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:8px 16px; margin-bottom:24px;}
.section-head h2{font-family:var(--font-heading); font-size:24px; line-height:1.2;}
.count{font-family:var(--font-mono); font-size:12.5px; color:var(--ink-faint); font-variant-numeric:tabular-nums;}
.more-link{font-size:15px; font-weight:600; color:var(--accent); text-decoration:none;}
.more-link:hover{text-decoration:underline; text-underline-offset:3px;}
@media (max-width:640px){ .page-head{padding:48px 0 36px;} }

/* ---- Landing (About) ---- */
.eyebrow{
  display:inline-flex; align-items:center; gap:10px; margin-bottom:24px; padding:5px 14px;
  border-radius:999px; background:var(--accent-bg); box-shadow:inset 0 0 0 1px var(--accent-line);
  font-size:14px; font-weight:600; color:var(--accent);
}
.eyebrow::before{content:""; width:7px; height:7px; border-radius:50%; background:currentColor; box-shadow:0 0 8px rgb(var(--accent-rgb) / 0.8);}
.role{margin-top:14px; font-size:19px; font-weight:600; color:var(--ink-soft);}
.about{
  display:grid; grid-template-columns:minmax(0,1fr) 17rem; grid-template-rows:auto 1fr;
  grid-template-areas:"text photo" "text links";
  gap:0 72px; padding-top:56px; align-items:start;
}
.about-text{grid-area:text;}
.about-photo{grid-area:photo; padding:0 8px;}
.profile-list{grid-area:links;}
.about-body{margin-top:24px; font-size:17.5px; line-height:1.75; color:var(--ink-soft);}
.about-body p + p{margin-top:1.2em;}
.meta{display:flex; flex-wrap:wrap; gap:6px 24px; margin-top:28px; font-size:15px; color:var(--ink-faint);}
.portrait{
  display:block; width:100%; height:auto; aspect-ratio:1; object-fit:cover;
  border-radius:var(--radius); background:var(--raised); transform:rotate(3deg);
  box-shadow:0 0 0 1px var(--line-strong), 0 24px 48px -24px rgb(0 0 0 / 0.45);
}
/* Small link to the Writing page that names the newest piece (gradient rule: accent wash). */
.latest-badge{
  display:flex; flex-direction:column; gap:4px; margin-top:32px; padding:12px 16px;
  border-radius:14px; text-decoration:none; color:var(--ink);
  background:var(--wash-card), var(--raised); box-shadow:inset 0 0 0 1px var(--accent-line);
  transition:background .2s ease;
}
.latest-badge:hover{background:var(--wash-card), var(--wash-card), var(--hover);}
.latest-label{font-size:13px; font-weight:600; color:var(--accent);}
.latest-title{
  font-size:14.5px; font-weight:600; line-height:1.35;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.profile-list{list-style:none; margin:32px 0 0; padding:0;}
.profile-list li + li{margin-top:14px;}
.profile-list a{display:flex; align-items:center; gap:14px; font-size:15px; font-weight:600; color:var(--ink); text-decoration:none; transition:color .15s ease;}
.profile-list a .icon{color:var(--ink-faint); transition:color .15s ease;}
.profile-list a:hover, .profile-list a:hover .icon{color:var(--accent);}
.profile-list .profile-email{margin-top:22px; padding-top:22px; border-top:1px solid var(--line);}
.profile-email a{overflow-wrap:anywhere;}
@media (max-width:860px){
  .about{grid-template-columns:1fr; grid-template-areas:"photo" "text" "links"; padding-top:48px;}
  .about-photo{max-width:12rem; margin-bottom:36px;}
  .profile-list{margin-top:36px;}
}

/* ---- Icons ---- */
.icon svg{width:20px; height:20px; display:block; fill:currentColor;}
.icon svg[stroke]{fill:none;}   /* outline icons (email) */

/* ---- Projects ---- */
.filter-row{display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px 24px; margin-bottom:48px;}
.chips{display:flex; flex-wrap:wrap; gap:8px;}
.chip{
  font:600 14px/1 var(--font-body); padding:9px 15px; border:0; border-radius:999px; cursor:pointer;
  background:var(--raised); box-shadow:inset 0 0 0 1px var(--line-strong); color:var(--ink-soft);
  transition:color .15s ease, background .15s ease, box-shadow .15s ease;
}
.chip:hover{color:var(--ink); background:var(--hover);}
.chip[aria-pressed="true"]{color:var(--accent); background:var(--accent-bg); box-shadow:inset 0 0 0 1px var(--accent-line);}

/* Cards that light up on hover; the whole card is the link. */
.project-grid{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:56px 40px;}
.project{position:relative; isolation:isolate; display:flex; flex-direction:column; align-items:flex-start;}
.project::before{
  content:""; position:absolute; inset:-18px -20px; z-index:-1; border-radius:var(--radius);
  background:var(--wash-card), var(--raised); box-shadow:inset 0 0 0 1px var(--line);
  opacity:0; transform:scale(0.96); transition:opacity .2s ease, transform .2s ease;
}
.project:hover::before{opacity:1; transform:scale(1);}
.tag{
  font-family:var(--font-mono); font-size:11.5px; line-height:1; padding:6px 10px; margin-bottom:16px;
  border-radius:999px; background:var(--accent-bg); color:var(--accent);
}
.project h2{font-size:17px; line-height:1.35; color:var(--ink); transition:color .15s ease;}
.card-link{text-decoration:none;}
.card-link::after{content:""; position:absolute; inset:-18px -20px; z-index:1; border-radius:var(--radius);}
.card-link:focus-visible{outline:none;}
.card-link:focus-visible::after{outline:2px solid var(--accent); outline-offset:0;}
.project .desc{margin-top:8px; font-size:15px; line-height:1.6; color:var(--ink-soft);}
.project .stack{margin-top:12px; font-family:var(--font-mono); font-size:12px; line-height:1.5; color:var(--ink-faint);}
.card-url{
  display:flex; align-items:center; gap:8px; max-width:100%; margin-top:20px;
  font-size:14px; font-weight:600; color:var(--ink-soft); transition:color .15s ease;
}
.card-url svg{flex-shrink:0;}
.card-url span{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.project:hover .card-url, .project:hover h2{color:var(--accent);}
.empty-note{color:var(--ink-faint); font-size:15px; padding:8px 0;}
@media (max-width:900px){ .project-grid{grid-template-columns:repeat(2, minmax(0,1fr));} }
@media (max-width:600px){ .project-grid{grid-template-columns:minmax(0,1fr); gap:44px;} }

/* ---- Publications ---- */
.pub-list{list-style:none; margin:0; padding:0; border-left:1px solid var(--line-strong);}
.pub{display:grid; grid-template-columns:6rem minmax(0,1fr); gap:6px 24px; padding:0 0 44px 24px;}
.pub:last-child{padding-bottom:0;}
.pub-year{font-family:var(--font-mono); font-size:13px; color:var(--ink-faint); padding-top:4px;}
.pub-status{display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px;}
.pub-status .tag{margin:0;}
.tag.pending{background:var(--draft-bg); color:var(--draft-ink);}
.pub-venue{font-size:14.5px; font-weight:600; color:var(--ink-soft);}
.pub h2{margin-top:12px; max-width:40rem; font-family:var(--font-heading); font-size:clamp(20px,2.4vw,24px); line-height:1.3;}
.pub h2 a{text-decoration:none; transition:color .15s ease;}
.pub h2 a:hover{color:var(--accent);}
.pub-authors{margin-top:8px; font-size:15.5px; color:var(--ink-soft);}
.pub-links{display:flex; flex-wrap:wrap; gap:8px 20px; margin-top:14px;}
.pub-links a{font-size:15px; font-weight:600; color:var(--accent); text-decoration:none;}
.pub-links a:hover{text-decoration:underline; text-underline-offset:3px;}
@media (max-width:560px){ .pub{grid-template-columns:minmax(0,1fr); padding-left:20px;} }

/* ---- Writing: a mesh of tiles in four sizes (set per post in the admin) ---- */
.mesh{display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); grid-auto-rows:150px; gap:16px; grid-auto-flow:dense;}
.tile{
  display:flex; flex-direction:column; gap:10px; padding:20px; overflow:hidden;
  border-radius:var(--radius); background:var(--raised); box-shadow:inset 0 0 0 1px var(--line);
  color:var(--ink); text-decoration:none;
  transition:background .2s ease, box-shadow .2s ease;
}
.tile:hover{background:var(--wash-card), var(--hover); box-shadow:inset 0 0 0 1px var(--accent-line);}
.tile:hover h2, .tile:hover h3{color:var(--accent);}
.tile-date{display:flex; align-items:center; gap:10px; font-family:var(--font-mono); font-size:12px; color:var(--ink-faint);}
.tile-date::before{content:""; width:2px; height:14px; border-radius:2px; background:var(--line-strong);}
.tile h2, .tile h3{font-size:16px; line-height:1.35; transition:color .15s ease;}
.tile p{
  display:none; font-size:14.5px; line-height:1.55; color:var(--ink-soft);
  -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.tile-cta{margin-top:auto; font-size:14px; font-weight:600; color:var(--accent);}
.tile.wide{grid-column:span 2;}
.tile.tall{grid-row:span 2;}
.tile.wide p, .tile.tall p{display:-webkit-box;}
.tile.tall p{-webkit-line-clamp:7;}
.tile.feature{
  grid-column:span 2; grid-row:span 2; padding:28px;
  background:var(--wash-card), var(--raised); box-shadow:inset 0 0 0 1px var(--accent-line);
}
.tile.feature:hover{background:var(--wash-card), var(--wash-card), var(--hover);}
.tile.feature h2, .tile.feature h3{font-family:var(--font-heading); font-size:clamp(20px,2.4vw,25px); line-height:1.25;}
.tile.feature p{display:-webkit-box; -webkit-line-clamp:5; font-size:15.5px;}
@media (max-width:900px){ .mesh{grid-template-columns:repeat(3, minmax(0,1fr));} }
@media (max-width:640px){
  .mesh{grid-template-columns:repeat(2, minmax(0,1fr)); grid-auto-rows:auto;}
  .tile{grid-column:span 1 !important; grid-row:auto !important; min-height:150px;}
  .tile.feature{grid-column:span 2 !important;}
  .tile p{display:-webkit-box !important;}
}
@media (max-width:420px){ .mesh{grid-template-columns:minmax(0,1fr);} .tile.feature{grid-column:span 1 !important;} }

/* ---- Cards (Work, research infrastructure) ---- */
.card{border-radius:var(--radius); padding:24px; background:var(--raised); box-shadow:inset 0 0 0 1px var(--line);}
.card-title{display:flex; align-items:center; gap:12px; font-size:15px; line-height:1.3;}
.card-title svg{flex-shrink:0; color:var(--ink-faint);}
.infra-name{margin-top:14px; font-size:15px; color:var(--ink-soft);}
.stats{display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:12px; margin:22px 0 0;}
.stats div{display:flex; flex-direction:column; gap:4px;}
.stats dd{order:-1; margin:0; font-family:var(--font-heading); font-size:24px; line-height:1.1; color:var(--ink); font-variant-numeric:tabular-nums;}
.stats dt{font-size:13px; line-height:1.3; color:var(--ink-faint);}
.stack-tags{list-style:none; display:flex; flex-wrap:wrap; gap:6px; margin:22px 0 0; padding:0;}
.stack-tags li{font-family:var(--font-mono); font-size:11.5px; padding:4px 9px; border-radius:999px; background:var(--hover); color:var(--ink-soft);}
.button{
  display:flex; align-items:center; justify-content:center; gap:8px; margin-top:24px; padding:9px 14px;
  border-radius:10px; background:var(--surface); box-shadow:inset 0 0 0 1px var(--line-strong);
  font-size:14.5px; font-weight:600; color:var(--ink); text-decoration:none;
  transition:background .15s ease, color .15s ease;
}
.button:hover{background:var(--wash-card), var(--hover); color:var(--accent);}

/* ---- Experience: timeline beside the infrastructure card ---- */
.work-grid{display:grid; grid-template-columns:minmax(0,1fr) 19rem; gap:48px 56px; align-items:start;}
.work-grid .infra{position:sticky; top:88px;}
.timeline{list-style:none; margin:0; padding:0; border-left:1px solid var(--line-strong);}
.tl-row{display:grid; grid-template-columns:8.5rem minmax(0,1fr); gap:6px 24px; padding:0 0 44px 24px;}
.tl-row:last-child{padding-bottom:0;}
.tl-when{font-family:var(--font-mono); font-size:12.5px; color:var(--ink-faint); padding-top:3px;}
.tl-what h2{font-size:17px; line-height:1.35;}
.org{margin-top:2px; font-size:15px; font-weight:600; color:var(--accent);}
.tl-loc{color:var(--ink-faint); font-weight:400;}
.tl-body{margin-top:8px; font-size:15px; line-height:1.65; color:var(--ink-soft); max-width:60ch;}
@media (max-width:860px){
  .work-grid{grid-template-columns:minmax(0,1fr);}
  .work-grid .infra{position:static;}
}
@media (max-width:560px){ .tl-row{grid-template-columns:minmax(0,1fr); padding-left:20px;} }

/* ---- Footer ---- */
.site-footer{margin-top:72px; border-top:1px solid var(--line);}
.footer-inner{
  max-width:64rem; margin:0 auto; padding:36px 32px 44px;
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:24px;
}
.footer-nav{display:flex; flex-wrap:wrap; gap:8px 22px;}
.footer-nav a{font-size:14.5px; font-weight:600; color:var(--ink); text-decoration:none;}
.footer-nav a:hover{color:var(--accent);}
.footer-end{display:flex; flex-wrap:wrap; align-items:center; gap:16px 24px;}
.footer-links{display:flex; gap:4px;}
.footer-links a{display:inline-flex; width:36px; height:36px; align-items:center; justify-content:center; border-radius:8px; color:var(--ink-faint); transition:color .15s ease, background .15s ease;}
.footer-links a:hover{color:var(--accent); background:var(--accent-bg);}
.footer-links .icon svg{width:18px; height:18px;}
.footer-meta{font-size:14px; color:var(--ink-faint);}
@media (max-width:640px){ .footer-inner{padding:32px 16px 40px;} }

/* ---- Article page ---- */
.article-main{padding-top:56px;}
.article-col{position:relative; max-width:42rem; margin:0 auto;}
.back-button{
  display:flex; align-items:center; justify-content:center; width:40px; height:40px; margin-bottom:32px;
  border-radius:50%; color:var(--ink-soft); transition:color .15s ease;
}
.back-button:hover{color:var(--accent);}
@media (min-width:1080px){ .back-button{position:absolute; left:-96px; top:-4px; margin:0;} }

.article-header{margin-bottom:40px;}
.draft-note{
  display:inline-block; margin-bottom:24px; padding:6px 12px; border-radius:8px;
  background:var(--draft-bg); box-shadow:inset 0 0 0 1px rgb(217 119 6 / 0.45);
  font-size:14px; font-weight:600; color:var(--draft-ink);
}
.article-date{display:flex; align-items:center; gap:12px; font-size:15px; color:var(--ink-faint);}
.article-date::before{content:""; width:2px; height:16px; border-radius:2px; background:var(--line-strong);}
.article h1{margin-top:20px; font-family:var(--font-heading); font-size:clamp(32px,5vw,46px); line-height:1.12; letter-spacing:-0.015em;}
.article-byline{margin-top:18px; font-size:15px; color:var(--ink-soft);}

.prose{font-size:18px; line-height:1.75; color:var(--ink-body);}
.prose > :first-child{margin-top:0;}
.prose p{margin:0 0 1.2em;}
.prose h2{
  font-family:var(--font-heading); font-size:26px; line-height:1.25; color:var(--ink);
  margin:2.2em 0 0.7em; scroll-margin-top:80px;
}
.prose h3{font-size:20px; line-height:1.35; color:var(--ink); margin:1.8em 0 0.5em; scroll-margin-top:80px;}
.prose a{color:var(--accent); text-decoration:underline; text-decoration-color:var(--accent-line); text-underline-offset:3px;}
.prose a:hover{text-decoration-color:var(--accent);}
.prose strong{font-weight:600; color:var(--ink);}
.prose ul, .prose ol{margin:0 0 1.2em; padding-left:1.4em;}
.prose li + li{margin-top:0.45em;}
.prose li::marker{color:var(--ink-faint);}
.prose hr{border:0; height:1px; background:var(--line-strong); margin:2.6em 0;}
.prose blockquote{margin:1.6em 0; padding:2px 0 2px 20px; border-left:2px solid var(--accent); color:var(--ink-soft);}
.prose code{
  font-family:var(--font-mono); font-size:0.84em; padding:0.12em 0.4em;
  background:var(--code-bg); border-radius:6px; color:var(--ink);
}
.prose pre{
  margin:1.6em 0; padding:16px 18px; overflow-x:auto;
  background:var(--code-bg); border-radius:12px; box-shadow:inset 0 0 0 1px var(--line);
  font-size:15px; line-height:1.6;
}
.prose pre code{padding:0; background:none; font-size:inherit;}
.prose img{max-width:100%; height:auto;}
.prose figure{margin:2.2em 0; padding:8px; border-radius:var(--radius); background:var(--raised); box-shadow:inset 0 0 0 1px var(--line);}
.prose figure img{display:block; width:100%; border-radius:10px;}
.prose figcaption{padding:10px 6px 4px; font-size:14.5px; line-height:1.5; color:var(--ink-faint);}
.prose table{display:block; width:100%; overflow-x:auto; border-collapse:collapse; margin:1.8em 0; font-size:15.5px; line-height:1.5;}
.prose th, .prose td{padding:10px 12px; border-bottom:1px solid var(--line-strong); text-align:left; vertical-align:top;}
.prose th{font-weight:600; color:var(--ink); border-bottom-color:var(--accent-line);}
.article-foot{margin-top:48px; padding-top:24px; border-top:1px solid var(--line); font-size:15px; color:var(--ink-soft);}
.article-foot a{color:var(--accent); font-weight:600; text-decoration:none;}
.article-foot a:hover{text-decoration:underline; text-underline-offset:3px;}
@media (max-width:640px){
  .article-main{padding-top:36px;}
  .prose{font-size:17px;}
  .prose h2{font-size:23px;}
  .prose figure{padding:6px; margin:1.6em 0;}
}

/* ---- Motion: respect the visitor's reduced-motion setting ---- */
@media (prefers-reduced-motion:reduce){
  *, *::before, *::after{transition:none !important;}
  .glow{display:none;}
}
