:root {
  color-scheme: dark;
  --bg: #090b0e;
  --panel: #10151c;
  --text: #e6eaf0;
  --muted: #a1a9b5;
  --accent: #9cbbe0;
  --line: #252d38;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse 840px 450px at 50% 0, #101722 0, transparent 100%), var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
}
a { color: var(--accent); text-underline-offset: 4px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(720px, calc(100% - 48px)); margin-inline: auto; }
.mast { display: flex; align-items: baseline; gap: 24px; padding: 48px 0 32px; font-size: 13px; }
.brand { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 8px; }
nav { display: flex; flex-wrap: wrap; gap: 8px 19px; }
nav a, #clock { color: var(--muted); text-decoration: none; }
nav a:hover, .text-button:hover { color: var(--accent); }
#clock { margin-left: auto; white-space: nowrap; font-size: 12px; }
.hero { padding-bottom: 28px; }
.map {
  position: relative;
  height: clamp(140px, 26vw, 224px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}
.map canvas { display: block; width: 100%; height: 100%; }
.compass { position: absolute; right: 15px; top: 12px; color: var(--muted); font: 10px ui-monospace, monospace; }
.crosshair {
  position: absolute;
  left: 56%;
  top: 48%;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  transform: translate(-50%, -50%);
  border: 1px solid #9cbbe066;
  border-radius: 50%;
}
.crosshair span { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }
.hero-copy { padding: 32px 0 0; }
h1 { font: normal clamp(36px, 6vw, 51px)/1.08 var(--serif); letter-spacing: -.045em; margin: 0 0 12px; }
h1 span { color: var(--accent); }
.hero p { color: var(--muted); margin: 0; }
.index { scroll-margin-top: 20px; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.tabs button {
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--muted);
  padding: 10px 0;
  margin-bottom: -1px;
  font-size: 14px;
}
.tabs button:hover, .tabs button[aria-selected=true] { color: var(--accent); }
.tabs button[aria-selected=true] { border-color: var(--accent); }
#collection { min-height: 151px; }
.empty, .entry { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 0; border-bottom: 1px dashed var(--line); }
.empty h2, .entry h3 { font: normal 22px var(--serif); margin: 0 0 4px; overflow-wrap: anywhere; }
.empty p, .entry p { color: var(--muted); font-size: 13px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.primary, .secondary { display: inline-flex; align-items: center; border: 1px solid #36475e; background: #121b27; color: var(--accent); border-radius: 4px; padding: 7px 11px; font-size: 13px; white-space: nowrap; }
.primary:hover, .secondary:hover { background: #1b2a3c; }
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry-tools, .collection-tools { display: flex; align-items: center; gap: 10px; }
.collection-tools { justify-content: space-between; margin-top: 13px; }
.storage, footer { color: var(--muted); font-size: 12px; }
footer { border-top: 1px solid var(--line); margin-top: 25px; padding: 16px 0 30px; }
dialog { width: min(450px, calc(100% - 32px)); padding: 24px; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 6px; }
dialog::backdrop { background: #05070bc9; }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font: normal 28px var(--serif); margin: 0; }
.dialog-head button, .text-button { border: 0; background: none; color: var(--muted); padding: 5px; }
.dialog-head button { font-size: 22px; }
label { display: block; font-size: 13px; margin-top: 16px; }
label span { color: var(--muted); }
input, textarea { display: block; width: 100%; margin-top: 6px; padding: 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--text); }
textarea { resize: vertical; }
.dialog-actions { margin-top: 18px; }
.dialog-actions .primary { margin-left: auto; }
.error { color: var(--accent); font-size: 13px; }
@media (max-width: 510px) {
  .shell { width: calc(100% - 36px); }
  .mast { gap: 15px; padding: 28px 0 24px; flex-wrap: wrap; }
  nav { gap: 12px; }
  #clock { flex-basis: 100%; margin-left: 0; }
  .hero-copy { padding-top: 25px; }
  .entry-tools { flex-wrap: wrap; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.portfolio { padding: 21px 0; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.portfolio h2 { font: normal 27px/1.2 var(--serif); margin: 0 0 8px; }
.portfolio-row { padding: 14px 0; }
.portfolio-row + .portfolio-row { border-top: 1px dashed var(--line); }
.row-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 18px; }
.row-heading h3 { margin: 0; color: var(--accent); font-size: 15px; font-weight: 550; }
.row-heading h3 span { color: var(--text); font-weight: 400; }
.row-heading > :last-child { color: var(--muted); font-size: 12px; white-space: nowrap; }
.portfolio-row p, .portfolio-list { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.portfolio-list { padding-left: 18px; }
.portfolio-list li { margin: 8px 0; padding-left: 3px; }
.local-drafts { color: var(--muted); font-size: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.local-drafts summary { cursor: pointer; width: fit-content; }
.local-drafts .index { margin-top: 10px; }
@media (max-width: 510px) {
  .row-heading { flex-wrap: wrap; gap: 2px 12px; }
}

body { background: linear-gradient(#0d0e10 81%, #111216); font: 17px/1.7 Arial, Helvetica, sans-serif; }
.shell { position: relative; width: min(780px, calc(100% - 56px)); }
.mast { justify-content: space-between; padding: 33px 0 17px; gap: 20px; }
.mast h1 { margin: 0 0 3px; font: 700 26px/1.2 Arial, Helvetica, sans-serif; letter-spacing: -.025em; }
#clock { margin: 0; font-size: 14px; }
.mast nav { gap: 21px; font-size: 15px; }
.intro p { margin: 0 0 18px; }
.intro ul { padding-left: 1.2em; margin: -4px 0 0; }
.intro li + li { margin-top: 10px; }
.intro li::marker { color: var(--muted); }
.intro a { color: inherit; text-decoration-color: #71849b; }
.intro a:hover { color: var(--accent); }
.portfolio-tabs { gap: 12px 25px; margin-top: 43px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.portfolio-tabs a { padding: 1px 5px; border-radius: 3px; line-height: 1.45; }
.portfolio-tabs a[aria-current] { color: #10141a; background: #e0e9f4; }
.portfolio { border-top: 0; padding: 19px 0 12px; }
.portfolio h2 { font-family: Arial, Helvetica, sans-serif; font-size: 19px; }
.filters { display: flex; gap: 24px; padding: 3px 0 17px; }
.filters button { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 15px; }
.filters button[aria-pressed=true] { color: var(--text); text-decoration: underline; text-underline-offset: 6px; }
.experience-row summary, .experience-line { display: grid; grid-template-columns: 7rem minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 12px; padding: 14px 0; }
.experience-row summary { cursor: pointer; list-style: none; }
.experience-row summary::-webkit-details-marker { display: none; }
.experience-row summary:hover .org { color: var(--accent); }
.experience-row span:first-child { color: var(--muted); font-size: 13px; }
.experience-row span:last-child, .experience-row p { color: var(--muted); font-size: 15px; }
.experience-row p { margin: 0 0 12px calc(7rem + 12px); }
.org { display: flex; gap: 11px; align-items: center; }
.org i { display: grid; place-items: center; flex: 0 0 25px; height: 25px; border-radius: 4px; background: #19222d; color: #a9c0dc; font: 700 10px Arial, sans-serif; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.local-drafts { margin-top: 24px; }
@media (max-width: 560px) {
  .shell { width: calc(100% - 36px); }
  .mast { flex-wrap: wrap; padding-top: 25px; gap: 12px; }
  .experience-row summary, .experience-line { grid-template-columns: 4.5rem minmax(0, 1fr); gap: 3px 10px; }
  .experience-row span:last-child { grid-column: 2; padding-left: 36px; }
  .experience-row p { margin-left: calc(4.5rem + 10px); }
  .portfolio-tabs { gap: 10px; margin-top: 32px; }
}

.brand-logo { flex: 0 0 25px; width: 25px; height: 25px; object-fit: contain; }
.brand-inline { display: inline; }
.brand-inline img { width: 1.05em; height: 1.05em; object-fit: contain; vertical-align: -.13em; margin-right: .25em; }
.intro .brand-asu { color: #ffc627; }
.brand-kumon { color: #81cee9; }
.org:not(:has(img)) { padding-left: 36px; }
.barca-card { position: relative; display: flex; align-items: center; gap: 14px; margin-top: 24px; padding: 12px 16px 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #101114; color: var(--text); text-decoration: none; }
.intro .barca-card:hover { color: var(--text); border-color: #536174; }
.barca-card::after { content: ""; position: absolute; inset: auto 0 0; height: 4px; background: repeating-linear-gradient(90deg, #004d98 0 26px, #a50044 26px 52px); }
.barca-card img { object-fit: contain; }
.barca-card span { font: 18px Georgia, serif; }
.barca-card small { margin-left: auto; color: var(--muted); font-size: 12px; }
.usage { min-height: 180px; }
.usage-caption, #usage-status { color: var(--muted); margin: 0; }
.usage-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.usage-stats div { padding: 13px 16px; border: 1px solid var(--line); border-radius: 5px; }
.usage-stats span { display: block; font-size: 13px; color: var(--muted); }
.usage-stats strong { font-size: 24px; }
.usage h2 { font-size: 18px; }
.activity > div { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 12px; padding: 6px 0; color: var(--muted); font-size: 13px; }
.usage-bar { height: 6px; border-radius: 4px; background: linear-gradient(90deg, #7aa8dc var(--fill), #1e2836 var(--fill)); }

.profile-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.profile-footer nav { gap: 6px; }
.profile-footer nav a { display: grid; place-items: center; width: 34px; height: 34px; }
.social-icon { display: block; width: 19px; height: 19px; background: currentColor; mask: var(--icon) center / contain no-repeat; }
.github-icon { --icon: url("/brands/github.svg"); }
.linkedin-icon { --icon: url("/brands/linkedin.svg"); }

.experience-row .experience-detail { margin: 0 0 12px calc(7rem + 12px); padding: 12px 15px; background: #12161c; border-left: 2px solid #41536a; }
.experience-row .experience-detail p { margin: 0; }
.experience-metrics { display: flex; flex-wrap: wrap; gap: 10px 30px; list-style: none; padding: 0; margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.experience-metrics strong { display: block; color: var(--accent); font-size: 21px; font-variant-numeric: tabular-nums; line-height: 1.2; }
@media (max-width: 560px) {
  .experience-row .experience-detail { margin-left: calc(4.5rem + 10px); }
}

.space-page { background: #000; }
#star-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.lilypad-mark {
  position: relative;
  flex: 0 0 25px;
  height: 25px;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
}
.lilypad-mark img {
  position: absolute;
  width: 77px;
  height: auto;
  max-width: none;
  left: -3px;
  top: -4px;
}

.brand-kumon .brand-logo {
  flex-basis: 51px;
  width: 51px;
  height: 24px;
  padding: 3px;
  border-radius: 3px;
  background: #fff;
}
.experience-row summary {
  border-radius: 5px;
  transition: background-color 450ms ease;
}
.experience-row summary:hover,
.experience-row[open] summary { background-color: #12161b; }
.experience-row .experience-detail {
  background: transparent;
  border-left-color: #253343;
  padding: 9px 14px 12px;
}
@supports (interpolate-size: allow-keywords) and selector(details::details-content) {
  .experience-row { interpolate-size: allow-keywords; }
  .experience-row::details-content {
    block-size: 0;
    opacity: 0;
    overflow: clip;
    transition: block-size 700ms cubic-bezier(.22,.7,.28,1), opacity 550ms ease, content-visibility 700ms allow-discrete;
  }
  .experience-row[open]::details-content { block-size: auto; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .experience-row summary, .experience-row::details-content { transition: none; }
}
@supports not ((interpolate-size: allow-keywords) and selector(details::details-content)) {
  @media (prefers-reduced-motion: no-preference) {
    .experience-row[open] .experience-detail { animation: experience-fade 650ms ease both; }
  }
}
@keyframes experience-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Highlight the complete linked name, including wrapped lines and brand marks. */
.intro a:not(.barca-card),
.experience-detail a,
.contribution-heading a {
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-color 400ms ease, box-shadow 400ms ease;
}
.intro a:not(.barca-card):is(:hover, :focus-visible),
.experience-detail a:is(:hover, :focus-visible),
.contribution-heading a:is(:hover, :focus-visible) {
  background-color: rgba(130, 174, 229, .2);
  box-shadow: 0 0 0 3px rgba(130, 174, 229, .2);
}
@media (prefers-reduced-motion: reduce) {
  .intro a:not(.barca-card), .experience-detail a, .contribution-heading a { transition: none; }
}
