/* Shared styles for the home and project pages. Same person as the galaxy site: its fonts (self-hosted) and its ink/amber palette,
   but plain, fast and easy to scan. No third-party anything. */
@import url("fonts/fonts.css");
@import url("fx.css");   /* the five quiet effects (assets/fx.js) */

:root {
  --bg: #06070b;
  --bg-2: #0a0c12;
  --panel: rgba(255,255,255,.028);
  --panel-2: rgba(255,255,255,.045);
  --line: rgba(238,242,248,.08);
  --line-2: rgba(238,242,248,.15);
  --ink: #eef2f8;
  --ink-dim: rgba(238,242,248,.84);   /* final polish: same reading tokens as the résumé page; every text colour is 7:1 or better */
  --ink-faint: rgba(238,242,248,.68);
  --amber: #e0a45c;
  --amber-hi: #f3c58c;
  --amber-glow: rgba(224,164,92,.22);
  --blue: #8fa8e8;
  --green: #7fd49a;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --r: 14px;
  --wrap: 1180px;
  --gut: clamp(16px, 4vw, 40px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--sans); font-weight: 300; font-size: 16px; line-height: 1.6;
  color: var(--ink); background: var(--bg);
  overflow-x: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: rgba(224,164,92,.35); color: #fff; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

/* ---------- the sky: two soft glows, a faint grid and a few stars (one quiet nod to the galaxy) ---------- */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sky::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 90vh;
  background:
    radial-gradient(42% 60% at 18% 0%, rgba(224,164,92,.13), transparent 70%),
    radial-gradient(38% 55% at 88% 6%, rgba(143,168,232,.11), transparent 70%);
}
.sky::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(238,242,248,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238,242,248,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 55% at 50% 0%, #000 0%, transparent 75%);
          mask-image: radial-gradient(70% 55% at 50% 0%, #000 0%, transparent 75%);
}
.stars { position: absolute; top: 0; left: 0; width: 1px; height: 1px; border-radius: 50%; background: transparent;
  box-shadow:
    12vw 8vh rgba(255,255,255,.5), 23vw 31vh rgba(255,255,255,.25), 37vw 12vh rgba(200,215,255,.45), 52vw 4vh rgba(255,255,255,.3),
    64vw 22vh rgba(255,255,255,.4), 71vw 9vh rgba(200,215,255,.55), 83vw 27vh rgba(255,255,255,.3), 91vw 14vh rgba(255,255,255,.45),
    6vw 44vh rgba(255,255,255,.2), 46vw 38vh rgba(200,215,255,.3), 77vw 41vh rgba(255,255,255,.22), 96vw 52vh rgba(255,255,255,.3),
    18vw 63vh rgba(255,255,255,.15), 58vw 71vh rgba(200,215,255,.18), 88vw 80vh rgba(255,255,255,.15), 31vw 88vh rgba(255,255,255,.12); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }

/* ---------- type ---------- */
.k { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.k.amber { color: var(--amber); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; line-height: 1.08; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.32rem; letter-spacing: -.01em; line-height: 1.2; }
p { color: var(--ink-dim); }
.mono { font-family: var(--mono); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: rgba(6,7,11,.72); border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; font-family: var(--serif); font-size: 1.12rem; letter-spacing: -.01em; white-space: nowrap; }
.brand img { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-2); }
.nav { display: flex; align-items: center; gap: .3rem; }
.nav a, .nav button { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); padding: .5rem .7rem; border-radius: 8px; transition: color .2s, background .2s; }
.nav a:hover, .nav button:hover { color: var(--ink); background: var(--panel-2); }
.nav .btn-sm { color: #1a1206; background: var(--amber); font-weight: 500; }
.nav .btn-sm:hover { background: var(--amber-hi); color: #1a1206; }
@media (max-width: 560px) { .nav .hide-s { display: none; } .nav a, .nav button { padding: .5rem .55rem; } }
/* Home: the first control in the bar on every inner page. A real button: outlined, house icon + word. */
.nav .nav-home { display: inline-flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .75rem; margin-right: .2rem;
  color: var(--ink); border: 1px solid var(--line-2); background: rgba(255,255,255,.035); }
.nav .nav-home svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav .nav-home:hover { color: var(--amber-hi); border-color: rgba(224,164,92,.55); background: rgba(224,164,92,.07); }
@media (max-width: 560px) {
  .nav .nav-home { width: 40px; height: 40px; padding: 0; justify-content: center; margin-right: 0; }
  .nav .nav-home svg { width: 17px; height: 17px; }
  .nav .nav-home span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 400px) { .brand { font-size: 1rem; gap: .5rem; } .top .wrap { gap: .5rem; } .nav { gap: .15rem; } }
/* narrow phones, inner pages: Home + Jump + Résumé + Contact leave no room for the name, so the bar keeps the avatar only */
@media (max-width: 460px) { .top:has(.nav-home) .brand { font-size: 0; gap: 0; } }
@media (max-width: 640px) { .top:has(.nav-home) .nav .hide-s { display: none; } }
@media (max-width: 360px) { .brand { font-size: 0; gap: 0; } }

/* Phones: every tappable control gets a hit area at least 40 px tall. Boxes grow where the look allows; small text
   links (breadcrumb, skill tags) get an invisible ::after hit area instead, with row gaps wide enough that no two overlap.
   Links inside running prose become inline blocks with the same invisible hit area (no other target shares their lines). */
@media (max-width: 760px) {
  .brand { min-height: 40px; min-width: 40px; }
  .nav a, .nav button { height: 40px; display: inline-flex; align-items: center; }
  .talk-copy { min-height: 40px; padding: 0 .8rem; }
  .foot nav { row-gap: 0; column-gap: 1.2rem; }
  .foot nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 40px; }
  footer.foot { padding-bottom: 6.5rem; }   /* clear of the fixed bottom controls */
  .crumb a, .sec .tags a.tag, .sec p a { position: relative; }
  .sec p a { display: inline-block; }
  .sec .tags:has(a.tag) { row-gap: 18px !important; }
  .sec p a::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 40px; transform: translateY(-50%); }
  /* Breadcrumb link and skill-tag links: the link's own box is 40 px tall (no pseudo-element, so nothing overflows it);
     negative block margins give the extra height back so the layout is the same as before. */
  .crumb a { display: inline-flex; align-items: center; min-height: 40px; margin-block: -11.3px; }
  .sec .tags a.tag { display: inline-flex; align-items: center; min-height: 40px; margin-block: -7.6px; border-color: transparent; background: none; isolation: isolate; }
  .sec .tags a.tag::before { content: ""; position: absolute; inset: 6.6px -1px; z-index: -1; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.02); }
}

