/* Dracula is the default; Alucard (Dracula's light variant) applies only when picked with the toggle. */
:root {
  color-scheme: dark;
  --desk: #1b1a55;        /* the desktop around the window; shown until the wallpaper loads */
  --wallpaper: url(/assets/wallpaper-dark.svg);
  --bg-a: rgb(40 42 54 / .9);   /* terminal (#282a36) at 90%, so the wallpaper shows through */
  --bar-a: rgb(33 34 44 / .9);  /* title bar at 90% */
  --text: #f8f8f2;
  --muted: #a0a8cd;
  --accent: #bd93f9;
  --line: #44475a;
  --rim: #44475a;         /* 1px edge of the window */
  --shadow: rgba(8, 9, 14, .55);
  --light-r: #ff5f57; --light-y: #febc2e; --light-g: #28c840;
  /* syntax colours inside the window */
  --green: #50fa7b; --yellow: #f1fa8c; --pink: #ff79c6; --cyan: #8be9fd;
  --seg-fg: #282a36;      /* text on the coloured prompt segments */
  --seg-mid: #44475a;     /* middle (directory) segment */
  /* terminal colours, normal then bright, for the swatch row only */
  --k0: #21222c; --k1: #ff5555; --k2: #50fa7b; --k3: #f1fa8c; --k4: #bd93f9; --k5: #ff79c6; --k6: #8be9fd; --k7: #f8f8f2;
  --k8: #6272a4; --k9: #ff6e6e; --k10: #69ff94; --k11: #ffffa5; --k12: #d6acff; --k13: #ff92df; --k14: #a4ffff; --k15: #ffffff;

  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px; --s8: 96px;
  --mono: ui-monospace, "SF Mono", Menlo, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* window geometry: everything is placed from these */
  --pad: 8px;                                   /* desktop visible around the window */
  --inner: 16px;                                /* text inset inside the window */
  --radius: 10px;
  --title-h: 44px;
  --bar-h: 48px;
  --W: min(1080px, 100% - 2 * var(--pad));
  --H: min(940px, 100svh - 2 * var(--pad));
  --top: calc((100svh - var(--H)) / 2);
}
@media (min-width: 700px) {
  :root { --pad: 32px; --inner: 32px; --radius: 12px; --title-h: 40px; }
}

:root[data-theme="light"] {
  color-scheme: light;
  --desk: #7fb0f2; --wallpaper: url(/assets/wallpaper-light.svg);
  --bg-a: rgb(255 251 235 / .9); --bar-a: rgb(239 234 212 / .9);
  --text: #1f1f1f; --muted: #635d44; --accent: #644ac9; --line: #dcd5b8; --rim: #c9c1a0; --shadow: rgba(33, 37, 60, .22);
  --green: #14710a; --yellow: #75610f; --pink: #a3144d; --cyan: #036a96;
  --seg-fg: #fffbeb; --seg-mid: #6c664b;
  --k0: #1f1f1f; --k1: #cb3a2a; --k2: #14710a; --k3: #846e15; --k4: #644ac9; --k5: #a3144d; --k6: #036a96; --k7: #fffbeb;
  --k8: #6c664b; --k9: #d74c3d; --k10: #198d0c; --k11: #9e841a; --k12: #7862d0; --k13: #bf185a; --k14: #047fb4; --k15: #ffffff;
}

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

html {
  background: var(--desk);
  scroll-behavior: smooth;
  /* keep anchors and keyboard focus inside the window, clear of the title bar and input line */
  scroll-padding-top: calc(var(--top) + var(--title-h) + var(--s3));
  scroll-padding-bottom: calc(100svh - var(--top) - var(--H) + var(--bar-h) + var(--s3));
  scrollbar-width: thin;
  scrollbar-color: var(--rim) var(--desk);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-a);
  color: var(--text);
  font: 400 1rem/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 900px) { body { font-size: 1.0625rem; } }
/* The wallpaper again, fixed behind the content, so it shows faintly through the window. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--desk) var(--wallpaper) center / cover no-repeat;
}

h1, h2, h3, p, ul, dl, dd { margin: 0; padding: 0; }
h1, h2, h3 { font-size: inherit; }
ul { list-style: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- desktop and window frame ---------- */
/* Shared box for every fixed piece of the window. */
.frame, .titlebar, .input {
  position: fixed;
  left: 0; right: 0;
  width: var(--W);
  margin-inline: auto;
}
/* The wallpaper covers the whole screen except the window's text area, which a
   mask cuts out, so content shows only inside the window. The title bar and
   input line sit on top, so their rounded corners show the wallpaper. */
