/* ==========================================================
   Eamonn Kerins — personal site
   Palette: deep-space navy, starlight ivory, Einstein-ring gold
   ========================================================== */
:root {
  --bg: #070b16;
  --bg-2: #0c1324;
  --surface: #111a30;
  --surface-2: #17223d;
  --line: rgba(180, 196, 230, 0.14);
  --text: #eef1f8;
  --muted: #a6b0c8;
  --faint: #7482a1;
  --gold: #f2b84b;
  --gold-soft: rgba(242, 184, 75, 0.14);
  --teal: #5fd4c4;
  --teal-soft: rgba(95, 212, 196, 0.12);
  --rose: #f08a8a;
  --radius: 14px;
  --maxw: 1160px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffd083; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #111; padding: 8px 14px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 12px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* ---------- starfield ---------- */
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: .75; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(95, 212, 196, 0.10), transparent 60%),
    radial-gradient(800px 600px at -10% 30%, rgba(242, 184, 75, 0.07), transparent 60%),
    var(--bg);
}

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: rgba(7, 11, 22, 0.72);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; letter-spacing: .01em; }
.brand-sub { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; line-height: 1.1; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--gold); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; cursor: pointer; }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; padding: 12px 16px 18px; background: rgba(7, 11, 22, 0.97); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
}

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 62ch; }
.eyebrow { font-family: var(--mono); font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--teal); margin-bottom: 14px; display: inline-block; }
.gold { color: var(--gold); }
em.hl { font-style: normal; color: var(--gold); }

