/* Luke Gelfius portfolio. Plain CSS, no build step. */

:root {
  --paper: #f2f5f8;
  --panel: #ffffff;
  --ink: #0f1c2b;
  --muted: #4b5d75;
  --rule: #d3dce5;
  --accent: #1458c8;
  --accent-ink: #0b3c8c;
  --scope-bg: #06121d;
  --scope-grid: rgba(98, 242, 169, 0.14);
  --phosphor: #62f2a9;
  --focus: #1458c8;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 66ch;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a121c;
    --panel: #101c2a;
    --ink: #e7eef6;
    --muted: #9aabc0;
    --rule: #223246;
    --accent: #7fb0ff;
    --accent-ink: #a9c8ff;
    --focus: #9cc2ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, iframe, svg, canvas { max-width: 100%; display: block; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); text-decoration-thickness: 2px; }

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

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; z-index: 10; border-radius: 4px;
}
.skip:focus { top: 0.75rem; }

.wrap { width: min(100% - 2 * var(--gutter), 70rem); margin-inline: auto; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 0.5rem 2rem; padding-block: 1rem;
}
.brand {
  font-family: var(--display); font-weight: 700; font-size: 1.2rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding-block: 0.25rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }

/* Hero */
.hero {
  border-bottom: 1px solid var(--rule);
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 2rem 2rem;
  background-position: -1px -1px;
}
.hero .wrap {
  display: grid; gap: 2.5rem; align-items: center;
  grid-template-columns: minmax(0, 1fr);
  padding-block: clamp(2.5rem, 7vw, 5rem);
}
@media (min-width: 62rem) {
  .hero .wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 4rem; }
}
.hero-copy { background: var(--paper); padding: 0.25rem 1.25rem 1.25rem 0; }
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.8rem, 8vw, 5.25rem); line-height: 0.98;
  letter-spacing: -0.03em; margin: 0 0 1.25rem;
}
.hero .lede { font-size: 1.2rem; max-width: 36ch; color: var(--muted); margin: 0 0 1.75rem; }
.hero .lede strong { color: var(--ink); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-block; padding: 0.7rem 1.2rem; border-radius: 6px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none;
  border: 2px solid var(--ink); color: var(--ink); background: transparent;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn.primary { color: #06121d; }
  .btn.primary:hover { color: #06121d; }
}

/* Oscilloscope */
.scope {
  background: var(--scope-bg); border-radius: 12px; padding: 0.9rem;
  border: 1px solid #1c3a33; box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 18px 40px -22px rgba(0,0,0,0.55);
}
.scope canvas {
  width: 100%; aspect-ratio: 16 / 10; border-radius: 6px; cursor: crosshair;
  touch-action: pan-y; background: var(--scope-bg);
}
.scope canvas:focus-visible { outline-color: var(--phosphor); }
.scope-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1rem; padding: 0.75rem 0.25rem 0.1rem; color: #b7e9d2; font-size: 0.9rem;
}
.readout { font-variant-numeric: tabular-nums; display: flex; gap: 1.25rem; }
.readout span b { color: var(--phosphor); font-weight: 600; }
.sound {
  background: transparent; color: var(--phosphor); border: 1px solid var(--phosphor);
  border-radius: 6px; padding: 0.35rem 0.8rem; font: inherit; cursor: pointer;
}
.sound:hover, .sound[aria-pressed="true"] { background: var(--phosphor); color: #06121d; }
.sound:focus-visible { outline-color: #fff; }
.scope-hint { color: var(--muted); font-size: 0.9rem; margin: 0.75rem 0 0; }

/* Sections */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section + .section { border-top: 1px solid var(--rule); }
.section h2 {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.1; margin: 0 0 0.5rem;
}
.section .intro { color: var(--muted); max-width: var(--measure); margin: 0 0 2rem; }

/* Education */
.edu { display: grid; gap: 1.25rem; grid-template-columns: 1fr; max-width: 46rem; }
@media (min-width: 40rem) { .edu { grid-template-columns: 1fr 1fr; max-width: none; } }
.edu-item { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.1rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); }
.edu-item img { width: 56px; height: 56px; object-fit: contain; border-radius: 6px; background: #fff; padding: 4px; flex: none; }
.edu-item .ph { width: 56px; height: 56px; flex: none; border-radius: 6px; background: var(--rule); }
.edu-item h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.edu-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Project list */
.projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.project {
  position: relative; display: grid; gap: 0.35rem 2rem;
  grid-template-columns: minmax(0, 1fr);
  padding: 1.5rem 0.75rem; border-bottom: 1px solid var(--rule);
}
@media (min-width: 46rem) { .project { grid-template-columns: 11rem minmax(0, 1fr); } }
.project:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.project .when { color: var(--muted); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.project h3 {
  font-family: var(--display); font-weight: 600; font-size: 1.4rem;
  line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.15rem;
}
.project h3 a { color: var(--ink); text-decoration: none; }
.project h3 a::after { content: ""; position: absolute; inset: 0; }
.project h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.project .org { color: var(--muted); font-size: 0.95rem; margin: 0 0 0.5rem; }
.project .sum { margin: 0 0 0.6rem; max-width: var(--measure); }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.tags li { font-size: 0.82rem; padding: 0.1rem 0.6rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); background: var(--panel); }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.1rem 0.6rem; border-radius: 999px; margin-left: 0.5rem; vertical-align: 0.15em; background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .badge { color: #06121d; } }

/* Experience detail pages */
.page-head h1 .badge { font-family: var(--body); letter-spacing: 0; font-size: 0.9rem; margin-left: 0.75rem; vertical-align: 0.6em; }
.page-head + .section .wrap > .tags { margin-top: 1.5rem; }

/* More tiles */
.more { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 46rem) { .more { grid-template-columns: repeat(2, 1fr); } }
.tile { display: block; padding: 1.25rem 1.3rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--accent); color: var(--ink); }
.tile h3 { font-family: var(--display); font-size: 1.2rem; margin: 0 0 0.35rem; letter-spacing: -0.01em; }
.tile p { margin: 0; color: var(--muted); font-size: 0.97rem; }

/* Detail pages */
.page-head { border-bottom: 1px solid var(--rule); padding-block: clamp(2rem, 5vw, 3.5rem) 2rem; }
.crumb { font-size: 0.92rem; margin: 0 0 1.25rem; }
.page-head h1 {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.025em;
  font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.04; margin: 0 0 0.75rem; max-width: 20ch;
}
.meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; color: var(--muted); margin: 0; font-size: 0.98rem; }
.meta strong { color: var(--ink); font-weight: 600; }

.prose { max-width: var(--measure); }
.prose h2 { font-size: 1.5rem; margin: 2.25rem 0 0.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--display); font-size: 1.15rem; margin: 1.75rem 0 0.35rem; }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.1rem; }
.prose li { margin-bottom: 0.3rem; }
.prose .note { border-left: 4px solid var(--accent); padding: 0.25rem 0 0.25rem 1rem; color: var(--muted); }
.parts { columns: 2 16rem; column-gap: 2rem; }

