/* me.chrisziko.net — portfolio styles. Per-app accent colours are appended by scripts/build.mjs. */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --text: #16161a;
  --muted: #5c5c66;
  --faint: #85858e;
  --line: rgba(22, 22, 26, 0.09);
  --line-strong: rgba(22, 22, 26, 0.18);
  --focus: #2f55e0;
  --app: #6b6b73;
  --shadow-soft: 0 1px 2px rgba(22, 22, 26, 0.06);
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0f;
    --surface: #161619;
    --surface-2: #222227;
    --text: #ededf0;
    --muted: #a3a3ad;
    --faint: #7c7c86;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.18);
    --focus: #8aa2ff;
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  border-radius: 10px;
  z-index: 10;
}

.skip:focus {
  top: 16px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(56px, 11vw, 128px) 0 0;
}

.hello {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 7.4vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.intro {
  margin: 20px 0 0;
  max-width: 34em;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.intro a {
  color: var(--text);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.links a:hover {
  background: var(--surface);
}

.arrow {
  width: 14px;
  height: 14px;
  flex: none;
  transition: transform 0.2s ease;
}

/* ---------- Icons and badges ---------- */

.icon {
  display: block;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 22.5%;
  object-fit: cover;
  box-shadow:
    0 0 0 1px var(--line),
    0 8px 18px -8px color-mix(in oklab, var(--app) 70%, transparent);
}

.mono {
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, color-mix(in oklab, var(--app) 72%, #fff), var(--app) 70%);
  color: #fff;
  font-weight: 650;
  font-size: 26px;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.status-live::before { background: #16a34a; }
.status-invite::before { background: #d97706; }
.status-download::before { background: #2563eb; }
.status-beta::before { background: #9333ea; }

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.platforms li {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

/* ---------- Featured ---------- */

.featured {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  margin-top: clamp(48px, 7vw, 80px);
  padding: clamp(24px, 4.5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(110% 130% at 0% 0%, color-mix(in oklab, var(--app) 14%, var(--surface)) 0%, var(--surface) 62%);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.featured-art .icon {
  width: 112px;
  height: 112px;
  box-shadow:
    0 0 0 1px var(--line),
    0 22px 44px -14px color-mix(in oklab, var(--app) 65%, transparent);
}

.featured-art .mono {
  font-size: 52px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.featured-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.6vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.featured-tagline {
  margin: 12px 0 0;
  max-width: 32em;
  font-size: clamp(17px, 1.9vw, 20px);
  line-height: 1.45;
  text-wrap: pretty;
}

.featured-desc {
  margin: 10px 0 0;
  max-width: 38em;
  color: var(--muted);
  text-wrap: pretty;
}

.featured .platforms {
  margin-top: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s ease, background-color 0.15s ease;
}

.btn-primary {
  background: var(--app);
  color: #fff;
  box-shadow: 0 6px 18px -8px color-mix(in oklab, var(--app) 80%, transparent);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
  background: var(--surface-2);
}

.btn:hover .arrow,
.links a:hover .arrow,
.card.is-link:hover .card-go .arrow {
  transform: translate(2px, -2px);
}

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

.all {
  margin-top: clamp(56px, 8vw, 88px);
}

.all-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 20px;
}

.all-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 32px);
  letter-spacing: -0.015em;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
  background: var(--surface);
}

.chip .count {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.chip[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.chip[aria-pressed="true"] .count {
  color: inherit;
  opacity: 0.6;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(90% 70% at 0% 0%, color-mix(in oklab, var(--app) 9%, var(--surface)) 0%, var(--surface) 70%);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card.is-link:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--app) 35%, var(--line-strong));
  box-shadow: 0 16px 34px -18px color-mix(in oklab, var(--app) 55%, transparent);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-name {
  margin: 18px 0 6px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.stretch {
  text-decoration: none;
}

.stretch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.stretch:focus-visible {
  outline: none;
}

.stretch:focus-visible::after {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.card-tagline {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.45;
  text-wrap: pretty;
}

.card-desc {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-wrap: pretty;
}

.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
}

.card-links {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.card-link {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-underline-offset: 3px;
}

.card-link:hover {
  color: var(--text);
}

.card-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
}

.empty {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: clamp(72px, 10vw, 112px);
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 14px;
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .wrap {
    padding: 0 16px;
  }

  .featured {
    grid-template-columns: 1fr;
    gap: 22px;
    border-radius: 24px;
  }

  .featured-art .icon {
    width: 80px;
    height: 80px;
  }

  .featured-art .mono {
    font-size: 38px;
  }

  .actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Standalone text pages (pages/*.md), e.g. privacy policies */
.doc {
  max-width: 44rem;
  margin: 8px 0 72px;
}

.doc h1 {
  font: 600 clamp(30px, 5vw, 40px)/1.15 var(--serif);
  margin: 8px 0 16px;
}

.doc h2 {
  font: 600 22px/1.3 var(--serif);
  margin: 36px 0 10px;
}

.doc h3 {
  font-size: 17px;
  margin: 24px 0 6px;
}

.doc p,
.doc li {
  color: var(--text);
}

.doc ul {
  padding-left: 1.25em;
}

.doc li + li {
  margin-top: 6px;
}

.doc code {
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

.doc a {
  overflow-wrap: anywhere;
}

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

  .card.is-link:hover {
    transform: none;
  }
}

/* App accent colours (generated from apps.json) */
.app-docket { --app: #2f55e0; }
.app-runski { --app: #1f5c45; }
.app-snapper { --app: #3b82f6; }
.app-notifull { --app: #6b4ff2; }
.app-survivor-pool { --app: #1c5dd8; }
.app-fpl-boys-league { --app: #38003c; }
