/* ---------- theme ---------- */

:root {
  --bg: #fafafa;
  --card: #ffffff;
  --ink: #0b0b0f;
  --muted: #5b5b66;
  --border: rgb(10 10 20 / 0.09);
  --border-strong: rgb(10 10 20 / 0.18);
  --chip: rgb(10 10 20 / 0.05);
  --focus: #4f6bff;
  --tint: 11%;
  --shadow: 0 30px 60px -28px rgb(16 19 26 / 0.45), 0 0 0 1px rgb(16 19 26 / 0.07);
  /* Mockup surfaces follow the theme the way iOS and macOS do. */
  --m-bg: #ffffff;
  --m-ink: #10131a;
  --m-muted: #646b7b;
  --m-fill: #f2f3f6;
  --m-track: #e6e8ec;
  --m-notif: rgb(255 255 255 / 0.94);
  --sun: none;
  --moon: block;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0c;
    --card: #121216;
    --ink: #f4f4f6;
    --muted: #a0a0ab;
    --border: rgb(255 255 255 / 0.08);
    --border-strong: rgb(255 255 255 / 0.18);
    --chip: rgb(255 255 255 / 0.07);
    --focus: #8ea2ff;
    --tint: 17%;
    --shadow: 0 30px 60px -28px rgb(0 0 0 / 0.9), 0 0 0 1px rgb(255 255 255 / 0.07);
    --m-bg: #000000;
    --m-ink: #f4f4f6;
    --m-muted: #a0a0ab;
    --m-fill: #1c1c1f;
    --m-track: #2a2a2e;
    --m-notif: rgb(38 38 44 / 0.94);
    --sun: block;
    --moon: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0a0c;
  --card: #121216;
  --ink: #f4f4f6;
  --muted: #a0a0ab;
  --border: rgb(255 255 255 / 0.08);
  --border-strong: rgb(255 255 255 / 0.18);
  --chip: rgb(255 255 255 / 0.07);
  --focus: #8ea2ff;
  --tint: 17%;
  --shadow: 0 30px 60px -28px rgb(0 0 0 / 0.9), 0 0 0 1px rgb(255 255 255 / 0.07);
  --m-bg: #000000;
  --m-ink: #f4f4f6;
  --m-muted: #a0a0ab;
  --m-fill: #1c1c1f;
  --m-track: #2a2a2e;
  --m-notif: rgb(38 38 44 / 0.94);
  --sun: block;
  --moon: none;
  color-scheme: dark;
}

/* ---------- base ---------- */

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

a { color: inherit; }

p { text-wrap: pretty; }

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

.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.head-nav { display: flex; align-items: center; gap: 2px; }

.head-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.head-nav a:hover { background: var(--chip); color: var(--ink); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle:hover { border-color: var(--border-strong); }

.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .sun { display: var(--sun); }
.theme-toggle .moon { display: var(--moon); }

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

.hero { padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(0.5rem, 2vw, 1.5rem); }

h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.lineup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 2rem;
}

.lineup p { margin: 0; color: var(--muted); font-size: 0.9375rem; }

.lineup-icons { display: flex; }

.lineup-icons a {
  margin-left: -8px;
  border-radius: 13px;
  box-shadow: 0 0 0 3px var(--bg);
  transition: transform 160ms ease;
}

.lineup-icons a:first-child { margin-left: 0; }
.lineup-icons a:hover { z-index: 1; transform: translateY(-3px); }
.lineup-icons .ico { --size: 44px; border-radius: 13px; }
.lineup-icons .ico.img { overflow: hidden; background: #1d1e24; }

/* ---------- app icons ---------- */

.ico {
  --size: 64px;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: 23%;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.2), rgb(255 255 255 / 0) 55%), var(--accent);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14), 0 1px 2px rgb(16 19 26 / 0.2);
}

.ico svg {
  width: 54%;
  height: 54%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg .fill { fill: currentColor; stroke: none; }

.ico.img { background: none; box-shadow: none; }
.ico.img img { width: 100%; height: 100%; transform: scale(1.17); }

/* ---------- sections + bento ---------- */

.section { padding-top: clamp(2.5rem, 6vw, 4.5rem); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 1.25rem;
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.section-head p { margin: 0; color: var(--muted); }

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  transition: border-color 0.2s ease, background-color 0.25s ease;
}

.card:hover { border-color: var(--border-strong); }

.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }

.card-body { display: flex; flex: 1; flex-direction: column; padding: 22px 24px 24px; }

.card-head { display: flex; align-items: center; gap: 12px; }
.card-head > div { min-width: 0; }
.card-head .ico { --size: 42px; border-radius: 12px; }

h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.kind { margin: 2px 0 0; color: var(--muted); font-size: 0.875rem; line-height: 1.35; }

.desc { max-width: 54ch; margin: 14px 0 0; color: var(--muted); font-size: 0.9375rem; }

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

.chips li {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--chip);
  font-size: 0.8125rem;
}

