:root {
  --bg: #ffffff;
  --fg: #000000;
  --dim: #6b6b6b;
  --line: rgba(0, 0, 0, 0.14);
  --pad: clamp(16px, 4vw, 40px);
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --fg: #ffffff;
  --dim: #8a8a8a;
  --line: rgba(255, 255, 255, 0.18);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s, color 0.25s;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--fg); color: var(--bg); }

:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

.frame {
  max-width: 1200px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 max(var(--pad), env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* The mark is black on white; flip it for the dark theme.
   Remove this rule if the logo has colour or its own dark variant. */
:root[data-theme="dark"] .logo { filter: invert(1); }

/* ---------- top / bottom bars ---------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  transition: background-color 0.25s;
}

.bar--foot {
  position: static;
  height: auto;
  flex-wrap: wrap;
  padding-top: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  color: var(--dim);
}

.foot__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot__links a:hover { color: var(--fg); }

.bar__id,
.bar__nav { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.bar__nav { gap: 24px; }

.bar a:hover { text-decoration: underline; text-underline-offset: 4px; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}
.toggle:hover { border-color: var(--fg); }

.toggle__dot {
  width: 10px;
  height: 10px;
  border: 1px solid var(--fg);
  border-radius: 50%;
  background: linear-gradient(90deg, var(--fg) 50%, transparent 50%);
  transition: transform 0.3s;
}
:root[data-theme="dark"] .toggle__dot { transform: rotate(180deg); }

/* ---------- shared ---------- */

.label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- hero ---------- */

.hero {
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
  padding: var(--pad) 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
}

.hero__body { margin-block: auto; }

.hero__logo {
  display: block;
  width: clamp(88px, 16vw, 160px);
  height: auto;
  margin-bottom: clamp(24px, 4vw, 40px);
}

h1 {
  margin: 0;
  font-size: clamp(34px, 9vw, 104px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.78em;
  margin-left: 0.12em;
  background: var(--fg);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__lede {
  margin: 20px 0 0;
  max-width: 40ch;
  color: var(--dim);
  font-size: clamp(14px, 1.6vw, 16px);
}

.spec {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.spec div { padding: 14px 0 0; }
.spec dt {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.spec dd { margin: 2px 0 0; }

/* ---------- apps ---------- */

.apps {
  padding: var(--pad) 0 clamp(64px, 12vw, 140px);
}

.list {
  list-style: none;
  margin: clamp(24px, 5vw, 56px) 0 0;
  padding: 0;
}

.row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(0, 2fr) 140px 24px;
  align-items: baseline;
  gap: 16px;
  padding: 22px 12px;
  margin: 0 -12px;
  transition: background-color 0.15s, color 0.15s;
}

.row__n,
.row__state {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.row__name { font-size: clamp(18px, 2.4vw, 24px); font-weight: 500; letter-spacing: -0.02em; }
.row__desc { color: var(--dim); }
.row__arrow { text-align: right; transition: transform 0.15s; }

.row--empty { color: var(--dim); }
.row--empty .row__name { font-weight: 300; }

@media (hover: hover) {
  a.row:hover { background: var(--fg); color: var(--bg); }
  a.row:hover .row__n,
  a.row:hover .row__state,
  a.row:hover .row__desc { color: inherit; }
  a.row:hover .row__arrow { transform: translate(2px, -2px); }
}

/* ---------- legal pages ---------- */

.legal {
  max-width: 72ch;
  padding: var(--pad) 0 clamp(64px, 12vw, 140px);
}

.legal h1 {
  margin-top: clamp(40px, 8vw, 96px);
  font-size: clamp(28px, 6vw, 56px);
}

.legal__date {
  margin: 16px 0 clamp(32px, 6vw, 56px);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.legal h2 {
  margin: 48px 0 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  scroll-margin-top: 72px;
}

.legal h3 { margin: 28px 0 8px; font-size: 14px; font-weight: 500; }

.legal p,
.legal ul { margin: 0 0 14px; color: var(--dim); }
.legal ul { padding-left: 20px; list-style: square; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--fg); font-weight: 500; }

.legal a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

/* Unfilled detail that must be replaced before publishing */
.todo { background: var(--fg); color: var(--bg); padding: 0 4px; }

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .bar__nav { gap: 16px; }

  .row {
    grid-template-columns: 32px 1fr 20px;
    row-gap: 4px;
    padding: 18px 12px;
  }
  .row__name { grid-column: 2; }
  .row__arrow { grid-column: 3; grid-row: 1; }
  .row__desc,
  .row__state { grid-column: 2 / -1; }
}

@media (max-width: 340px) {
  .bar__nav > a { display: none; }
}

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