/* thun.world: a directory where the addresses are the design.
   Solid names are live, outlined names are on their way. No JavaScript, no third-party requests. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ground: #ebe7f3;
  --ink: #1a1325;
  --soft: #5a5169;
  --line: #bfb5d2;
  --accent: #5b2fe0;
  --on-accent: #fff;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --text: "Newsreader", Georgia, "Times New Roman", serif;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}
/* Dark is the portfolio's own palette, so the two sites read as one family. */
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0b080c;
    --ink: #eae5ec;
    --soft: #a89eb0;
    --line: #2b2331;
    --accent: #c2a4ff;
    --on-accent: #0b080c;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.1875rem;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--on-accent); }
a { color: inherit; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: .5rem .9rem;
  background: var(--ink);
  color: var(--ground);
  font-family: var(--display);
  font-weight: 600;
  text-decoration: none;
  z-index: 10;
}
.skip:focus { top: .75rem; }

/* ---- top bar ---- */
.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  font-family: var(--display);
}
.mark {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -.01em;
  text-decoration: none;
}
.top nav { display: flex; gap: 1.5rem; }
.top nav a {
  font-weight: 500;
  font-size: .95rem;
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: .3em;
  transition: text-decoration-color .2s;
}
.top nav a:hover { text-decoration-color: var(--accent); }
.top a:focus-visible,
.foot a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* ---- intro ---- */
.intro { padding: clamp(3rem, 9vw, 7rem) var(--gutter) 0; }
.intro h1 {
  margin: 0;
  max-width: 24ch;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.intro p {
  margin: 1.1rem 0 0;
  max-width: 46ch;
  color: var(--soft);
  font-size: 1.25rem;
  text-wrap: pretty;
}

/* ---- the list of worlds ---- */
.worlds {
  list-style: none;
  margin: clamp(2.5rem, 7vw, 5rem) 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.worlds > li { border-bottom: 1px solid var(--line); }

.world {
  --stroke: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(15rem, 1fr);
  align-items: end;
  column-gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--gutter);
  color: var(--ink);
  text-decoration: none;
}
.is-soon { --stroke: var(--soft); color: var(--soft); }

/* The address: the name is set to fill its column, whatever the screen. */
.address {
  container-type: inline-size;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  min-width: 0;
}
.name {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 75%;
  font-size: clamp(3rem, 17.5cqi, 11rem);
  line-height: .9;
  letter-spacing: -.005em;
  /* Outlined until it is live. The outline is painted first and the letter is then filled with the
     background, which hides the overlapping contours inside a variable font's letters. */
  color: var(--ground);
  -webkit-text-stroke: .044em var(--stroke);
  paint-order: stroke fill;
}
.is-live .name { color: var(--stroke); -webkit-text-stroke-width: 0; }
.host {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1rem, 2.1vw, 1.5rem);
  letter-spacing: -.005em;
  color: var(--soft);
}
/* A domain that is not thun.world sits apart from the name; the gap does not indent it when it wraps. */
.address:has(.apart) { column-gap: .75rem; }

.about { display: flex; flex-direction: column; gap: .7rem; padding-bottom: .15rem; }
.what { max-width: 38ch; text-wrap: pretty; }
.state {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .005em;
}
/* a filled dot is live, a hollow one is not yet */
.state::before {
  content: "";
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  border: 2px solid currentColor;
}
.is-live .state::before { background: currentColor; }

/* A live row answers the pointer: it inverts. */
a.world { transition: background-color .22s ease, color .22s ease; }
a.world:hover,
a.world:focus-visible { --stroke: var(--ground); background: var(--ink); color: var(--ground); }
a.world:hover .host,
a.world:focus-visible .host { color: inherit; opacity: .8; }
a.world:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

/* The one moment on load: the live names fill in, one after another, so the page shows what its legend says. */
@keyframes fill-in { from { color: var(--ground); -webkit-text-stroke-width: .044em; } }
.is-live .name { animation: fill-in .9s cubic-bezier(.2, .7, .2, 1) both; }
.worlds > li:nth-child(1) .name { animation-delay: .25s; }
.worlds > li:nth-child(2) .name { animation-delay: .45s; }
.worlds > li:nth-child(3) .name { animation-delay: .5s; }
.worlds > li:nth-child(5) .name { animation-delay: .55s; }
.worlds > li:nth-child(7) .name { animation-delay: .65s; }
@media (prefers-reduced-motion: reduce) {
  .is-live .name { animation: none; }
  a.world { transition: none; }
}