/* The illustration area on top of each card, tinted with the project's colour. */
.visual {
  container-type: inline-size;
  position: relative;
  display: grid;
  place-items: center;
  height: 340px;
  padding: 28px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--accent) var(--tint), var(--card));
  line-height: 1.35;
}

.visual > * { transition: translate 0.35s ease; }
.card:hover .visual > * { translate: 0 -4px; }

/* Phones rise from the bottom edge and get cropped by it. */
.visual.rise { place-items: start center; padding-top: 32px; padding-bottom: 0; }

.visual p { margin: 0; }

.visual svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- shared mock pieces ---------- */

.phone {
  width: 236px;
  height: 480px;
  padding: 9px;
  border-radius: 42px;
  background: #0d0f14;
  box-shadow: var(--shadow), inset 0 0 0 1.5px #2b2f39;
}

.screen {
  position: relative;
  height: 100%;
  padding: 42px 13px 13px;
  overflow: hidden;
  border-radius: 33px;
  background: var(--m-bg);
  color: var(--m-ink);
  font-size: 12px;
}

.screen::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 74px;
  height: 21px;
  border-radius: 12px;
  background: #0d0f14;
  translate: -50% 0;
}

.screen.dark { background: #0e1016; color: #e9ebf0; }

.window {
  width: min(100%, 470px);
  overflow: hidden;
  border-radius: 12px;
  font-size: 12px;
  box-shadow: var(--shadow);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
}

.titlebar i { flex: none; width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.titlebar i:nth-child(2) { background: #febc2e; }
.titlebar i:nth-child(3) { background: #28c840; }

.window.dark { background: #1a1c22; color: #d5d8df; }
.window.dark .titlebar { border-bottom: 1px solid #2e323c; background: #23262e; }

.embed {
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  background: #1c1e24;
  color: #dbdee1;
}

.visual .em-title { margin-bottom: 6px; color: #fff; font-weight: 700; }

/* ---------- Lumen Studio ---------- */

.seg { display: flex; margin: 0 auto; padding: 2px; border-radius: 7px; background: #15171c; }
.seg span { padding: 3px 9px; border-radius: 5px; color: #8e94a3; }
.seg .on { background: #3a3e4a; color: #fff; }

.lu-body { display: grid; grid-template-columns: 1fr 132px; height: 230px; }

.lu-canvas {
  position: relative;
  overflow: hidden;
  margin: 12px;
  border-radius: 4px;
  background: linear-gradient(#ffb46c, #f7866b 45%, #8a5cf6);
}

.lu-canvas span { position: absolute; border-radius: 50%; }
.lu-canvas .sun { top: 30%; left: 56%; width: 54px; height: 54px; background: #ffe3a8; }
.lu-canvas .hill.a { right: 25%; bottom: -55%; left: -20%; height: 100%; background: #3b2a6b; }
.lu-canvas .hill.b { right: -30%; bottom: -62%; left: 30%; height: 100%; background: #24194a; }

.lu-panel { padding: 14px 14px 0 4px; }
.visual .lu-panel p { margin-bottom: 6px; color: #8e94a3; font-size: 11px; }

.slider {
  position: relative;
  display: block;
  height: 3px;
  margin-bottom: 18px;
  border-radius: 2px;
  background: #3a3e4a;
}

.slider::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--v);
  border-radius: inherit;
  background: var(--accent);
}

.slider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--v);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  translate: -50% -50%;
}

/* ---------- Rewind ---------- */

.visual .rw-status { display: flex; align-items: center; gap: 7px; margin: 4px 0 14px; color: #a3a9b6; font-size: 11px; }

.rec { width: 8px; height: 8px; border-radius: 50%; background: #ff453a; }

.rw-clip { padding: 8px; border-radius: 16px; background: #1a1d25; }

.rw-thumb {
  position: relative;
  display: grid;
  place-items: center;
  height: 118px;
  border-radius: 10px;
  background: linear-gradient(transparent 60%, rgb(0 0 0 / 0.5)), linear-gradient(160deg, #3c5aa8, #1d2a55 55%, #0f1420);
}

.rw-thumb svg { width: 30px; height: 30px; color: #fff; }

.rw-dur {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgb(0 0 0 / 0.6);
  font-size: 10px;
}

.visual .rw-title { margin: 9px 4px 0; font-size: 13px; font-weight: 700; }
.visual .rw-sub { margin: 1px 4px 4px; color: #8b92a1; font-size: 11px; }

.rw-btn {
  display: block;
  margin-top: 10px;
  padding: 9px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-align: center;
}

/* ---------- Stock Tracker ---------- */

.st { position: relative; width: min(100%, 440px); height: 290px; }

.notif {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 86%;
  padding: 12px;
  border-radius: 16px;
  background: var(--m-notif);
  color: var(--m-ink);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.notif + .notif { margin-top: 10px; }
.notif.old { opacity: 0.85; scale: 0.95; transform-origin: top left; }

.n-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
}

.n-ico svg { width: 19px; height: 19px; }
.n-title { font-weight: 700; }
.n-body { color: var(--m-muted); }
.n-time { flex: none; margin-left: auto; color: var(--m-muted); font-size: 11px; }

.watch {
  position: absolute;
  right: 4px;
  bottom: 0;
  width: 130px;
  height: 156px;
  padding: 9px;
  border-radius: 38px;
  background: #0d0f14;
  box-shadow: var(--shadow), inset 0 0 0 1.5px #2b2f39;
}

.watch::after {
  content: "";
  position: absolute;
  top: 44px;
  right: -5px;
  width: 6px;
  height: 24px;
  border-radius: 3px;
  background: #2b2f39;
}

.watch-screen {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  height: 100%;
  padding: 12px;
  border-radius: 30px;
  background: #000;
  color: #fff;
  text-align: center;
}

.watch-screen .ok {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.watch-screen .ok svg { width: 17px; height: 17px; stroke-width: 3; }
.watch-screen b { font-size: 15px; }
.watch-screen small { color: #a0a0ab; font-size: 11px; }

/* ---------- SafeGuard ---------- */

.visual .sg-title { margin-top: 2px; font-size: 16px; font-weight: 700; }
.visual .sg-sub { margin-bottom: 14px; color: var(--m-muted); font-size: 11px; }

.ring {
  width: 132px;
  height: 132px;
  margin: 0 auto 16px;
  padding: 13px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--m-track) 0);
}

/* The readout sits on its own disc inside the progress ring. */
.ring div {
  display: grid;
  place-content: center;
  height: 100%;
  border-radius: 50%;
  background: var(--m-bg);
  text-align: center;
}

.ring b { display: block; font-size: 18px; }
.ring small { color: var(--m-muted); font-size: 11px; }

.sg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--m-fill);
  font-weight: 500;
}

.sg-row + .sg-row { margin-top: 7px; }
.sg-row small { margin-left: auto; color: var(--m-muted); }

.sg-dot {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--c);
  color: #fff;
}

.sg-dot svg { width: 14px; height: 14px; stroke-width: 2.4; }

/* ---------- Discord bots ---------- */

.dc,
.sa {
  width: min(100%, 450px);
  overflow: hidden;
  border-radius: 14px;
  background: #26282f;
  color: #dbdee1;
  box-shadow: var(--shadow);
}

.dc { font-size: 12.5px; }

.dc-msg { display: flex; gap: 12px; padding: 16px 16px 12px; }

.dc-av {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

.dc-av svg { width: 20px; height: 20px; }
.dc-body { flex: 1; min-width: 0; }

.visual .dc-name { margin-bottom: 6px; color: #fff; font-weight: 700; }

.tag {
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--accent) 65%, black);
  font-size: 10px;
  vertical-align: 1px;
}

.dc-name time { margin-left: 6px; color: #949ba4; font-size: 11px; font-weight: 400; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.fields small { display: block; margin-bottom: 1px; color: #949ba4; font-size: 11px; font-weight: 700; }
.fields .full { grid-column: 1 / -1; }

.dc-live {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 16px 66px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #1c1e24;
}

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #23a55a; }

.sa { display: grid; grid-template-columns: 146px 1fr; font-size: 12px; }

.sa-side { padding: 12px 8px 16px; background: #1e2026; }

.visual .sa-server {
  margin: 0 6px 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2e3038;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.visual .sa-cat { margin: 12px 6px 3px; color: #949ba4; font-size: 11px; font-weight: 700; }

.ch {
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 5px;
  color: #a7adb8;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ch .vc { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }

.sa-main { display: flex; flex-direction: column; gap: 12px; padding: 14px; }

.cmd { padding: 8px 10px; border-radius: 8px; background: #1e2026; color: #fff; font-weight: 600; }
.cmd span { margin-left: 4px; padding: 1px 6px; border-radius: 4px; background: #33363f; color: #c9cdd6; font-weight: 500; }

.sa .embed { background: #1e2026; }

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

.roles span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 12px;
  background: #1e2026;
  color: var(--c);
  font-weight: 600;
}

.roles span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* ---------- footer ---------- */

.site-foot { margin-top: clamp(4rem, 8vw, 6rem); border-top: 1px solid var(--border); }

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.75rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-foot p { margin: 0; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* ---------- narrow panels and screens ---------- */

@container (max-width: 400px) {
  .seg span { padding: 3px 6px; font-size: 11px; }
  .lu-body { grid-template-columns: 1fr 104px; height: 200px; }
  .sa { grid-template-columns: 118px 1fr; font-size: 11px; }
  .sa-main .embed { display: none; }
  .dc-live { margin-left: 16px; }
  .dc-name time { display: none; }
}

@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .span-4,
  .span-6,
  .span-8 { grid-column: auto; }
}

@media (max-width: 560px) {
  .head-nav a { padding: 6px 9px; }
  .visual { height: 300px; padding: 20px; }
  .visual.rise { padding-top: 26px; }
  .card-body { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body,
  .card,
  .visual > *,
  .lineup-icons a { transition: none; }
}
