:root {
  color-scheme: dark;
  --bg: #070d13;
  --panel: #0c1721;
  --panel-2: #102030;
  --line: rgba(200, 214, 226, 0.12);
  --line-strong: rgba(200, 214, 226, 0.24);
  --text: #e6eef4;
  --muted: #93a7b7;
  --silver: #c8d3dc;
  --cyan: #2fd0e0;
  --cyan-soft: rgba(47, 208, 224, 0.16);
  --green: #4ee08a;
  --amber: #f5b85a;
  --radius: 14px;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
.wrap { width: min(1360px, 100% - 40px); margin-inline: auto; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; padding: 8px 14px; border-radius: 8px; background: var(--cyan); color: #04121a; font-weight: 700; }

/* Blueprint grid background with a slow scan line */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1100px 560px at 75% -12%, rgba(47, 208, 224, 0.18), transparent 62%),
    linear-gradient(rgba(47, 208, 224, 0.065) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(47, 208, 224, 0.065) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg);
  animation: drift 90s linear infinite;
}
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, transparent 35%, var(--bg) 85%);
}
.bg::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 160px;
  background: linear-gradient(180deg, transparent, rgba(47, 208, 224, 0.07) 50%, transparent);
  animation: scan 11s ease-in-out infinite;
}
@keyframes drift { to { background-position: 0 0, 0 44px, 44px 0, 0 0; } }
@keyframes scan { from { transform: translateY(-180px); } to { transform: translateY(100vh); } }

