/* ============================================================
    Igo Ventura — dev portfolio (layout experiment)
    Same Catppuccin Macchiato palette and mono voice as main, but a
    different shape: a narrow reading column with a sticky facts rail
    instead of a dashboard of equal cards. No terminal chrome, no
    typewriter, no scanlines.
    Everything is progressive enhancement: this file works with
    JS disabled, and motion is off under prefers-reduced-motion.
    ============================================================ */

/* ---------- 1. Tokens ----------
   Palette: Catppuccin Macchiato (https://catppuccin.com/palette).
   Names in comments are the upstream colour names; swap the flavour by
   re-mapping these, or just change --accent to another accent. */
:root {
  --bg:          #181926;  /* Crust  */
  --bg-grid:     rgba(138, 173, 244, 0.04);
  --surface:     #24273a;  /* Base   */
  --surface-2:   #2d3044;  /* Base lifted halfway toward Surface0 */
  --border:      #363a4f;  /* Surface0 */
  --border-hi:   #494d64;  /* Surface1 */
  --fg:          #b8c0e0;  /* Subtext1 */
  --fg-bright:   #cad3f5;  /* Text     */
  --fg-dim:      #a5adcb;  /* Subtext0 */
  --muted:       #939ab7;  /* Overlay2 */
  --accent:      #8aadf4;  /* Blue   */
  --on-accent:   #181926;  /* text on accent-filled surfaces */
  --accent-soft: rgba(138, 173, 244, 0.14);
  --accent-glow: rgba(138, 173, 244, 0.28);
  --danger:      #ed8796;  /* Red    */
  --warn:        #eed49f;  /* Yellow */

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", monospace;

  /* The page is one reading column plus a rail. --col is the column,
     not the whole page: prose stays near a comfortable measure and the
     rail takes what's left. */
  --col:     760px;
  --rail-w:  260px;
  --gap:     3rem;
  --measure: 68ch;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 6px;

  --nav-h: 3.25rem;
  --dur: 220ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1.5rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: clamp(0.92rem, 0.35vw + 0.85rem, 1rem);
  line-height: 1.75;
  font-feature-settings: "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Faint grid paper. Sits above the flat colour, below all content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right,  var(--bg-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--bg-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

/* Links inside running text need more than a colour change to stand out. */
p a:not(.btn):not(.email),
li a:not(.btn) {
  text-decoration: underline;
  text-decoration-color: var(--border-hi);
  text-underline-offset: 3px;
}
p a:not(.btn):not(.email):hover,
li a:not(.btn):hover { text-decoration-color: currentColor; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

code {
  font-family: inherit;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  color: var(--fg);
  font-size: 0.92em;
}

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

/* ---------- 3. Utilities ---------- */
.container {
  width: 100%;
  max-width: calc(var(--col) + var(--rail-w) + var(--gap));
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  font-weight: 700;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- 4. Blinking cursor ---------- */
.cursor {
  color: var(--accent);
  margin-left: 0.15em;
  animation: blink 1.1s steps(1, end) infinite;
}
@keyframes blink {
  0%, 49%  { opacity: 1; }
  50%, 100%{ opacity: 0; }
}

/* ---------- 5. Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(24, 25, 38, 0.82);  /* Crust, translucent for the blur */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  color: var(--fg);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-tld { color: var(--accent); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg-dim);
  font-size: 0.8rem;
}
.nav-toggle:hover { border-color: var(--border-hi); color: var(--fg); }
.nav-toggle-icon {
  width: 14px; height: 10px;
  position: relative;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: currentColor;
  transition: transform var(--dur) var(--ease);
}
.nav-toggle-icon::before { top: 1px; }
.nav-toggle-icon::after  { bottom: 1px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after  { transform: translateY(-3.5px) rotate(-45deg); }

.nav-menu {
  display: none;
}
.nav-menu.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem var(--gutter) 1.25rem;
  gap: 0.25rem;
}
.nav-menu li { display: block; }
.nav-menu a {
  display: inline-block;
  padding: 0.4rem 0;
  color: var(--fg-dim);
  font-size: 0.9rem;
}
.nav-menu a:hover { color: var(--accent); text-decoration: none; }
.nav-menu a.is-current { color: var(--accent); }
.nav-menu a.is-current::before { content: "▸ "; }

@media (min-width: 720px) {
  .nav-toggle { display: none; }
  .nav-menu,
  .nav-menu.is-open {
    display: flex;
    flex-direction: row;
    position: static;
    background: none;
    border: 0;
    padding: 0;
    gap: 1.4rem;
    align-items: center;
  }
  .nav-menu a { padding: 0.35rem 0; border-bottom: 1px solid transparent; }
  .nav-menu a.is-current { border-bottom-color: var(--accent); }
  .nav-cta {
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.35rem 0.85rem !important;
    color: var(--accent) !important;
  }
  .nav-cta:hover { background: var(--accent-soft); }
  .nav-cta.is-current::before { content: ""; }
}

/* ---------- 6. Shell: reading column + sticky rail ----------
   <main> is the grid. Masthead spans both tracks; below it the
   sections sit in the reading column and the rail sticks in the
   right one. Under 1100px everything is one column and the rail
   lands directly under the masthead, where the quick facts still
   do their job. */
.main {
  width: 100%;
  max-width: calc(var(--col) + var(--rail-w) + var(--gap));
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  position: relative;
  z-index: 1;
}

.masthead { grid-column: 1; grid-row: 1; }
.rail     { grid-column: 1; grid-row: 2; }
.flow     { grid-column: 1; grid-row: 3; min-width: 0; }

@media (min-width: 1100px) {
  .main {
    grid-template-columns: minmax(0, var(--col)) var(--rail-w);
    column-gap: var(--gap);
  }
  .masthead { grid-column: 1 / -1; }
  .flow     { grid-column: 1; grid-row: 2; }
  .rail {
    grid-column: 2;
    grid-row: 2;
    position: sticky;
    top: calc(var(--nav-h) + 1.75rem);
    align-self: start;
  }
}

/* ---------- 7. Masthead ---------- */
.masthead { padding-block: clamp(2.5rem, 8vw, 4.5rem) clamp(1.75rem, 5vw, 3rem); }

.masthead-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.masthead-name {
  font-size: clamp(2.6rem, 9vw, 4.9rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  font-weight: 700;
  margin: 0.4rem 0 0.9rem;
  color: var(--fg-bright);
}

.masthead-lede {
  max-width: var(--measure);
  color: var(--fg-dim);
}

.masthead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  margin-top: 1.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.masthead-meta li { position: relative; padding-left: 0.9rem; }
.masthead-meta li::before { content: "·"; position: absolute; left: 0; color: var(--border-hi); }
.masthead-meta li:first-child { padding-left: 0; }
.masthead-meta li:first-child::before { content: ""; }

.masthead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.75rem;
}

/* ---------- 8. Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.55rem 1.05rem;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--fg);
  font-size: 0.85rem;
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-primary {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.btn-primary:hover { background: rgba(138, 173, 244, 0.22); }

/* ---------- 9. Facts rail ---------- */
.rail {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 1.15rem;
  margin-bottom: 1.5rem;
}
.rail-avatar {
  width: 112px;
  border-radius: 4px;
  border: 1px solid var(--border-hi);
  margin-bottom: 1rem;
}
.facts > div {
  display: flex;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
}
.facts > div:first-child { border-top: 0; }
.facts dt {
  color: var(--muted);
  min-width: 5.5rem;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding-top: 0.15rem;
}
.facts dd { margin: 0; color: var(--fg); }

.rail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
}

@media (min-width: 1100px) { .rail { margin-bottom: 0; } }

/* ---------- 10. Sections ---------- */
.section { padding-block: clamp(2.25rem, 6vw, 3.75rem); }
.section + .section { border-top: 1px solid var(--border); }

.section-title {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.section-title::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 0.75rem;
  background: linear-gradient(to right, var(--border-hi), transparent);
}

.section-lede {
  color: var(--muted);
  max-width: var(--measure);
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}

/* ---------- 11. About ---------- */
.about-prose p { max-width: var(--measure); color: var(--fg-dim); }
.about-prose p + p { margin-top: 1.1rem; }
.about-prose p:first-child::first-letter {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- 12. Now ----------
   Labelled rows: a status line, not four boxes competing with
   ~/projects for the same attention. */
.now-list { display: grid; }
.now-row {
  display: grid;
  gap: 0.3rem 1.5rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--border);
}
.now-row:first-child { border-top: 0; padding-top: 0; }
.now-row dt {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.now-row dd { margin: 0; color: var(--fg-dim); font-size: 0.9rem; max-width: var(--measure); }
.now-row em { color: var(--fg); font-style: italic; }
@media (min-width: 720px) {
  .now-row { grid-template-columns: 9.5rem minmax(0, 1fr); }
}

.live-dot {
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 8px rgba(138, 173, 244, 0); }
  100% { box-shadow: 0 0 0 0 rgba(138, 173, 244, 0); }
}

/* ---------- 13. Projects ----------
   Two featured entries with room to breathe, then the rest as
   rows. A uniform grid made the 2021 npm package weigh the same
   as the flagship. */
.featured { display: grid; gap: 1rem; }

.card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 1.25rem;
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 0 28px -6px var(--accent-glow);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.card-title { font-size: 1.05rem; letter-spacing: -0.01em; }
.card-title a { color: var(--fg-bright); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-year { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }

.card-desc { font-size: 0.88rem; color: var(--fg-dim); flex: 1; max-width: 62ch; }

.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tags li {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  color: var(--fg-dim);
  background: var(--surface-2);
}
.card:hover .tags li { border-color: var(--border-hi); }

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
}
.card-links a { color: var(--muted); }
.card-links a:hover { color: var(--accent); }

.work-list { margin-top: 1.25rem; }
.work-row {
  display: grid;
  gap: 0.5rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}
.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.work-title { font-size: 1rem; letter-spacing: -0.01em; }
.work-title a { color: var(--fg-bright); }
.work-title a:hover { color: var(--accent); text-decoration: none; }
.ext { color: var(--muted); font-size: 0.8em; }
.work-year { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.work-desc { font-size: 0.88rem; color: var(--fg-dim); max-width: 62ch; }
.work-row .tags li { background: transparent; }

/* ---------- 14. Stack (skills) ----------
   Definition list instead of a pill wall: the category is the
   heading, the items are data. */
.stack { display: grid; }
.stack-row {
  display: grid;
  gap: 0.25rem 1.5rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
}
.stack-row:first-child { border-top: 0; padding-top: 0; }
.stack-row dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.stack-row dd { margin: 0; color: var(--fg-dim); font-size: 0.88rem; }
@media (min-width: 720px) {
  .stack-row { grid-template-columns: 12rem minmax(0, 1fr); }
}

.spoken {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 0.85rem 1.2rem;
  font-size: 0.85rem;
  color: var(--fg-dim);
}
.spoken-key {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  margin-right: 0.75rem;
}

/* ---------- 15. Experience ----------
   Dates in their own column rather than a timeline spine: same
   information, aligned, and it scans in one vertical pass. */
.timeline { display: grid; }
.entry {
  display: grid;
  gap: 0.4rem 1.5rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--border);
}
.entry:first-child { border-top: 0; padding-top: 0.25rem; }
.entry-dates {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}
.entry-body { min-width: 0; }
.entry-role { font-size: 1.05rem; color: var(--fg-bright); }
.entry-org { color: var(--accent); font-size: 0.85rem; margin-top: 0.1rem; }
.entry-points { margin-top: 0.65rem; }
.entry-points li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--fg-dim);
  margin-bottom: 0.45rem;
}
.entry-points li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
}
@media (min-width: 760px) {
  .entry { grid-template-columns: 11rem minmax(0, 1fr); }
}

