/* nathanneurotic.com
   Plain on purpose: the screenshots carry the colour. */

@font-face { font-family: "Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #f6f4ef;
  --text: #1c1a1f;
  --muted: #5d5864;
  --rule: #dad4ca;
  --accent: #6a3fc4;
  --accent-strong: #4b2a92;
  --frame: #0c0b0f;
  --tint: #ece8e0;
  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 66rem;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131116;
    --text: #ebe7ef;
    --muted: #a39dab;
    --rule: #2e2a34;
    --accent: #b9a2ff;
    --accent-strong: #d4c6ff;
    --frame: #000;
    --tint: #1c1921;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  text-rendering: optimizeLegibility;
}

img, video, iframe { max-width: 100%; }
img, video { display: block; height: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p, ul, ol, dl, table, figure { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.2em; }
li + li { margin-top: 0.3em; }
code, .mono { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--tint); padding: 0.08em 0.3em; border-radius: 3px; }
strong { font-weight: 600; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--text); color: var(--bg); padding: 0.5rem 0.8rem; z-index: 10;
}
.skip:focus { top: 0.5rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: 40rem; }

/* header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.4rem 2rem; padding-top: 1.1rem; padding-bottom: 1.1rem;
}
.site-name { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 600; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.site-name img { width: 32px; height: 32px; border-radius: 50%; }
.site-name:hover { color: var(--text); text-decoration: underline; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; }

main { padding: 2.5rem 0 3rem; }
section + section { margin-top: 3rem; }

.lede { font-size: 1.2rem; line-height: 1.55; max-width: 38rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* project rows */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 1rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.6rem; margin-bottom: 0; }
.section-head h2 { margin: 0; }

.project {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.25rem 2.25rem;
  padding: 2rem 0; border-bottom: 1px solid var(--rule);
}
.project h3 { font-size: 1.35rem; margin-bottom: 0.2em; }
.project .kind { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); margin-bottom: 0.9em; }
.project p:last-child { margin-bottom: 0; }
@media (max-width: 760px) { .project { grid-template-columns: 1fr; } }

.links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.25rem; padding: 0; list-style: none; margin: 0; }
.links li + li { margin-top: 0; }

/* screenshots */
.shot { margin: 0; }
.shot.wide { margin-top: 1.75rem; max-width: 52rem; }
.jump { display: flex; flex-wrap: wrap; gap: 0.3rem 1.25rem; padding: 0; list-style: none; margin: 0 0 1rem; }
.jump li + li { margin-top: 0; }
.shot img { width: 100%; background: var(--frame); border: 1px solid var(--rule); border-radius: 3px; }
.shot figcaption, figure figcaption { font-family: var(--mono); font-size: 0.78rem; line-height: 1.45; color: var(--muted); margin-top: 0.5rem; }

.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin: 1.5rem 0; }
.shots.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .shots, .shots.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; } }
@media (max-width: 480px) { .shots, .shots.two { grid-template-columns: 1fr; } }

/* facts */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; font-size: 0.95rem; border-top: 1px solid var(--rule); }
.facts dt, .facts dd { padding: 0.45rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.facts dt { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); padding-right: 1.5rem; padding-top: 0.6rem; }

/* tables */
.table-scroll { overflow-x: auto; margin-bottom: 1.1em; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; vertical-align: top; padding: 0.45rem 1rem 0.45rem 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; font-size: 0.85rem; }
td.mono { white-space: nowrap; }