/* Header */
.hero { position: relative; padding: 76px 0 44px; }
.brand { display: flex; align-items: center; gap: 18px; }
.brand .emblem { width: 88px; height: 88px; border-radius: 50%; box-shadow: 0 0 22px rgba(47, 208, 224, 0.35); }
.wordmark { display: flex; flex-direction: column; gap: 2px; }
.brand .bar { width: 64px; height: 5px; margin-bottom: 14px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 18px rgba(47, 208, 224, 0.6); }
.brand strong { font-size: 1.45rem; letter-spacing: 0.05em; }
.brand small { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
h1 {
  margin: 34px 0 14px;
  font-size: clamp(2.7rem, 7.5vw, 5.2rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.025em;
}
h1 span {
  display: block;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  background: linear-gradient(90deg, var(--cyan), #a6f4fb 55%, var(--silver));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { max-width: 46ch; margin: 0; color: var(--silver); font-size: clamp(1.05rem, 2.2vw, 1.28rem); }
.term { margin: 22px 0 28px; color: var(--muted); font: 0.92rem var(--mono); }
.term .prompt { color: var(--cyan); }
.cursor { display: inline-block; width: 0.6em; height: 1.1em; margin-left: 4px; vertical-align: -0.2em; background: var(--cyan); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.corner { position: absolute; top: 46px; right: 0; width: 150px; height: 150px; color: var(--cyan); filter: drop-shadow(0 0 10px rgba(47, 208, 224, 0.45)); }
/* Original desktop position: to the right of the identity and contact buttons. */
.orbit { position: absolute; top: 120px; right: 40px; z-index: 0; width: min(400px, 36vw); height: auto; overflow: visible; color: var(--cyan); opacity: 0.85; pointer-events: none; touch-action: none; }
.orbit .spin { transform-origin: 200px 200px; animation: spin 40s linear infinite; }
.orbit .slow { animation-duration: 90s; }
.orbit .fast { animation-duration: 18s; }
.orbit .rev { animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Draggable planets and a clickable sun (site.js). Everything else lets clicks through to the page. */
.orbit .planet { pointer-events: auto; cursor: grab; touch-action: none; }
.orbit.dragging .planet { cursor: grabbing; }
.orbit .hit { fill: transparent; }
.orbit .sun { pointer-events: auto; cursor: pointer; transition: fill-opacity 0.2s; }
.orbit .sun:hover { filter: brightness(1.15); }
.orbit .tether { stroke: currentColor; stroke-width: 1; stroke-dasharray: 3 4; opacity: 0; }
.orbit .ripple { fill: none; stroke: currentColor; transform-origin: 200px 200px; animation: ripple 1.4s ease-out forwards; }
@keyframes ripple { from { transform: scale(1); opacity: 0.8; } to { transform: scale(8.6); opacity: 0; } }
.orbit .hint { fill: var(--muted); font: 11px var(--mono); letter-spacing: 0.12em; text-anchor: middle; transition: opacity 0.8s; }
.orbit .hint.gone { opacity: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(12, 23, 33, 0.65);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.btn.primary { border-color: var(--cyan); background: var(--cyan); color: #04121a; }
.btn.primary:hover { background: #63e2ee; }

/* Section labels */
h2 { margin: 0; color: var(--cyan); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; }
.sub { margin: 8px 0 18px; color: var(--muted); }

/* Featured */
.featured { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 18px; margin: 6px 0 52px; }
.feature {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.feature .media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.feature .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s ease; }
.feature .media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(180deg, transparent, rgba(16, 32, 48, 0.96));
}
.feature .overlay { position: relative; margin-top: -54px; padding: 0 24px 24px; }
.feature h3 { margin: 10px 0 6px; font-size: clamp(1.4rem, 2.6vw, 1.85rem); letter-spacing: -0.01em; }
.feature p { max-width: 54ch; margin: 0 0 12px; color: var(--silver); }
.feature:hover { transform: translateY(-3px); border-color: rgba(47, 208, 224, 0.7); box-shadow: 0 0 0 1px rgba(47, 208, 224, 0.35), 0 22px 60px rgba(47, 208, 224, 0.14); }
.feature:hover .media img { transform: scale(1.045); }

/* Filters */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 0.85rem var(--sans);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filters button:hover { border-color: var(--line-strong); color: var(--text); }
.filters button[aria-pressed="true"] { border-color: var(--cyan); background: var(--cyan); color: #04121a; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.grid-empty { color: var(--muted); font-size: 0.92rem; }
/* Physical projects, then the featured software row, then the other software. */
.grid + .featured { margin: 18px 0; }
.featured[hidden] + .grid { margin-top: 16px; }
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(47, 208, 224, 0.6); box-shadow: 0 0 0 1px rgba(47, 208, 224, 0.22), 0 16px 44px rgba(47, 208, 224, 0.1); }
.thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--line); background: #0a141c; }
.thumb img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9); transition: transform 0.6s ease, filter 0.6s; }
.card:hover .thumb img { transform: scale(1.05); filter: saturate(1.05); }
.thumb .badge { position: absolute; top: 10px; left: 10px; }
.body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font: 0.7rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.meta .updated { margin-left: auto; letter-spacing: 0; text-transform: none; }
.meta .updated:empty { display: none; }
.card h3 { margin: 0; font-size: 1.08rem; }
.card p { flex: 1; margin: 0; color: #bfccd6; font-size: 0.92rem; }
.card .credit { color: var(--muted); font-size: 0.78rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.tags li { padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; background: rgba(200, 211, 220, 0.04); color: var(--silver); font: 0.72rem var(--mono); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.links .btn { padding: 6px 13px; font-size: 0.84rem; }

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(7, 13, 19, 0.8);
  color: var(--silver);
  font: 700 0.66rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.live { color: var(--green); }
.badge.live::before { animation: pulse 2.2s infinite; }
.badge.dev { color: var(--amber); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(78, 224, 138, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(78, 224, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(78, 224, 138, 0); }
}

/* Workshop gallery */
.workshop { margin-top: 60px; }
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.strip figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: border-color 0.25s, transform 0.25s; }
.strip figure:hover { transform: translateY(-3px); border-color: rgba(47, 208, 224, 0.6); }
.strip a { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.strip img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.strip figure:hover img { transform: scale(1.04); }
.strip figcaption { padding: 10px 12px; color: var(--muted); font-size: 0.84rem; }
.strip figcaption strong { display: block; color: var(--text); font-size: 0.92rem; }

/* Early work */
.early { margin-top: 52px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(12, 23, 33, 0.6); }
.early summary { display: flex; align-items: center; gap: 12px; padding: 16px 18px; font-weight: 700; list-style: none; cursor: pointer; }
.early summary::-webkit-details-marker { display: none; }
.early summary::before { content: "+"; width: 1ch; color: var(--cyan); font: 700 1.1rem var(--mono); }
.early[open] summary::before { content: "\2212"; }
.early summary small { margin-left: auto; color: var(--muted); font: 0.78rem var(--mono); }
.timeline { display: grid; margin: 0; padding: 0 18px 12px; list-style: none; }
.timeline li { display: grid; grid-template-columns: 52px 1fr auto; gap: 2px 14px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline .year { color: var(--cyan); font: 0.8rem var(--mono); }
.timeline a { font-weight: 600; text-decoration: none; }
.timeline a:hover { color: var(--cyan); }
.timeline .lang { color: var(--muted); font: 0.75rem var(--mono); }
.timeline p { grid-column: 2 / -1; margin: 0; color: var(--muted); font-size: 0.88rem; }

/* Contact and footer */
.contact {
  position: relative;
  margin-top: 60px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid rgba(47, 208, 224, 0.35);
  border-radius: 18px;
  background: radial-gradient(700px 240px at 0% 0%, rgba(47, 208, 224, 0.15), transparent 70%), var(--panel);
}
.contact h3 { margin: 10px 0 8px; font-size: clamp(1.4rem, 3vw, 2rem); }
.contact .cta .btn { min-height: 44px; display: inline-flex; align-items: center; }
.contact-social { margin-top: 10px; }
.contact p { max-width: 62ch; margin: 0 0 18px; color: var(--silver); }
.contact-emblem { position: absolute; top: 50%; right: clamp(24px, 5vw, 64px); width: 190px; height: 190px; transform: translateY(-50%); border-radius: 50%; box-shadow: 0 0 30px rgba(47, 208, 224, 0.3); }
footer { padding: 40px 0 56px; color: var(--muted); font-size: 0.85rem; }
footer p { margin: 0 0 6px; }
.foot-logo { display: block; width: 44px; height: 44px; margin: 0 0 12px; border-radius: 50%; box-shadow: 0 0 14px rgba(47, 208, 224, 0.25); }
.site-foot strong { color: var(--silver); font-weight: 600; }
.offer { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; max-width: 62ch; }
.offer li { padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--silver); font-size: 0.88rem; background: rgba(12, 23, 33, 0.6); }
.contact p a { color: var(--cyan); }
footer a { color: var(--cyan); }

@media (max-width: 960px) {
  .contact-emblem { display: none; }
}

@media (max-width: 760px) {
  /* On phones it sits behind the name and header text, running off the right edge, and takes no page space.
     The text stays on top but lets touches through, so planets behind it can still be grabbed. */
  .hero { width: 100%; padding-inline: 20px; overflow-x: clip; }
  .corner { right: 20px; }
  .orbit { top: 96px; right: -36px; width: min(310px, 80vw); opacity: 0.7; }
  .orbit .hint { display: none; }
  .brand, .hero h1, .lede, .term { position: relative; z-index: 1; pointer-events: none; }
  .cta { position: relative; z-index: 1; }
}

@media (max-width: 640px) {
  .hero { padding-top: 48px; }
  .brand .emblem { width: 64px; height: 64px; }
  .corner { width: 90px; height: 90px; top: 28px; }
  .feature .overlay { padding: 0 18px 20px; }
  .timeline li { grid-template-columns: 44px 1fr; }
  .timeline .lang { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg, .cursor, .badge.live::before, .orbit .spin { animation: none; }
  .bg::after { display: none; }
  * { transition: none !important; }
}