/* ---- footer ---- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 2rem;
  padding: 2rem var(--gutter) 3rem;
  color: var(--soft);
  font-size: 1.0625rem;
}
.foot p { margin: 0; }
.foot a { text-underline-offset: .25em; }

/* ---- narrow screens: one column, the text under its name ---- */
@media (max-width: 47.9rem) {
  .world { grid-template-columns: minmax(0, 1fr); row-gap: .9rem; }
  .about { padding-bottom: 0; }
  .what { max-width: 44ch; }
}

/* ---- the page for an address that does not exist ---- */
.lost { padding: clamp(4rem, 12vw, 9rem) var(--gutter); }
.lost h1 {
  margin: 0;
  max-width: 14ch;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 75%;
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: .92;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.lost p { margin: 1.5rem 0 0; max-width: 40ch; color: var(--soft); font-size: 1.25rem; }
.lost a { color: var(--ink); text-underline-offset: .25em; }
.lost a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* ---- applications: what these pages add to the landing page's stylesheet above ----
   Same tokens, same fonts, same legend: a solid name can be downloaded, an outlined name is on its way. */

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

/* ================= index: one row per app, its picture beside the name ================= */
.apps {
  list-style: none;
  margin: clamp(2.5rem, 7vw, 5rem) 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.apps > li { border-bottom: 1px solid var(--line); }

.app-row {
  --stroke: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas:
    "name thumb"
    "about thumb";
  grid-template-rows: auto 1fr;
  column-gap: clamp(1.5rem, 4vw, 4rem);
  row-gap: 1.1rem;
  align-items: start;
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--gutter);
  color: var(--ink);
  text-decoration: none;
}
.app-row.is-soon { --stroke: var(--soft); color: var(--soft); }
.app-row .address { grid-area: name; align-self: end; }
.app-row .about { grid-area: about; }
.app-row .thumb {
  grid-area: thumb;
  align-self: center;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  border: 1px solid var(--line);
  background: var(--line);
}
/* Every name is set at one size and wraps on its own: a short name sits on one line, a long one takes three. */
.app-row .name,
.app-page .name { line-height: .92; text-wrap: balance; }
.app-row .name { font-size: clamp(2.6rem, 12cqi, 7.5rem); }
.app-row .kind {
  font-family: var(--display);
  font-weight: 500;
  font-size: .95rem;
  color: var(--soft);
}

a.app-row { transition: background-color .22s ease, color .22s ease; }
a.app-row:hover,
a.app-row:focus-visible { --stroke: var(--ground); background: var(--ink); color: var(--ground); }
a.app-row:hover .kind,
a.app-row:focus-visible .kind { color: inherit; opacity: .8; }
a.app-row:hover .thumb,
a.app-row:focus-visible .thumb { border-color: var(--ground); }
a.app-row:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) { a.app-row { transition: none; } }

/* ================= one app ================= */
.app-head { padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) 0; }
.crumb {
  margin: 0 0 1.1rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: .95rem;
}
.crumb a { text-underline-offset: .3em; text-decoration-thickness: 1px; }
.crumb a:focus-visible,
.app-page a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

.app-page h1.address { margin: 0; }
.app-page .name { font-size: clamp(3rem, 13cqi, 9rem); }

.app-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  column-gap: clamp(2rem, 6vw, 6rem);
  row-gap: 2rem;
  align-items: start;
  padding: clamp(1.25rem, 3vw, 2rem) var(--gutter) 0;
}
.lede {
  margin: 0;
  max-width: 30ch;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.25;
  text-wrap: balance;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem 2.25rem;
  margin: 1.6rem 0 0;
  font-family: var(--display);
}
.facts dt { color: var(--soft); font-size: .9rem; font-weight: 500; }
.facts dd { margin: 0; font-size: 1.05rem; font-weight: 600; }

/* the download: the one action on the page, so the one solid block */
.dl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
.dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .15rem 1.25rem;
  padding: 1.15rem 1.4rem;
  border: 2px solid var(--ink);
  font-family: var(--display);
  text-decoration: none;
}
.dl-label { grid-column: 1; font-weight: 700; font-size: 1.6rem; letter-spacing: -.01em; line-height: 1.1; }
.dl-meta { grid-column: 1; font-weight: 500; font-size: .95rem; opacity: .75; }
.dl-go { grid-column: 2; grid-row: 1 / span 2; font-weight: 700; font-size: 1.05rem; }
a.dl { background: var(--ink); color: var(--ground); transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
a.dl:hover,
a.dl:focus-visible { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.dl.is-soon { border-style: dashed; border-color: var(--soft); color: var(--soft); }
.dl-note { margin: .7rem 0 0; color: var(--soft); font-size: 1.05rem; }
@media (prefers-reduced-motion: reduce) { a.dl { transition: none; } }

.sum { margin-top: .6rem; font-family: var(--display); font-size: .95rem; color: var(--soft); }
.sum summary { cursor: pointer; width: fit-content; text-underline-offset: .3em; }
.sum summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.sum code {
  display: block;
  margin-top: .5rem;
  word-break: break-all;
  font-size: .82rem;
  color: var(--ink);
}
.sum p { margin: .5rem 0 0; font-family: var(--text); font-size: 1rem; }

.app-hero { margin: clamp(2rem, 5vw, 3.5rem) 0 0; padding: 0 var(--gutter); }
.app-hero a { display: block; max-width: 1500px; }
.app-hero img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--line); }
.app-hero figcaption { margin-top: .6rem; max-width: 70ch; color: var(--soft); font-size: 1.0625rem; }