/* ---------- sections ---------- */
section { padding: 84px 0; }
section.tight { padding: 56px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--muted); max-width: 56ch; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }
.split-a { grid-template-columns: 1fr 1.2fr; }
.split-b { grid-template-columns: 1.4fr 1fr; align-items: end; }
@media (max-width: 900px) { .hero-grid, .split-a, .split-b { grid-template-columns: 1fr; gap: 36px; } .split-b .portrait { max-width: 320px; } }
.hero h1 .accent { color: var(--gold); font-style: italic; font-weight: 500; }
.hero .roles { list-style: none; padding: 0; margin: 22px 0 30px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8rem; font-weight: 500; color: var(--text);
  background: var(--surface); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 999px;
}
.chip.gold { background: var(--gold-soft); border-color: rgba(242,184,75,.35); color: #ffd99a; }
.chip.teal { background: var(--teal-soft); border-color: rgba(95,212,196,.35); color: #a8efe5; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1px solid transparent; transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: #1a1204; }
.btn-primary:hover { background: #ffc867; color: #1a1204; }
.btn-ghost { border-color: var(--line); color: var(--text); background: rgba(255,255,255,.02); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.portrait {
  position: relative; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  aspect-ratio: 4 / 5;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 14px;
  font-size: .8rem; color: #dfe4f0;
  background: linear-gradient(transparent, rgba(5,8,16,.9));
}
.portrait.small { aspect-ratio: 1 / 1; }

/* ---------- lensing figure ---------- */
.lens-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.lens-card svg { width: 100%; height: auto; display: block; }
.lens-card .cap { font-size: .82rem; color: var(--muted); margin-top: 10px; }
.lens-card .params { display: block; margin-top: 6px; font-size: .74rem; color: var(--faint); }

.k2fig { margin: 8px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.k2grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.k2grid svg { width: 100%; height: auto; display: block; }
@media (max-width: 800px) { .k2grid { grid-template-columns: 1fr; } }
.k2fig .cap { font-size: .88rem; color: var(--muted); margin-top: 14px; max-width: 95ch; }
.k2fig .params { display: block; margin-top: 8px; font-size: .76rem; color: var(--faint); }

/* ---------- video ---------- */
.video { margin: 20px 0 6px; max-width: 760px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { font-size: .82rem; color: var(--faint); margin-top: 8px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--bg-2); padding: 26px 22px; }
.stat .num { font-family: var(--serif); font-size: clamp(1.9rem, 3.4vw, 2.6rem); color: var(--gold); line-height: 1; font-weight: 600; }
.stat .lbl { color: var(--muted); font-size: .88rem; margin-top: 10px; line-height: 1.45; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .g3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } }
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; position: relative; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: rgba(242,184,75,.35); }
.card h3 { margin-bottom: .35em; }
.card p { color: var(--muted); font-size: .96rem; }
.card .meta { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-bottom: 12px; display: block; }
.card .more { font-weight: 600; font-size: .9rem; text-decoration: none; }
.card .more::after { content: " →"; }
.card.feature { border-color: rgba(242,184,75,.3); background: linear-gradient(160deg, rgba(242,184,75,.10), var(--bg-2) 55%); }
.icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); margin-bottom: 16px; }
.icon svg { width: 22px; height: 22px; }

/* ---------- project detail blocks ---------- */
.project { display: grid; grid-template-columns: 240px 1fr; gap: 40px; padding: 44px 0; border-top: 1px solid var(--line); }
.project:first-of-type { border-top: 0; }
@media (max-width: 800px) { .project { grid-template-columns: 1fr; gap: 12px; } }
.project .side .period { font-family: var(--mono); color: var(--gold); font-size: .85rem; }
.project .side .role { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.project h3 { font-size: 1.6rem; }
.project ul { padding-left: 1.1em; color: var(--muted); }
.project li { margin-bottom: .4em; }
.project li strong { color: var(--text); font-weight: 600; }
.project .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ---------- pubs ---------- */
.pub { display: grid; grid-template-columns: 64px 1fr; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); }
.pub:first-child { border-top: 0; }
.pub .yr { font-family: var(--mono); color: var(--gold); font-size: .95rem; padding-top: 2px; }
.pub .title { font-weight: 600; color: var(--text); font-size: 1.05rem; }
.pub .journal { color: var(--faint); font-size: .88rem; }
.pub .why { color: var(--muted); font-size: .94rem; margin: 6px 0 0; }
.pub a.title { text-decoration: none; }
.pub a.title:hover { color: var(--gold); }

/* ---------- media timeline ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.filters button {
  font: inherit; font-size: .85rem; cursor: pointer;
  color: var(--muted); background: var(--surface); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px;
}
.filters button[aria-pressed="true"] { color: #1a1204; background: var(--gold); border-color: var(--gold); font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 96px 190px 1fr; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); align-items: baseline; }
.timeline li[hidden] { display: none; }
.timeline .d { font-family: var(--mono); font-size: .82rem; color: var(--faint); }
.timeline .o { font-weight: 600; font-size: .95rem; }
.timeline .t { color: var(--muted); font-size: .95rem; }
.timeline .t a { color: var(--text); text-decoration-color: var(--gold); }
.timeline .t a:hover { color: var(--gold); }
@media (max-width: 700px) {
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}

.logos { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; color: var(--muted); font-family: var(--serif); font-size: 1.15rem; }
.logos span { opacity: .85; white-space: nowrap; }

/* ---------- quote / callout ---------- */
.callout {
  border-left: 3px solid var(--gold); padding: 18px 22px; background: var(--gold-soft);
  border-radius: 0 var(--radius) var(--radius) 0; color: var(--text);
}
.callout p:last-child { margin: 0; }

/* ---------- bio boxes ---------- */
.bio { position: relative; }
.bio pre {
  white-space: pre-wrap; font-family: var(--sans); font-size: .96rem; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin: 0;
}
.copy-btn {
  position: absolute; top: 10px; right: 10px; font: inherit; font-size: .78rem; cursor: pointer;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px;
}
.copy-btn:hover { border-color: var(--gold); }

.topics { columns: 2; column-gap: 32px; padding-left: 1.1em; color: var(--muted); }
.topics li { margin-bottom: .45em; break-inside: avoid; }
@media (max-width: 640px) { .topics { columns: 1; } }

/* ---------- page header ---------- */
.page-head { padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 36px; margin-top: 40px; background: rgba(7,11,22,.6); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-family: var(--mono); font-weight: 500; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); text-decoration: none; font-size: .93rem; }
.site-footer a:hover { color: var(--gold); }
.fine { color: var(--faint); font-size: .8rem; margin-top: 32px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  #stars { display: none; }
  .anim { animation: none !important; }
}
.no-js .reveal { opacity: 1; transform: none; }

@media print {
  #stars, .site-header, .nav-toggle, .filters, .copy-btn { display: none !important; }
  body { background: #fff; color: #111; }
  body::before { display: none; }
  .card, .stat, .lens-card { background: #fff !important; border-color: #ccc; }
  .lede, .card p, .muted { color: #333; }
}
