/* sherin.dev: a dark board of glass tiles, each app in the colour of its own icon, over soft lights. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}

:root {
  --ground: #0b0c0e;
  --tile: #16181c;
  --tile-2: #1e2127;
  --paper: #eef0f3;
  --ink: #f3f4f6;
  --muted: #a4abb6;
  --line: #2a2e35;
  --gap: 8px;
  --radius: 10px;
  --row: 88px;
  --pad: 22px;

  /* Glass: how much of a tile's colour stays, the blur behind it, and its lit edge. */
  --mix: 62%;
  --frost: blur(26px) saturate(170%);
  --edge: inset 0 1px 0 rgb(255 255 255 / 0.18), inset 0 0 0 1px rgb(255 255 255 / 0.07); /* taste-skill-ignore: the lit rim of the glass */
  --pane: rgb(255 255 255 / 0.06);
  --pane-hover: rgb(255 255 255 / 0.11);

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);

  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; /* taste-skill-ignore: only the install commands, which are literal code */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

/* Each app's colour, taken from its icon. --c fills the tile, --on is the text on it. */
.c-ink { --c: var(--tile); --on: var(--ink); --soft: var(--muted); --mix: 50%; }
.c-tagwell { --c: #b0185f; --on: #fff; --soft: #ffd6e8; }
.c-moire { --c: #5a3ef0; --on: #fff; --soft: #ddd6ff; }
.c-varve { --c: #262340; --on: #fff; --soft: #c9c2ff; --hint: #8f80ff; }
.c-chatkeep { --c: #0b6a63; --on: #fff; --soft: #c8f3ee; }
.c-shellops { --c: #1f3038; --on: #fff; --soft: #a8e6ec; --hint: #5fd0db; }
.c-tresso { --c: #a8470d; --on: #fff; --soft: #ffe0cb; }
.c-webra { --c: #b02218; --on: #fff; --soft: #ffd9d4; }

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

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-body);
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

h1,
h2,
p,
ul,
dl,
dd,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: #5a3ef0;
  color: #fff;
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--ground);
}

.skip:focus {
  top: 12px;
}

.small {
  font-size: var(--step-small);
  color: var(--muted);
}

/* ---------- The lights behind the glass ---------- */

.glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow i {
  position: absolute;
  width: 48vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.42;
  filter: blur(90px);
  animation: drift 60s var(--ease) infinite alternate;
}

.glow i:nth-child(1) { left: -12vmax; top: -14vmax; background: #ff4f97; }
.glow i:nth-child(2) { right: -14vmax; top: 6vh; background: #7a5cff; animation-delay: -15s; }
.glow i:nth-child(3) { left: 18vw; bottom: -22vmax; background: #1fc7b6; animation-delay: -30s; }
.glow i:nth-child(4) { right: 4vw; bottom: -10vmax; width: 30vmax; background: #ff8a3d; animation-delay: -45s; }

/* On an app page every light takes that app's colour. */
.glow[class*="c-"] i { background: var(--c); opacity: 0.6; }
.glow[class*="c-"] i:nth-child(even) { background: var(--hint, var(--c)); opacity: 0.4; }

@keyframes drift {
  50% { transform: translate(6vw, 4vh) scale(1.08); }
  to { transform: translate(-4vw, 8vh) scale(0.94); }
}

/* ---------- The board ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(var(--row), auto);
  grid-auto-flow: row dense;
  gap: var(--gap);
  padding: var(--gap);
}

.board + .board {
  padding-top: 0;
}

.tile {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background-color: color-mix(in srgb, var(--c, var(--tile)) var(--mix), transparent);
  -webkit-backdrop-filter: var(--frost); /* taste-skill-ignore: the glass design asked for */
  backdrop-filter: var(--frost); /* taste-skill-ignore: the glass design asked for */
  box-shadow: var(--edge); /* taste-skill-ignore: the glass design asked for */
  color: var(--on, var(--ink));
  padding: var(--pad);
}

.band {
  grid-column: 1 / -1;
  height: 170px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.band p {
  font-size: clamp(96px, 11.4vw, 200px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.05em;
  white-space: nowrap;
  transform: translateY(0.04em);
}

.navrow {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.navlink {
  height: 64px;
  padding: 18px var(--pad);
  font-size: var(--step-body);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.navlink:hover {
  background-color: var(--pane-hover);
}

.navlink::after {
  content: "→";
  position: absolute;
  right: var(--pad);
  top: 18px;
  color: var(--muted);
  transition: transform 0.25s var(--ease);
}

.navlink:hover::after {
  transform: translateX(4px);
}

/* ---------- Statement and install ---------- */

.statement {
  grid-column: span 7;
  grid-row: span 4;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.statement h1 {
  font-size: var(--step-head);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.04em;
  max-width: 14ch;
}

.statement p {
  max-width: 46ch;
  color: var(--muted);
}

.statement .icon {
  width: 72px;
  height: 72px;
}

.statement .actions {
  margin-top: auto;
}

.unreleased {
  font-size: var(--step-small);
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--radius);
  background: var(--c, var(--ink));
  color: var(--on, var(--ground));
  font-size: var(--step-body);
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s var(--ease), filter 0.2s;
}

.button:hover {
  filter: brightness(1.12);
}

.button:active {
  transform: scale(0.97);
}

.install {
  grid-column: span 5;
  grid-row: span 4;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background-color 0.6s var(--ease);
}

.install h2 {
  color: var(--soft);
  font-weight: 400;
}

.install .apps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.install .apps button,
.command .copy {
  font: inherit;
  font-size: var(--step-small);
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius);
  background: rgb(0 0 0 / 0.24);
  color: var(--on);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.15s;
}

.install .apps button:hover,
.command .copy:hover {
  background: rgb(0 0 0 / 0.4);
}

.install .apps button:active,
.command .copy:active {
  transform: scale(0.96);
}

.install .apps button[aria-pressed="true"] {
  background: var(--on);
  color: var(--c);
}

.command {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 16px;
  border-radius: var(--radius);
  background: rgb(0 0 0 / 0.32);
}

.command pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow-x: auto;
  font-family: var(--mono); /* taste-skill-ignore: a shell command */
  font-size: var(--step-small);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  transition: opacity 0.4s;
}

.command pre.fading {
  opacity: 0;
}

.command .copy {
  flex: none;
}

.steps {
  margin: 0;
  padding: 16px;
  display: grid;
  gap: 8px;
  list-style: none;
  border-radius: var(--radius);
  background: rgb(0 0 0 / 0.18);
  font-size: var(--step-small);
}

.steps li {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  gap: 10px;
  overflow-wrap: anywhere;
}

.steps li span::before {
  content: "✓ "; /* taste-skill-ignore: the mark the installers print */
}

.steps li span {
  color: var(--soft);
}

.install .note {
  margin-top: auto;
  font-size: var(--step-small);
  color: var(--soft);
}

/* ---------- App tiles ---------- */

.app {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  grid-row: span 4;
}

.app.large {
  grid-column: span 6;
}

.app.tall {
  grid-column: span 3;
}

.app.wide {
  grid-column: span 12;
  grid-row: span 2;
  flex-direction: row;
  align-items: center;
  gap: 24px;
}

.app .icon {
  width: 72px;
  height: 72px;
  margin-bottom: auto;
  transition: transform 0.4s var(--ease);
}

.app.large .icon {
  width: 96px;
  height: 96px;
}

.app.wide .icon {
  margin: 0;
}

.app:hover .icon {
  transform: rotate(-6deg) scale(1.06);
}

.app .name {
  font-size: var(--step-head);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.app.tall .name {
  font-size: var(--step-head);
}

.app .kind {
  font-size: var(--step-lead);
  line-height: 1.2;
  max-width: 22ch;
}

.app.tall .kind {
  font-size: var(--step-body);
}

.app .meta {
  font-size: var(--step-small);
  color: var(--soft);
}

.app.wide .meta {
  margin-left: auto;
}

.version {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgb(0 0 0 / 0.28);
  color: var(--on, var(--ink));
  font-size: var(--step-small);
  font-variant-numeric: tabular-nums;
}

.status {
  margin-left: 8px;
}

/* The app's README picture peeks in from the right of a large tile. */
.app .peek {
  position: absolute;
  right: -40px;
  top: 28px;
  width: 58%;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--paper);
  transform: rotate(-3deg);
  transition: transform 0.5s var(--ease);
}

.app:hover .peek {
  transform: rotate(-1deg) translateX(-12px);
}

.app.large .name,
.app.large .kind,
.app.large .meta {
  max-width: 44%;
}

.app.tall .peek {
  position: static;
  width: auto;
  margin: 0 -8px auto;
  transform: rotate(-2deg);
}

.app.tall:has(.peek) .icon {
  margin-bottom: 18px;
}

/* ---------- Marquee ---------- */

.marquee {
  grid-column: 1 / -1;
  padding: 18px 0;
}

.marquee .track {
  display: flex;
  width: max-content;
  animation: slide 48s linear infinite;
}

.marquee:hover .track {
  animation-play-state: paused;
}

.marquee span {
  padding: 0 0.35em;
  font-size: clamp(3rem, 1.6rem + 6vw, 8rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  white-space: nowrap;
}

.marquee span:nth-child(7n + 1) { color: #ff6fa8; }
.marquee span:nth-child(7n + 2) { color: #9d8cff; }
.marquee span:nth-child(7n + 3) { color: #b6abff; }
.marquee span:nth-child(7n + 4) { color: #3fd6c6; }
.marquee span:nth-child(7n + 5) { color: #5fd0db; }
.marquee span:nth-child(7n + 6) { color: #ff9a5a; }
.marquee span:nth-child(7n + 7) { color: #ff6a5c; }

/* On an app page the marquee repeats the one name, in that app's colour. */
.marquee.one span {
  color: var(--on) !important;
}

.marquee.one span:nth-child(even) {
  color: var(--soft) !important;
}

/* On an app page the file list sets the height, not the board. */
.downloads:has(.files) {
  grid-row: span 4;
}

@keyframes slide {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Downloads ---------- */

.downloads {
  grid-column: span 8;
  grid-row: span 6;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.giant {
  margin: -0.06em 0 14px;
  font-size: 15.5cqw;
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.06em;
}

.bar {
  border-radius: var(--radius);
  background: var(--pane);
}

.bar summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 18px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.2s;
  border-radius: var(--radius);
}

.bar summary::-webkit-details-marker {
  display: none;
}

.bar summary:hover {
  background: var(--pane-hover);
}

.bar summary::after {
  content: "+";
  margin-left: auto;
  font-size: 22px;
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.3s var(--ease);
}

.bar[open] summary::after {
  transform: rotate(45deg);
}

.bar summary img {
  width: 24px;
  height: 24px;
}

.bar summary .version {
  margin-left: 0;
}

.bar ul,
.files {
  padding: 4px 18px 18px;
  display: grid;
  gap: 10px;
}

.bar li,
.files li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.bar li span,
.files li span {
  color: var(--muted);
}

.bar li a,
.files li a {
  font-size: var(--step-small);
  overflow-wrap: anywhere;
}

.files {
  padding: 8px 0 0;
}

.files {
  gap: 6px;
}

.files li {
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--pane);
}

/* ---------- Record tiles ---------- */

.record {
  grid-column: span 4;
  grid-row: span 3;
}

.record.licence {
  grid-row: span 2;
}

.record dl {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.record dl div {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 12px;
}

.record dt {
  font-weight: 500;
}

.record dd {
  color: var(--muted);
}

.why {
  --c: #b0185f;
  grid-column: span 4;
  grid-row: span 1;
  color: #fff;
  font-size: var(--step-body);
}

/* ---------- App pages ---------- */

.board > .statement:has(.icon) {
  grid-row: span 6;
}

.art,
.art-icon {
  grid-column: span 5;
  grid-row: span 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.board:not(:has(.install)) .art,
.board:not(:has(.install)) .art-icon {
  grid-row: span 6;
}

.paper {
  --c: var(--paper);
  --mix: 92%;
  color: #14161a;
  padding: 16px;
}

.art-icon img {
  width: min(60%, 220px);
  transition: transform 0.6s var(--ease);
}

.art-icon:hover img {
  transform: rotate(-4deg) scale(1.04);
}

.point {
  grid-column: span 4;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.point:nth-of-type(3n + 1) {
  --c: var(--tile-2);
}

.lead-line {
  font-size: var(--step-lead);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.point p:not(.lead-line) {
  color: var(--muted);
}

.fact {
  grid-column: span 4;
  grid-row: span 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fact a,
.foot-me a {
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 0;
}

.mark {
  grid-column: 1 / -1;
  height: 34svh;
  min-height: 220px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 4px;
  background: transparent;
  box-shadow: none; /* taste-skill-ignore: the glass design asked for */
  -webkit-backdrop-filter: none; /* taste-skill-ignore: the glass design asked for */
  backdrop-filter: none; /* taste-skill-ignore: the glass design asked for */
  text-decoration: none;
}

.block {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  border-radius: var(--radius);
  background-color: color-mix(in srgb, var(--c) 80%, transparent);
  -webkit-backdrop-filter: var(--frost); /* taste-skill-ignore: the glass design asked for */
  backdrop-filter: var(--frost); /* taste-skill-ignore: the glass design asked for */
  box-shadow: var(--edge); /* taste-skill-ignore: the glass design asked for */
  color: var(--ground);
  font-size: clamp(4rem, 1rem + 12vw, 13rem);
  font-weight: 500;
  line-height: 0.78;
  letter-spacing: -0.05em;
  overflow: hidden;
  transition: height 0.5s var(--ease);
}

.block.h1 {
  height: 82%;
}

.block.h2 {
  height: 66%;
}

.mark:hover .block {
  height: 100%;
}

.foot-apps {
  grid-column: span 5;
}

.foot-apps ul {
  margin-top: 12px;
  columns: 2;
  column-gap: 24px;
}

.foot-apps li {
  padding: 3px 0;
}

.foot-me {
  grid-column: span 4;
  display: grid;
  align-content: start;
  gap: 6px;
}

.foot-end {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

/* ---------- Entrances ---------- */

.js .rise {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), background-color 0.6s var(--ease);
}

.js .rise.in {
  opacity: 1;
  transform: none;
}

/* ---------- Narrower screens ---------- */

@media (max-width: 1100px) {
  .board {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .statement,
  .install,
  .downloads,
  .app.large,
  .app.wide {
    grid-column: span 6;
  }

  .app.tall,
  .record,
  .why,
  .art,
  .art-icon,
  .point,
  .fact,
  .foot-apps,
  .foot-me,
  .foot-end {
    grid-column: span 3;
  }

  .statement,
  .install {
    grid-row: auto;
  }

  .board > .statement:has(.icon),
  .board:not(:has(.install)) .art,
  .board:not(:has(.install)) .art-icon {
    grid-row: auto;
  }

  .downloads {
    grid-row: auto;
  }

  .foot-end {
    grid-column: span 6;
  }
}

@media (max-width: 700px) {
  :root {
    --gap: 6px;
    --pad: 18px;
    --row: 72px;
  }

  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board > * {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }

  .band {
    height: 110px;
  }

  .band p {
    font-size: 14.6vw;
  }

  .navrow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app.tall,
  .fact,
  .point {
    grid-column: span 1 !important;
  }

  .app.tall .kind {
    font-size: var(--step-small);
  }

  .app.large .name,
  .app.large .kind,
  .app.large .meta {
    max-width: none;
  }

  .app .peek {
    position: static;
    width: auto;
    margin-top: 14px;
    transform: rotate(-2deg);
  }

  .app.wide {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .app.wide .meta {
    margin-left: 0;
  }

  .app .icon,
  .app.large .icon {
    width: 56px;
    height: 56px;
    margin-bottom: 18px;
  }

  .giant {
    font-size: 17cqw;
  }

  .record dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .mark {
    height: 22svh;
    min-height: 140px;
  }

  .foot-apps,
  .foot-me {
    grid-column: span 1 !important;
  }

  .foot-apps ul {
    columns: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .marquee .track,
  .glow i {
    animation: none;
  }

  .js .rise {
    opacity: 1;
    transform: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