/* floating shortcuts, bottom right (built by site.js) */
.fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 45;
  display: flex; flex-direction: column; gap: 6px; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .25s, transform .25s cubic-bezier(.2,.7,.2,1), visibility 0s .25s; }
.fab.on { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .25s cubic-bezier(.2,.7,.2,1), visibility 0s; }
.fab-b { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--ink-dim);
  border: 1px solid var(--line-2); background: rgba(10,12,18,.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -12px #000; transition: color .2s, border-color .2s, background .2s; }
.fab-b svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fab-b:hover { color: var(--amber-hi); border-color: rgba(224,164,92,.55); background: rgba(30,20,8,.85); }
html.lb-lock .fab { display: none; }
@media (prefers-reduced-motion: reduce) { .fab, .fab.on { transition: none; transform: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .55rem; height: 44px; padding: 0 1.15rem; border-radius: 10px;
  font-family: var(--mono); font-size: .74rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  transition: transform .2s, background .2s, border-color .2s, box-shadow .2s; white-space: nowrap; }
.btn.primary { background: linear-gradient(180deg, var(--amber-hi), var(--amber)); color: #1a1206; box-shadow: 0 8px 30px -10px rgba(224,164,92,.7), inset 0 1px 0 rgba(255,255,255,.4); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 34px -10px rgba(224,164,92,.85), inset 0 1px 0 rgba(255,255,255,.4); }
.btn.ghost { border: 1px solid var(--line-2); color: var(--ink); background: rgba(255,255,255,.02); }
.btn.ghost:hover { border-color: rgba(224,164,92,.55); background: rgba(224,164,92,.06); }
.arrow { transition: transform .2s; display: inline-block; }
a:hover .arrow, button:hover .arrow { transform: translateX(3px); }

/* ---------- contact reveal (address assembled only after a click; see site.js) ---------- */
.talk-box { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .7rem; padding: .7rem .85rem;
  border: 1px solid rgba(224,164,92,.4); border-radius: 12px; background: rgba(30,20,8,.55); max-width: 440px; }
.talk-box[hidden] { display: none; }
.talk-mail { font-family: var(--mono); font-size: .92rem; color: #fff; user-select: all; word-break: break-all; }
.talk-copy { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--amber);
  border: 1px solid rgba(224,164,92,.5); border-radius: 6px; padding: .3rem .6rem; }
.talk-copy:hover { background: rgba(224,164,92,.15); }
.talk-note { flex-basis: 100%; font-size: .78rem; color: var(--ink-dim); }
.pop { position: absolute; right: var(--gut); top: 64px; z-index: 60; box-shadow: 0 24px 60px -20px #000; background: rgba(22,15,7,.96); }

/* ---------- tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { font-family: var(--mono); font-size: .64rem; letter-spacing: .06em; color: var(--ink-dim); padding: .2rem .5rem;
  border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.02); white-space: nowrap; }

.status { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(127,212,154,.15), 0 0 10px rgba(127,212,154,.6); }
.status.amber i { background: var(--amber); box-shadow: 0 0 0 3px rgba(224,164,92,.15), 0 0 10px rgba(224,164,92,.5); }
.status.blue i { background: var(--blue); box-shadow: 0 0 0 3px rgba(143,168,232,.15), 0 0 10px rgba(143,168,232,.5); }
.status.off i { background: transparent; border: 1px dashed var(--ink-faint); box-shadow: none; }

/* ---------- reveal on scroll (only when JS is on; content is visible without it) ---------- */
.js .rv { opacity: 0; transform: translateY(14px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.js .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .rv { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 6rem; padding: 2.2rem 0 3rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.foot p, .foot a { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.foot a:hover { color: var(--amber); }
.foot nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* ---------- flow diagrams (a wide and a tall layout of the same diagram) ---------- */
.flow { width: 100%; height: auto; display: block; overflow: visible; }
.flow.tall { display: none; max-width: 420px; margin: 0 auto; }
@media (max-width: 700px) { .flow.wide { display: none; } .flow.tall { display: block; } }
.flow .col { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; fill: var(--ink-faint); }
.flow .nd rect { fill: #0c111d; stroke: rgba(143,168,232,.32); stroke-width: 1; }
.flow .nd .t { font-family: var(--serif); font-size: 15px; fill: var(--ink); }
.flow .nd .t.big { font-size: 22px; letter-spacing: -.01em; }
.flow .nd .s { font-family: var(--mono); font-size: 8.6px; letter-spacing: .12em; fill: rgba(238,242,248,.68); }
.flow .nd .it { font-family: var(--serif); font-style: italic; font-size: 13.5px; fill: var(--amber-hi); }
.flow .nd.core rect { fill: #121424; stroke: rgba(170,150,255,.6); stroke-width: 1.4; filter: drop-shadow(0 0 18px rgba(150,130,255,.25)); }
.flow .nd.hot rect { stroke: rgba(224,164,92,.75); fill: #1a140c; }
.flow .nd.calm rect { stroke: rgba(127,212,154,.45); }
.flow .nd.dog rect { stroke: rgba(127,212,212,.45); stroke-dasharray: 4 3; fill: #0b1416; }
.flow .live { fill: var(--green); animation: pulse 2.4s ease-in-out infinite; }
.flow .ln { fill: none; stroke: rgba(143,168,232,.38); stroke-width: 1.2; stroke-dasharray: 3 4; }
.flow .ln.out { stroke: rgba(224,164,92,.7); stroke-dasharray: none; stroke-width: 1.5; }
.flow .ln.quiet { stroke: rgba(127,212,154,.3); }
.flow .ln.dog, .flow .ln.loop { stroke: rgba(127,212,212,.4); }
.flow .pk { fill: #b9c8ff; filter: drop-shadow(0 0 4px rgba(143,168,232,.9)); }
.flow .pk.core { fill: #d2c6ff; }
.flow .pk.out { fill: var(--amber-hi); filter: drop-shadow(0 0 6px rgba(224,164,92,1)); }
.flow .pk.quiet { fill: var(--green); opacity: .7; }
.flow .pk.dog, .flow .pk.loop { fill: #8fe0dc; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .flow .pk { display: none; } .flow .live { animation: none; } }
.figure { border: 1px solid var(--line-2); border-radius: 18px; padding: clamp(1rem, 3vw, 2rem); overflow: hidden;
  background: radial-gradient(60% 70% at 62% 45%, rgba(150,130,255,.07), transparent 70%), linear-gradient(180deg, #080a11, #06070b); }
.figure figcaption { margin-top: 1rem; font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; color: var(--ink-faint); }