.desk {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--desk) var(--wallpaper) center / cover no-repeat;
  mask:
    linear-gradient(#000 0 0),
    linear-gradient(#000 0 0) 50% calc(var(--top) + var(--title-h)) / var(--W) calc(var(--H) - var(--title-h) - var(--bar-h)) no-repeat;
  mask-composite: exclude;
  pointer-events: none;
}
/* Window edge and drop shadow; transparent inside. */
.frame {
  top: var(--top);
  height: var(--H);
  z-index: 10;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--rim), 0 24px 70px var(--shadow);
  pointer-events: none;
}

.titlebar {
  top: var(--top);
  height: var(--title-h);
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--s2) 0 var(--s3);
  background: var(--bar-a); /* the .desk wallpaper shows through */
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
/* Catches clicks on the strip of desktop above the window, where hidden content scrolls. */
.titlebar::before, .input::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 100vh;
}
.titlebar::before { bottom: 100%; }
.input::after { top: 100%; }

.lights { display: flex; gap: var(--s2); }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: var(--light-r); }
.lights i:nth-child(2) { background: var(--light-y); }
.lights i:nth-child(3) { background: var(--light-g); }
.title {
  font-size: .8125rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-end { justify-self: end; display: flex; align-items: center; gap: var(--s3); }
.theme {
  display: inline-grid;
  place-items: center;
  width: 44px; height: var(--title-h);
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms var(--ease);
}
.theme:hover, .theme:focus-visible { color: var(--accent); }
.theme:focus-visible { outline-offset: -6px; }
.theme svg { fill: currentColor; stroke: currentColor; stroke-width: 1.6; }
.theme circle { fill: none; }

/* ---------- the input line ---------- */
.input {
  top: calc(var(--top) + var(--H) - var(--bar-h));
  height: var(--bar-h);
  z-index: 12;
  padding: 0 var(--inner);
  line-height: calc(var(--bar-h) - 1px);
  background: var(--bg-a); /* the .desk wallpaper shows through */
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  white-space: pre;
  overflow: hidden;
}
/* Phones: the coloured segments don't fit, so every prompt is just the arrow and the command. */
@media (max-width: 699px) { .ps1 { display: none; } }
.caret {
  display: inline-block;
  width: .6em; height: 1.25em;
  vertical-align: -.3em;
  background: var(--text);
  animation: blink 1.06s steps(1) infinite;
}
.input.typing .caret { animation: none; }
@keyframes blink { 50% { opacity: 0; } }

/* Corner handle for resizing the window: wide screens with a mouse only, shown by the script. */
.grip { display: none; }
@media (min-width: 900px) and (pointer: fine) {
  .grip:not([hidden]) {
    display: block;
    position: fixed;
    z-index: 13;
    top: calc(var(--top) + var(--H) - 18px);
    left: calc(50% + var(--W) / 2 - 18px);
    width: 18px; height: 18px;
    cursor: nwse-resize;
    touch-action: none;
    color: var(--muted);
    background: linear-gradient(135deg, transparent 0 55%, currentColor 55% 61%, transparent 61% 72%, currentColor 72% 78%, transparent 78%);
    transition: color 150ms var(--ease);
  }
  .grip:hover, .grip.dragging { color: var(--accent); }
}

/* ---------- scrolling content ---------- */
.screen {
  width: var(--W);
  margin-inline: auto;
  padding: calc(var(--top) + var(--title-h)) var(--inner) calc(100svh - var(--top) - var(--H) + var(--bar-h));
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: color 150ms var(--ease), text-decoration-thickness 150ms var(--ease), text-underline-offset 150ms var(--ease);
}
a:hover { text-decoration-thickness: 3px; text-underline-offset: .14em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* prompt line: coloured segments with chevron edges, then the command */
.ps { margin-bottom: var(--s3); white-space: pre-wrap; }
.ps1 { white-space: nowrap; }
.who, .dir, .git {
  display: inline-block;
  padding: 0 1.1ch 0 1.4ch;
  line-height: 1.6;
  color: var(--seg-fg);
  font-weight: 700;
  clip-path: polygon(0 0, calc(100% - .5em) 0, 100% 50%, calc(100% - .5em) 100%, 0 100%, .5em 50%);
}
.who { background: var(--accent); padding-left: 1ch; clip-path: polygon(0 0, calc(100% - .5em) 0, 100% 50%, calc(100% - .5em) 100%, 0 100%); }
.dir { background: var(--seg-mid); color: var(--text); font-weight: 400; }
:root[data-theme="light"] .dir { color: var(--seg-fg); }
.git { background: var(--cyan); }
.arrow { color: var(--pink); font-weight: 700; }
.bin { color: var(--green); font-weight: 700; }
.arg { color: var(--yellow); }
/* executed commands get a thin gradient underline */
.ps .cmd {
  padding-bottom: 3px;
  background: linear-gradient(90deg, var(--pink), var(--accent), var(--cyan)) 0 100% / 100% 2px no-repeat;
}
.md { color: var(--pink); font-weight: 400; }

/* ---------- hero: neofetch ---------- */
.hero {
  min-height: calc(var(--H) - var(--title-h) - var(--bar-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--s5) 0;
}
.fetch { display: flex; flex-direction: column; gap: var(--s4); }
@media (min-width: 700px) { .fetch { flex-direction: row; gap: var(--s6); align-items: flex-start; } }
/* 50 x 24 character drawing. The 1.3 line height keeps it in proportion,
   since a mono cell is about 0.6em wide. */
.logo {
  flex: none;
  margin: 0;
  font-family: inherit;
  color: var(--accent);
  font-size: 5px;
  line-height: 1.3;
}
@media (min-width: 700px) { .logo { font-size: 8px; } }
.info { flex: 1; min-width: 0; container-type: inline-size; }
/* 61 columns of block letters, sized to fit the column. A mono cell is about
   0.6em wide; the negative spacing overlaps neighbours so blocks join without seams. */
.art {
  display: block;
  white-space: pre;
  font-size: min(1.25rem, 100cqi / 35);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.05em;
  margin-bottom: var(--s4);
}
.host span { color: var(--accent); font-weight: 700; }
.host span + span { color: var(--pink); }
.host .dash { color: var(--muted); font-weight: 400; }
.specs { margin-top: var(--s2); max-width: 68ch; }
.specs dt, .specs dd { display: inline; }
.specs dd::before { content: " "; }
@media (min-width: 700px) {
  .specs { display: grid; grid-template-columns: max-content 1fr; gap: 0 1ch; }
  .specs div { display: contents; }
  .specs dt, .specs dd { display: block; }
  .specs dd::before { content: none; }
}
.specs dt { color: var(--cyan); font-weight: 700; }
.specs dt::after { content: ":"; color: var(--text); font-weight: 400; }
.swatches {
  display: grid;
  grid-template-columns: repeat(8, 3ch);
  margin-top: var(--s4);
}
.swatches i { height: 1.4em; background: var(--k0); }
.swatches i:nth-child(2) { background: var(--k1); }
.swatches i:nth-child(3) { background: var(--k2); }
.swatches i:nth-child(4) { background: var(--k3); }
.swatches i:nth-child(5) { background: var(--k4); }
.swatches i:nth-child(6) { background: var(--k5); }
.swatches i:nth-child(7) { background: var(--k6); }
.swatches i:nth-child(8) { background: var(--k7); }
.swatches i:nth-child(9) { background: var(--k8); }
.swatches i:nth-child(10) { background: var(--k9); }
.swatches i:nth-child(11) { background: var(--k10); }
.swatches i:nth-child(12) { background: var(--k11); }
.swatches i:nth-child(13) { background: var(--k12); }
.swatches i:nth-child(14) { background: var(--k13); }
.swatches i:nth-child(15) { background: var(--k14); }
.swatches i:nth-child(16) { background: var(--k15); }

/* ---------- command blocks ---------- */
/* Dashed divider that runs past the text inset to the window edges. */
.block, .foot { position: relative; }
.block::before, .foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(-1 * var(--inner));
  right: calc(-1 * var(--inner));
  border-top: 1px dashed var(--line);
}
.block { padding: var(--s5) 0 var(--s6); }
h2 { font-size: 1.125rem; font-weight: 700; color: var(--accent); margin-bottom: var(--s3); }
h3 { font-weight: 700; margin-bottom: var(--s1); }

.prose { max-width: 68ch; }
.prose p + p { margin-top: 1.6em; }

.work { display: grid; gap: var(--s4); max-width: 68ch; }

.tools div { padding: var(--s1) 0; }
@media (min-width: 700px) { .tools div { display: grid; grid-template-columns: 16ch 1fr; gap: 2ch; } }
.tools dt { color: var(--green); font-weight: 700; }
.tools dt::before { content: "- "; color: var(--pink); font-weight: 400; }
.tools dd { padding-left: 2ch; }
@media (min-width: 700px) { .tools dd { padding-left: 0; } }

.links { display: flex; flex-wrap: wrap; gap: 0 var(--s5); margin-top: var(--s2); }
.links a { display: inline-block; padding: 10px 0; font-weight: 700; }

/* ---------- footer ---------- */
.foot {
  padding: var(--s3) 0 var(--s4);
  font-size: .875rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; }
  .caret { animation: none; }
}
