/* Only the 400 cuts, like the app: the browser synthesizes bold, which is lighter than the real bold cut */
@font-face {
  font-family: 'Syne';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/syne-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/dm-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}

:root {
  --bg: #ededec;
  --surface: #ffffff;
  --surface-dark: #1a1a1a;
  --primary: #ec483b;
  --text: #0d0d0d;
  --body: #4a4a4a;
  --muted: #6b6b6b;
  --on-dark: #e0e0e0;
  --muted-on-dark: #9b9b9b;
  --hairline: #ec483b33;
  --display: 'Syne', 'DM Sans', sans-serif;
  --sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface-dark: #121212;
  --text: #e0e0e0;
  --body: #b8b8b8;
  --muted: #9b9b9b;
  --hairline: #ec483b40;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] {
    --bg: #0d0d0d;
    --surface: #1a1a1a;
    --surface-dark: #121212;
    --text: #e0e0e0;
    --body: #b8b8b8;
    --muted: #9b9b9b;
    --hairline: #ec483b40;
    color-scheme: dark;
  }
  :root[data-theme='system'] .card,
  :root[data-theme='system'] .section-bar {
    border: 1px solid #ffffff14;
  }
  :root[data-theme='system'] .apps img {
    box-shadow: 0 0 0 1px #ffffff26;
  }
}

:root[data-theme='dark'] .card,
:root[data-theme='dark'] .section-bar {
  border: 1px solid #ffffff14;
}

:root[data-theme='dark'] .apps img {
  box-shadow: 0 0 0 1px #ffffff26;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  transition: background-color 0.2s ease, color 0.2s ease;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
}

::selection {
  background: var(--primary);
  color: #fff;
}

a {
  color: inherit;
}

a:hover {
  color: var(--primary);
}

.page {
  max-width: 54rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3rem;
  padding: 0 1rem;
  border-radius: 1rem;
  background: var(--surface-dark);
  color: var(--on-dark);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav .logo {
  font-weight: 700;
  text-decoration: none;
}

.nav .logo span,
.dot {
  color: var(--primary);
}

.nav .status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav .logo {
  flex: none;
}

.nav-right {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  min-width: 0;
}

.nav .status {
  flex: 0 1 auto;
}

.status-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pulse-dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse-dot 2s ease-in-out infinite;
}

.theme-switch {
  display: flex;
  flex: none;
  padding: 0.125rem;
  border: 1px solid #ffffff1f;
  border-radius: 0.6rem;
}

.theme-switch button {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--muted-on-dark);
  cursor: pointer;
  overflow: hidden;
  transition: width 0.2s ease, opacity 0.2s ease, margin 0.2s ease, background-color 0.15s ease;
}

.theme-switch button:not([aria-pressed='true']) {
  width: 0;
  opacity: 0;
  pointer-events: none;
}

.theme-switch:hover button,
.theme-switch:focus-within button,
.theme-switch.open button {
  width: 1.75rem;
  opacity: 1;
  pointer-events: auto;
}

.theme-switch:hover button + button,
.theme-switch:focus-within button + button,
.theme-switch.open button + button {
  margin-left: 0.125rem;
}

.theme-switch button:not([aria-pressed='true']):hover,
.theme-switch button:not([aria-pressed='true']):focus-visible {
  background: #ffffff14;
  outline: none;
}

.theme-switch button[aria-pressed='true'] {
  background: var(--primary);
  color: #0d0d0d;
}

.theme-switch button[aria-pressed='true']:focus-visible {
  outline: 2px solid var(--on-dark);
  outline-offset: 1px;
}

.theme-switch svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 1px 2px #0000000a;
}

.card .plus {
  position: absolute;
  top: 0.6rem;
  left: 0.9rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.header {
  padding-left: 1.75rem;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.375rem;
  background: var(--primary);
}

.header .deco {
  position: absolute;
  right: 1.25rem;
  bottom: 0.25rem;
  font-family: var(--mono);
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
}

.label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 1rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.sub {
  margin: 0.9rem 0 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--body);
}

.sub::before {
  content: '> ';
  color: var(--muted);
}

.section-bar {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 3rem;
  padding: 0 1.5rem;
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 1px 2px #0000000a;
}

.section-bar h2 {
  flex: none;
  white-space: nowrap;
  margin: 0;
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.section-bar .index {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.1;
  pointer-events: none;
  user-select: none;
}

.content {
  display: grid;
  gap: 1.25rem;
}

.content section + section {
  padding-top: 1.25rem;
  border-top: 1px dashed var(--hairline);
}

.content h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.content p,
.content li {
  margin: 0.35rem 0 0;
  color: var(--body);
  font-size: 0.95rem;
}

.content ul,
.content ol {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
}

.content a {
  color: var(--text);
  text-decoration-color: var(--primary);
  text-underline-offset: 0.15em;
}

.contact ul {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.contact li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--hairline);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.contact li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.contact li .label {
  flex: none;
  width: 3.5rem;
}

.contact li a {
  min-width: 0;
  overflow-wrap: anywhere;
  text-decoration-color: var(--primary);
  text-underline-offset: 0.15em;
}

.footer {
  margin: 0.5rem 0 0;
  text-align: center;
}

.apps {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.apps li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--hairline);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.apps li:last-child {
  border-bottom: 0;
}

.apps a {
  text-decoration: none;
}

.app-text {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
  border-radius: 0.4rem;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.store svg {
  width: 0.8rem;
  height: 0.8rem;
  fill: currentColor;
}

.store:hover,
.store:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}

.app-pages {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
  flex: none;
  margin-left: auto;
}

@media (max-width: 560px) {
  .apps li {
    flex-direction: column;
    align-items: stretch;
  }
  .app-pages {
    justify-items: start;
    margin-left: 0;
    padding-left: 4.4rem;
  }
}

.section-bar .label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 420px) {
  .section-bar .label {
    display: none;
  }
}

.apps .app {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.apps img,
.apps .icon-fallback {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.8rem;
}

.apps .icon-fallback {
  font-size: 1rem;
  display: grid;
  place-items: center;
  background: var(--surface-dark);
  color: var(--on-dark);
  font-size: 0.8rem;
}

.footer a {
  text-decoration: none;
}

.hero-stagger {
  animation: hero-fade-in 0.4s ease-out both;
  animation-delay: calc(var(--stagger, 0) * 60ms);
}

@keyframes hero-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 #ec483b66;
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 6px #ec483b00;
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-stagger,
  .pulse-dot {
    animation: none;
  }
  .theme-switch button {
    transition: none;
  }
  body {
    transition: none;
  }
}