.gallery { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); margin: 2rem 0 0; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 8px; background: #fff; }
.gallery figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.4rem; }
.video { aspect-ratio: 16 / 9; width: 100%; max-width: 46rem; border: 0; border-radius: 8px; background: #000; }
.embed { width: 100%; height: 26rem; border: 1px solid var(--rule); border-radius: 8px; background: #fff; }

.people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.people a, .people span { display: inline-block; padding: 0.3rem 0.8rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--panel); text-decoration: none; font-size: 0.95rem; }
.people a:hover { border-color: var(--accent); }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 1.25rem; margin-top: 1rem; margin-bottom: 3.5rem; }
.pager a { max-width: 22rem; }
.pager small { display: block; color: var(--muted); }

/* Tables */
table.data { border-collapse: collapse; width: 100%; max-width: 46rem; font-size: 0.97rem; }
table.data th, table.data td { text-align: left; padding: 0.7rem 0.9rem 0.7rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data th { font-weight: 600; border-bottom-color: var(--ink); }
table.data td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }

.team-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); max-width: 46rem; }
.team-list li { display: grid; gap: 0.15rem 1.5rem; padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 40rem) { .team-list li { grid-template-columns: 14rem 1fr; } }
.team-list .what { color: var(--muted); font-size: 0.95rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding-block: 2rem 3rem; color: var(--muted); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .scope, .site-footer, .pager { display: none; }
  body { background: #fff; color: #000; }
}