/* project detail page */
.detail { padding: 2.5rem 0; border-bottom: 1px solid var(--rule); }
.detail:first-of-type { padding-top: 1rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1rem 3rem; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
.credit { font-size: 0.92rem; color: var(--muted); }

.small-projects { list-style: none; padding: 0; margin: 0; }
.small-projects li { padding: 1rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.small-projects h3 { font-size: 1.1rem; margin-bottom: 0.25em; }
.small-projects p { margin-bottom: 0.4em; }

/* note boxes (AI labelling) */
.note { border-left: 3px solid var(--accent); padding: 0.2rem 0 0.2rem 1rem; max-width: 40rem; }

/* art grid */
.art { columns: 3 15rem; column-gap: 1.25rem; margin-top: 1.5rem; }
.art figure { break-inside: avoid; margin: 0 0 1.25rem; }
.art img { width: 100%; border-radius: 3px; background: var(--frame); }
.art figcaption { font-family: var(--sans); font-size: 0.9rem; color: var(--text); }

/* music */
.songs { list-style: none; padding: 0; margin: 0; }
.song { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem 1.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.song img { width: 7rem; border-radius: 3px; }
.song h3 { margin-bottom: 0.15em; }
.song iframe { width: 100%; height: 112px; border: 0; border-radius: 6px; background: var(--tint); margin-top: 0.75rem; }
@media (max-width: 520px) { .song { grid-template-columns: 4.5rem minmax(0, 1fr); } .song img { width: 4.5rem; } }

.video-row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1.5rem 2rem; align-items: start; }
.video-row video { width: 100%; border-radius: 3px; background: var(--frame); }
@media (max-width: 600px) { .video-row { grid-template-columns: 1fr; } .video-row video { max-width: 15rem; } }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: 2rem 3rem; align-items: start; }
.about figure { margin: 0; }
@media (max-width: 720px) { .about { grid-template-columns: 1fr; } .about figure { max-width: 13rem; } }

/* contact */
.email { font-size: clamp(1.15rem, 0.9rem + 1.2vw, 1.6rem); font-weight: 600; overflow-wrap: anywhere; }
.elsewhere { list-style: none; padding: 0; margin: 0; max-width: 40rem; border-top: 1px solid var(--rule); }
.elsewhere li { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
@media (max-width: 480px) { .elsewhere li { grid-template-columns: 1fr; gap: 0; } }

/* footer */
.site-footer { border-top: 1px solid var(--rule); font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; padding-top: 1.5rem; padding-bottom: 2rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: 0; }
.site-footer p { margin: 0; }

/* projects page: "on this page" list, a sticky sidebar on wide screens */
.toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.25rem; }
.toc li + li { margin-top: 0; }
.toc .toc-label { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin: 0 0 0.5rem; }
@media (min-width: 1100px) {
  .with-toc { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 3rem; align-items: start; }
  .toc { position: sticky; top: 1.5rem; padding-top: 1rem; }
  .toc ul { display: block; }
  .toc li + li { margin-top: 0.45rem; }
  .toc a { color: var(--muted); text-decoration: none; }
  .toc a:hover { color: var(--text); text-decoration: underline; }
}

/* side quests: one row per section, opens on click */
.quests { border-top: 1px solid var(--rule); margin-top: 2rem; }
.quest { border-bottom: 1px solid var(--rule); }
.quest > summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: minmax(0, 1fr) auto 1.5rem; grid-template-rows: auto auto; column-gap: 1.5rem; align-items: center;
  padding: 1.1rem 0;
}
.quest > summary h2 { grid-column: 1; grid-row: 1; align-self: end; }
.quest > summary .sub { grid-column: 1; grid-row: 2; align-self: start; display: block; }
.quest > summary .peek { grid-column: 2; grid-row: 1 / span 2; }
.quest > summary::after { grid-column: 3; grid-row: 1 / span 2; }
.quest > summary::-webkit-details-marker { display: none; }
.quest > summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--accent); text-align: right; }
.quest[open] > summary::after { content: "\2212"; }
.quest > summary h2 { margin: 0; font-size: 1.35rem; }
.quest > summary .sub { margin-top: 0.15rem; color: var(--muted); font-size: 0.95rem; }
.quest > summary .count { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); font-weight: 400; margin-left: 0.4rem; }
.quest > summary:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.peek { display: flex; gap: 6px; }
.peek img { width: 56px; height: 56px; border-radius: 3px; object-fit: cover; }
.quest-body { padding: 0.25rem 0 1.75rem; }
.quest-body > .art:first-child { margin-top: 0.5rem; }
@media (max-width: 560px) {
  .peek img:nth-child(n+3) { display: none; }
  .peek img { width: 44px; height: 44px; }
}

/* the footer frog: peeks over the line, blinks now and then */
.site-footer .wrap { position: relative; }
.frog { position: absolute; right: var(--gutter); top: -31px; line-height: 0; }
.frog svg { display: block; transition: transform 0.25s ease; }
.frog:hover svg, .frog:focus-visible svg { transform: translateY(-4px); }
.frog-eyes { transform-box: fill-box; transform-origin: center; animation: frog-blink 6s infinite; }
@keyframes frog-blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@media (prefers-reduced-motion: reduce) {
  .frog-eyes { animation: none; }
  .frog svg { transition: none; }
}
[id] { scroll-margin-top: 1rem; }

/* home hero: a little console screen, dark in both themes */
.hero {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); gap: 1.5rem 2.5rem; align-items: center;
  background: radial-gradient(120% 90% at 72% 30%, #17265a 0%, #0b1130 45%, #05070f 100%);
  color: #e6ecfb; border-radius: 8px; padding: clamp(1.25rem, 3.2vw, 2.5rem); overflow: hidden;
}
.hero h1 { color: #f3f6ff; margin-top: 0.9rem; }
.hero .lede { color: #c9d2ea; font-size: 1.1rem; }
.hero-emblem { width: 96px; height: 96px; border-radius: 50%; box-shadow: 0 0 28px rgba(120, 160, 255, 0.35); }
.towers { margin: 0; }
.towers-svg { display: block; width: 100%; height: auto; }
.towers figcaption { font-family: var(--mono); font-size: 0.74rem; line-height: 1.5; color: #8f9cc4; margin-top: 0.4rem; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-emblem { width: 72px; height: 72px; }
}

/* the towers themselves */
.tw-floor { fill: rgba(120, 150, 255, 0.025); stroke: rgba(140, 170, 255, 0.075); stroke-width: 0.6; }
.tw-l { fill: url(#tw-left); }
.tw-r { fill: url(#tw-right); }
.tw-t { fill: #eef3ff; fill-opacity: 0.95; }
.tw-dust { fill: #cfdcff; }
.tw-name, .tw-month { font-family: var(--mono); font-size: 8.5px; fill: #8796c4; }
.tw { transform-box: fill-box; transform-origin: 50% 100%; animation: tw-rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--d); }
.tw:hover .tw-t { fill: #ffffff; fill-opacity: 1; }
.tw-t { animation: tw-glow 7s ease-in-out infinite; animation-delay: var(--g); }
.tw-dust { animation: tw-drift 9s ease-in-out infinite alternate; animation-delay: var(--g); }
@keyframes tw-rise { from { transform: scaleY(0.02); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes tw-glow { 0%, 100% { fill-opacity: 0.9; } 50% { fill-opacity: 0.62; } }
@keyframes tw-drift { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .tw, .tw-t, .tw-dust { animation: none; }
}
.hero + section { margin-top: 3rem; }

/* about: the emblem where a photo would be */
.about-emblem img { width: 200px; height: 200px; border-radius: 50%; }
