/* ---------- Fonts ----------
   Self-hosted so a page view reaches no host but this one. See
   assets/fonts/README.md for the sources and licence. */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/space-grotesk-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/space-grotesk-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-500-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #dfe4ea;
  --bg-2: #d4dae2;
  --slab: #f3f6f9;
  --slab-2: #e8edf2;
  --ink: #131820;
  --ink-2: #4c5563;
  --ink-3: #5a6472;                     /* the design's #5f6a78, darkened to clear 4.5:1 on --bg */
  --edge: #b9c2cd;
  --edge-2: #cbd3dc;
  --accent: #1a5fd0;                    /* the design's #1f6feb, darkened for the same reason */
  --accent-ink: #ffffff;

  /* Slabs sit on the page rather than floating over it: a white inset hairline,
     a hard edge underneath, then the diffuse shadow. */
  --lift: 0 1px 0 #fff inset, 0 2px 0 var(--edge), 0 3px 6px rgba(19, 24, 32, .10);
  --lift-hi: 0 1px 0 #fff inset, 0 6px 0 var(--edge), 0 22px 40px -12px rgba(19, 24, 32, .30);

  --sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Names the admin stylesheet and the app pages still ask for. */
  --panel: var(--slab);
  --line: var(--edge-2);
  --line-2: var(--slab-2);
  --shadow: var(--lift);
}

[data-theme="dark"] {
  --bg: #10141a;
  --bg-2: #0b0e13;
  --slab: #1a1f27;
  --slab-2: #151a21;
  --ink: #eef2f7;
  --ink-2: #a3adba;
  --ink-3: #8f99a6;
  --edge: #05070a;
  --edge-2: #2a313b;
  --accent: #59a4ff;
  --accent-ink: #06101f;
  --lift: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 2px 0 var(--edge), 0 3px 6px rgba(0, 0, 0, .5);
  --lift-hi: 0 1px 0 rgba(255, 255, 255, .10) inset, 0 6px 0 var(--edge), 0 22px 40px -12px rgba(0, 0, 0, .7);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background: radial-gradient(120% 80% at 50% -10%, var(--slab-2) 0%, var(--bg) 45%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }

@keyframes sct-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Staggered by --rise, set per element so the order survives a variable app list. */
[data-rise] {
  animation: sct-rise .7s cubic-bezier(.22, .7, .25, 1) both;
  animation-delay: calc(var(--rise, 0) * .08s);
}

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

/* Shared max-width container used by header, sections and footer. */
.hero, .work, .about, .contact, .site-header .bar, .site-footer .bar {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
}

/* ---------- Header ---------- */
.site-header .bar {
  padding-top: 26px;
  padding-bottom: 26px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* The brand is a slab of its own, not a bare image. */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  padding: 7px 12px 7px 8px;
  border-radius: 12px;
  background: var(--slab);
  box-shadow: var(--lift);
  transform-style: preserve-3d;
}

.brand:hover { color: var(--ink); }

/* The logo and emblem are dark navy on transparent. On the dark theme that
   sits at roughly 2:1 against the background, so lift them. A purpose-made
   light variant would beat a filter — see README. */
.brand-logo, .brand-emblem { display: block; flex: none; width: auto; }

[data-theme="dark"] .brand-logo,
[data-theme="dark"] .brand-emblem { filter: brightness(1.6) saturate(1.05); }

.brand-logo { height: 30px; }
.brand-emblem { height: 22px; }

.site-header .nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 13px;
}

.site-header .nav a {
  color: var(--ink-2);
  padding: 8px 12px;
  border-radius: 9px;
}

.site-header .nav a:hover { color: var(--ink); background: var(--slab-2); }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: relative;
  width: 58px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--slab-2);
  box-shadow: 0 2px 0 var(--edge), inset 0 2px 4px rgba(19, 24, 32, .14);
  cursor: pointer;
  flex: none;
}

.theme-toggle .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--slab);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .28), 0 4px 8px rgba(0, 0, 0, .18);
  transition: transform .28s cubic-bezier(.3, 1.4, .5, 1), background .28s ease;
}

[data-theme="dark"] .theme-toggle .knob {
  transform: translateX(26px);
  background: var(--accent);
}

/* ---------- Hero ---------- */
.hero { padding-top: 34px; padding-bottom: 10px; }

.hero h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.025em;
  font-weight: 600;
  max-width: 22ch;
  text-wrap: pretty;
}

/* ---------- Work ---------- */
.work {
  padding-top: 44px;
  padding-bottom: 20px;
  perspective: 1400px;
}

.work-stack { display: flex; flex-direction: column; gap: 20px; }

.slab {
  border-radius: 20px;
  background: var(--slab);
  box-shadow: var(--lift);
  color: var(--ink);
  transform-style: preserve-3d;
}

a.slab:hover { color: var(--ink); }