.arrow { color: var(--muted); font-weight: 400; }

.earlier {
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 1.15rem 1.2rem;
}
.earlier h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.earlier-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.1rem 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px dashed var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}
.earlier-list li:first-child { border-top: 0; }
.e-org { color: var(--fg); font-weight: 500; }
.e-role::before { content: "— "; }
.e-dates { font-variant-numeric: tabular-nums; }
@media (min-width: 640px) {
  .earlier-list li {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    align-items: baseline;
  }
  .e-dates { text-align: right; white-space: nowrap; }
}

.cred-grid {
  display: grid;
  gap: 1.5rem 2rem;
  margin-top: 2rem;
}
@media (min-width: 720px) { .cred-grid { grid-template-columns: 1fr 1fr; } }

.cred h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.cred-item { font-size: 0.85rem; color: var(--fg-dim); }
.cred-item strong { color: var(--fg); }
.cred-list li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--fg-dim);
  margin-bottom: 0.4rem;
}
.cred-list li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- 16. Contact ---------- */
.contact-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 860px) { .contact-grid { grid-template-columns: minmax(0,1fr) 300px; } }

.contact-prose p { color: var(--fg-dim); max-width: 58ch; }

.email-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem !important;
}
.email {
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 500;
  border-bottom: 1px dashed var(--accent);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 0.75rem;
  color: var(--fg-dim);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.is-done { border-color: var(--accent); color: var(--accent); }
.copy-icon { display: block; flex: none; }

.social {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 1.15rem;
}
.social li {
  display: flex;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
}
.social li:first-child { border-top: 0; }
.social-key {
  color: var(--muted);
  min-width: 5rem;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding-top: 0.2rem;
}

/* ---------- 17. Status strip ----------
   Kept while the experience numbers are missing; delete this
   block and the .construction markup in index.html together. */
.construction {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, rgba(238, 212, 159, 0.07), transparent);
}
.construction-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.9rem;
  padding-block: 0.7rem;
}
.construction-tag {
  flex: none;
  padding: 0.2rem 0.45rem;
  border: 1px dashed rgba(238, 212, 159, 0.45);
  border-radius: 3px;
  background: rgba(238, 212, 159, 0.07);
  color: var(--warn);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.construction-note {
  font-size: 0.82rem;
  color: var(--fg-dim);
}
.construction-note a { color: var(--warn); }
.construction-note a:hover { color: var(--warn); text-decoration: none; }

/* ---------- 18. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.5rem 2.5rem;
  margin-top: 1rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}
.footer-note a { color: var(--fg-dim); }
.footer-note a:hover { color: var(--accent); }

/* "built with OpenCode" badge */
.site-footer a.built-with {
  color: var(--fg-dim);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  white-space: nowrap;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.site-footer a.built-with:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.built-with .oc { color: var(--accent); font-weight: 500; }
.built-with:hover .oc { color: inherit; }

/* ---------- 19. Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 120%);
  z-index: 80;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  opacity: 0;
  visibility: hidden;
  transition: transform 260ms var(--ease),
              opacity 200ms var(--ease),
              visibility 0s linear 260ms;
  pointer-events: none;
}
.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: transform 260ms var(--ease),
              opacity 200ms var(--ease),
              visibility 0s;
}

/* ---------- 20. Back to top ---------- */
.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border-hi);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font-size: 1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              visibility var(--dur);
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- 21. Scroll reveal (only when JS is on) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 550ms var(--ease), transform 550ms var(--ease);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 22. Local-only sections (env flag) ----------
   The inline script in index.html marks <html> with `local` or `remote`.
   Anything tagged `data-local-only` is hidden on the deployed site; with
   JavaScript off neither class is set, so the page stays complete — the
   same rule the .js gating in section 21 follows. Tag the section, its
   nav entry and any button that points at it. */
.remote [data-local-only] { display: none !important; }

/* With ./projects out of the masthead, ./contact takes over as the primary. */
.remote .masthead-actions .btn:last-child {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

/* Shown only when viewing locally, so it is obvious what the deploy hides. */
.local-flag {
  display: none;
  margin-right: 0.6rem;
  padding: 0.15rem 0.45rem;
  border: 1px dashed var(--border-hi);
  border-radius: 3px;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.local .local-flag { display: inline-block; }

/* ---------- 23. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .cursor { animation: none; opacity: 1; }
  .live-dot { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
  .btn:hover { transform: none; }
}

/* ---------- 24. Print ----------
   Re-map the tokens rather than overriding component by component:
   the old per-component list left --fg / --muted text printing as
   pale grey on white. */
@media print {
  :root {
    --bg:        #fff;
    --bg-grid:   transparent;
    --surface:   #fff;
    --surface-2: #fff;
    --border:    #ccc;
    --border-hi: #999;
    --fg:        #111;
    --fg-bright: #111;
    --fg-dim:    #333;
    --muted:     #555;
    --accent:    #111;
    --on-accent: #fff;
    --warn:      #333;
  }
  body { background: #fff; color: #111; }
  .site-header, .to-top, .toast, .masthead-actions,
  .copy-btn, .cursor, .construction,
  .local-flag { display: none !important; }
  .main { display: block; max-width: none; }
  .rail { position: static; margin: 0 0 1.5rem; }
  .rail-avatar { border-color: #ccc; }
  a { color: #111; }
  .entry, .now-row, .stack-row, .work-row, .card { break-inside: avoid; }
}