.app-body {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  column-gap: clamp(2rem, 6vw, 6rem);
  row-gap: 3rem;
  align-items: start;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) 0;
}
.app-main > section + section { margin-top: clamp(2rem, 4vw, 3rem); }
.app-side > section + section { margin-top: 2rem; }
.app-body h2,
.shots h2 {
  margin: 0 0 .8rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -.01em;
  line-height: 1.15;
}
.about-text p { margin: 0 0 1em; max-width: 60ch; text-wrap: pretty; }
.about-text p:last-child { margin-bottom: 0; }
.app-body ul { margin: 0; padding-left: 1.15rem; }
.app-body li { margin: 0 0 .5rem; max-width: 62ch; text-wrap: pretty; }
.app-body li::marker { color: var(--soft); }
.app-body li:last-child { margin-bottom: 0; }

/* the steps are a real sequence, so they are numbered */
.steps { list-style: none; counter-reset: step; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: 1.2rem; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -.05rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--display);
  font-weight: 700;
  font-size: .9rem;
}
.steps p { margin: 0; }
pre {
  margin: .6rem 0 0;
  padding: .85rem 1.05rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  font: .92rem/1.55 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
pre:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em; }

/* ---- screenshots: a strip that scrolls sideways, each picture at its own width ---- */
.shots { margin-top: clamp(3rem, 8vw, 6rem); }
.shots h2 { padding: 0 var(--gutter); }
.strip {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 1.1rem 0 0;
  padding: 0 var(--gutter) 1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.strip:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.strip > li { flex: none; margin: 0; padding: 0; scroll-snap-align: start; }
.strip figure { margin: 0; }
.strip img {
  display: block;
  height: clamp(15rem, 52vh, 34rem);
  width: auto;
  max-width: none;
  border: 1px solid var(--line);
  background: var(--line);
}
/* the caption is as wide as its picture, never wider */
.strip figcaption { width: 0; min-width: 100%; margin-top: .6rem; color: var(--soft); font-size: 1.0625rem; line-height: 1.35; }
.shots-note { margin: .4rem 0 0; padding: 0 var(--gutter); color: var(--soft); font-size: 1.0625rem; }
.pixel img,
img.pixel { image-rendering: pixelated; }   /* pixel art stays sharp; a phone screenshot ("pixel": false in app.json) stays smooth */

@media (max-width: 47.9rem) {
  .app-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "name" "thumb" "about";
    grid-template-rows: auto;
  }
  .app-row .address { align-self: start; }
  .app-lead,
  .app-body { grid-template-columns: minmax(0, 1fr); }
  .strip img { height: 16rem; }
}

/* ---- extensions: what a product with several parts adds to the shared look (base.css + products.css) ---- */

/* each part (VS Code, phone, command line, web) is a section of its own */
.part {
  scroll-margin-top: 1.5rem;
  margin-top: clamp(2.25rem, 5vw, 3.5rem);
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--line);
}
.app-main > .part:first-of-type { margin-top: clamp(2rem, 4vw, 3rem); }
.part h2 { margin: 0 0 .6rem; font-family: var(--display); font-weight: 700; font-size: 1.4rem; letter-spacing: -.01em; line-height: 1.15; }
.part h3 {
  margin: 1.5rem 0 .55rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -.005em;
  color: var(--soft);
}
.part-summary { margin: 0; max-width: 62ch; text-wrap: pretty; }

/* a command is shown inside the get-it card */
.dl-meta code { font: inherit; font-weight: 500; word-break: break-word; }

/* the parts, as links to their sections */
.parts-nav ul { list-style: none; padding: 0; }
.parts-nav li { margin: 0 0 .35rem; }
.parts-nav a { text-underline-offset: .25em; }
.parts-nav a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* phone screenshots are tall: the strip keeps them the same height as the wide ones */
.strip img[height] { max-height: 34rem; }