/* The number / hairline / badge strip that opens every card. */
.rule { display: flex; align-items: center; gap: 12px; }
.rule-num { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.rule-line { height: 1px; flex: 1; background: var(--edge-2); }

.badge {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  flex: none;
}

.badge-available { color: var(--accent-ink); background: var(--accent); }
.badge-wip { color: var(--ink-3); border: 1px solid var(--edge-2); padding: 4px 8px; }

/* ---------- Launched apps: the wide blocks ---------- */
.launched { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }

/* Nothing to sit beside when an app has no screenshot yet. */
.launched-bare { grid-template-columns: 1fr; }

.launched-copy { padding: 32px 34px 30px; display: flex; flex-direction: column; }

.app-id {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  transform: translateZ(26px);
}

.app-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: block;
  flex: none;
  filter: drop-shadow(0 6px 12px rgba(19, 24, 32, .22));
}

.app-icon-placeholder {
  border: 1px dashed var(--edge-2);
  background: repeating-linear-gradient(135deg, var(--slab-2) 0 4px, transparent 4px 8px);
  filter: none;
}

.app-name { margin: 0; font-size: 34px; line-height: 1; letter-spacing: -.03em; font-weight: 600; }

.app-meta { margin-top: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }

.app-desc {
  margin: 22px 0 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 44ch;
  text-wrap: pretty;
}

.launched-cta {
  margin-top: auto;
  padding-top: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--accent);
}

.launched-cta .arrow { font-family: var(--mono); }

.launched-shot {
  background: linear-gradient(160deg, var(--slab-2), var(--bg));
  border-left: 1px solid var(--edge-2);
  border-radius: 0 20px 20px 0;
  padding: 26px;
  display: flex;
}

/* A fixed 16:10 frame, so the shape never depends on how long the copy beside
   it runs, and the screenshot is scaled to fit rather than cropped to fill. */

.shot-frame {
  position: relative;
  flex: 1;
  align-self: center;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--slab-2);
  box-shadow: 0 14px 30px -14px rgba(19, 24, 32, .45);
  transform: translateZ(34px);
}

.shot-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* ---------- In-progress apps: the smaller cards ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.wip { padding: 30px; display: flex; flex-direction: column; }

.wip-name {
  margin: 20px 0 0;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -.025em;
  font-weight: 600;
  transform: translateZ(22px);
}

.wip .app-desc { margin: 18px 0 0; font-size: 15px; }

.progress { margin-top: auto; padding-top: 24px; display: flex; gap: 5px; }
.progress span { height: 6px; flex: 1; border-radius: 3px; background: var(--edge-2); }
.progress .progress-done { background: var(--accent); }

.next-card {
  border-radius: 20px;
  border: 1px dashed var(--edge-2);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 200px;
}

.next-card p { margin: 14px 0 0; font-size: 15px; line-height: 1.6; color: var(--ink-3); text-wrap: pretty; }

/* ---------- About ---------- */
.about { padding-top: 64px; padding-bottom: 64px; }

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 44px;
  align-items: start;
}

.section-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.about-headline {
  margin: 18px 0 0;
  font-size: 24px;
  line-height: 1.32;
  letter-spacing: -.02em;
  max-width: 26ch;
  text-wrap: pretty;
}

.about-body { display: flex; flex-direction: column; gap: 20px; padding-top: 4px; }

.about-body p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Contact ---------- */
.contact { padding-bottom: 80px; perspective: 1400px; }

.contact-panel {
  border-radius: 22px;
  background: var(--slab);
  box-shadow: var(--lift);
  padding: 46px 34px;
  text-align: center;
  transform-style: preserve-3d;
}

.contact-panel h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -.025em;
  font-weight: 600;
  transform: translateZ(24px);
}

.contact-panel p {
  margin: 14px auto 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 44ch;
  text-wrap: pretty;
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.actions-center { justify-content: center; }
.contact-panel .actions { transform: translateZ(16px); }

.btn {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .2s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .28);
}

.btn-primary:hover { color: var(--accent-ink); transform: translateY(-2px); }

.btn-secondary { background: var(--slab); color: var(--ink); box-shadow: var(--lift); }
.btn-secondary:hover { color: var(--ink); transform: translateY(-2px); }

/* ---------- Footer ---------- */
.site-footer .bar {
  padding-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.site-footer .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  background: none;
  box-shadow: none;
  color: var(--ink-3);
}

.site-footer .nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer .nav a { color: var(--ink-3); }
.site-footer .nav a:hover { color: var(--ink); }

/* ---------- Error page ---------- */
.error-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 100px 28px 120px;
  text-align: center;
}

.error-code {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 22px;
}

.error-page h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.025em;
  font-weight: 600;
}

.error-page p {
  margin: 18px auto 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 44ch;
  text-wrap: pretty;
}

.error-page .actions { justify-content: center; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .launched { grid-template-columns: 1fr; }

  .launched-shot {
    border-left: none;
    border-top: 1px solid var(--edge-2);
    border-radius: 0 0 20px 20px;
  }
}

@media (max-width: 640px) {
  .hero, .work, .about, .contact,
  .site-header .bar, .site-footer .bar {
    padding-left: 20px;
    padding-right: 20px;
  }

  .launched-copy { padding: 26px 24px 24px; }
  .wip, .next-card { padding: 24px; }
  .app-name { font-size: 28px; }
  .contact-panel { padding: 34px 22px; }
  .about-grid { gap: 28px; }
  .btn { width: 100%; justify-content: center; }
  .brand-logo { height: 26px; }
}
