@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-400-italic.woff2') format('woff2');
}

:root {
  --bg: oklch(0.975 0.008 75);
  --bg-card: oklch(0.99 0.005 75);
  --text: oklch(0.22 0.01 75);
  --text-dim1: oklch(0.35 0.01 75);
  --text-dim2: oklch(0.4 0.01 75);
  --text-faint1: oklch(0.45 0.01 75);
  --text-faint2: oklch(0.55 0.01 75);
  --accent-mid: oklch(0.5 0.15 200);
  --accent-dark: oklch(0.42 0.16 200);
  --accent-light: oklch(0.62 0.14 200);
  --accent-bright: oklch(0.68 0.13 200);
  --accent-icon: oklch(0.4 0.14 200);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: oklch(0.2 0.012 75);
  --bg-card: oklch(0.26 0.014 75);
  --text: oklch(0.93 0.006 75);
  --text-dim1: oklch(0.78 0.01 75);
  --text-dim2: oklch(0.72 0.01 75);
  --text-faint1: oklch(0.62 0.01 75);
  --text-faint2: oklch(0.55 0.01 75);
  --accent-mid: oklch(0.72 0.13 200);
  --accent-dark: oklch(0.78 0.12 200);
  --accent-light: oklch(0.68 0.14 200);
  --accent-bright: oklch(0.72 0.13 200);
  --accent-icon: oklch(0.75 0.12 200);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s, color 0.25s;
  max-width: 100%;
  overflow-x: hidden;
}

::selection { background: oklch(0.62 0.14 200 / 0.25); }

a {
  color: oklch(0.55 0.15 200);
  text-decoration: underline;
  text-decoration-color: oklch(0.55 0.15 200 / 0.4);
  text-underline-offset: 3px;
}
a:hover { color: oklch(0.65 0.15 200); }

@keyframes steam {
  0% { transform: translateY(0) scaleX(1); opacity: 0.5; }
  50% { transform: translateY(-10px) scaleX(1.4); opacity: 0.9; }
  100% { transform: translateY(-20px) scaleX(1); opacity: 0; }
}

.wrap { max-width: 1040px; margin: 0 auto; padding-inline: clamp(20px, 5vw, 48px); }

/* NAV */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; padding-block: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font-family: 'Instrument Serif', serif; font-size: 22px; letter-spacing: 0.3px; color: var(--text); }

.logo { position: relative; display: inline-flex; align-items: flex-end; justify-content: center; width: 30px; height: 28px; flex-shrink: 0; }
.logo .saucer { position: absolute; bottom: 3px; width: 22px; height: 3px; border-radius: 100px; background: color-mix(in oklch, var(--accent-dark) 25%, transparent); }
.logo .cup { position: absolute; bottom: 5px; width: 20px; height: 14px; background: linear-gradient(180deg, color-mix(in oklch, var(--accent-light) 70%, transparent), var(--accent-mid)); border-radius: 0 0 10px 10px; box-shadow: inset 0 -3px 4px color-mix(in oklch, var(--accent-dark) 50%, transparent); }
.logo .rim { position: absolute; bottom: 15px; width: 20px; height: 5px; border-radius: 100px; background: var(--accent-bright); }
.logo .handle { position: absolute; bottom: 8px; right: -4px; width: 9px; height: 9px; border: 2.5px solid var(--accent-dark); border-left: none; border-radius: 0 9px 9px 0; }
.logo .bag-string { position: absolute; bottom: 19px; left: 10px; width: 1px; height: 6px; background: color-mix(in oklch, var(--text) 40%, transparent); }
.logo .bag-tag { position: absolute; bottom: 24px; left: 6px; width: 8px; height: 6px; background: oklch(0.75 0.1 90); border-radius: 2px; transform: rotate(-8deg); }
.logo .steam { position: absolute; top: 0; width: 3px; height: 10px; border-radius: 100px; background: color-mix(in oklch, var(--text) 45%, transparent); animation: steam 2.2s ease-in-out infinite; }
.logo .steam:nth-child(7) { left: 4px; }
.logo .steam:nth-child(8) { left: 12px; animation-delay: 0.7s; }
.logo .steam:nth-child(9) { left: 20px; animation-delay: 1.4s; }

.nav-links { display: flex; align-items: center; gap: 24px; font-size: 13px; }
.nav-link { text-decoration: none; color: var(--text); opacity: 1; transition: opacity 0.15s ease; }
.nav-link:hover { opacity: 0.6; color: var(--text); }

.toggle { cursor: pointer; width: 38px; height: 21px; border-radius: 100px; background: color-mix(in oklch, var(--text) 18%, transparent); display: inline-flex; align-items: center; padding: 2px; border: none; transition: background 0.2s ease; }
.toggle:hover { background: color-mix(in oklch, var(--text) 30%, transparent); }
.toggle-knob { width: 15px; height: 15px; border-radius: 50%; background: var(--bg-card); box-shadow: 0 1px 2px rgba(0,0,0,0.2); transform: translateX(0); transition: transform 0.25s ease; }
:root[data-theme="dark"] .toggle-knob { transform: translateX(17px); }

/* simple sub-page header (back link + status badge) */
.simple-nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-block: 24px; }
.back-link { text-decoration: none; color: var(--text); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; opacity: 1; transition: opacity 0.15s ease; }
.back-link:hover { opacity: 0.6; color: var(--text); }

/* HERO */
.hero { padding-block: clamp(40px, 8vw, 64px) 96px; }
.eyebrow { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-mid); margin-bottom: 20px; }
h1 { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: clamp(40px, 8vw, 76px); line-height: 1.05; margin: 0 0 28px; max-width: 780px; text-wrap: pretty; }
.hero p { font-size: 16px; line-height: 1.7; max-width: 560px; color: var(--text-dim1); margin: 0 0 32px; }
.ctas { display: flex; flex-wrap: wrap; gap: 16px; }
.btn { text-decoration: none; padding: 14px 22px 16px; border-radius: 6px; font-size: 14px; line-height: 1.4; display: inline-block; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease; }
.btn-primary { background: var(--text); color: var(--bg); font-weight: 500; border: 1px solid var(--text); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px color-mix(in oklch, var(--text) 25%, transparent); color: var(--bg); }
.btn-outline { border: 1px solid color-mix(in oklch, var(--text) 20%, transparent); color: var(--text); }
.btn-outline:hover { transform: translateY(-2px); border-color: var(--text); box-shadow: 0 6px 16px color-mix(in oklch, var(--text) 12%, transparent); color: var(--text); }

/* SECTIONS */
section { padding-block: 40px 96px; }
.section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
h2 { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 40px; margin: 0; }
.section-tag { font-size: 13px; color: var(--text-faint2); }
.section-desc { font-size: 14px; color: var(--text-faint1); margin: 0 0 40px; max-width: 520px; }

/* PROJECTS */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 340px)); gap: 24px; }
.card { border: 1px solid color-mix(in oklch, var(--text) 12%, transparent); border-radius: 14px; padding: 32px; background: var(--bg-card); display: flex; flex-direction: column; gap: 16px; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px color-mix(in oklch, var(--text) 14%, transparent); }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-icon { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; display: block; }
.badge { font-size: 11px; padding: 4px 10px; border-radius: 100px; background: color-mix(in oklch, var(--accent-light) 12%, transparent); color: var(--accent-dark); }
.card h3 { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 26px; margin: 0 0 8px; }
.card p { font-size: 14px; line-height: 1.6; color: var(--text-dim2); margin: 0; }
.arrow-link { margin-top: auto; font-size: 13px; text-decoration: none; color: var(--accent-dark); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.arrow-link .arrow { display: inline-block; transition: transform 0.15s ease; }
.arrow-link:hover .arrow { transform: translateX(4px); }

/* DEVLOG */
.devlog-list { display: flex; flex-direction: column; }
.devlog-entry { display: grid; grid-template-columns: minmax(70px, 100px) 1fr; gap: 16px 24px; padding: 28px 0; border-top: 1px solid color-mix(in oklch, var(--text) 10%, transparent); }
.devlog-date { font-size: 13px; color: var(--text-faint2); }
.devlog-entry h3 { font-family: 'Instrument Serif', serif; font-weight: 400; font-size: 22px; margin: 0 0 8px; }
.devlog-entry p { font-size: 14px; line-height: 1.65; color: var(--text-dim2); margin: 0; max-width: 640px; }
.devlog-empty { border-top: 1px solid color-mix(in oklch, var(--text) 10%, transparent); padding: 28px 0 0; font-size: 13px; color: var(--text-faint2); }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 56px; align-items: start; }
.about-photo { position: relative; width: 100%; max-width: 320px; aspect-ratio: 1; border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--accent-light) 35%, transparent); background: var(--bg-card); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; display: block; filter: sepia(0.12) saturate(0.9); }
.about h2 { margin-bottom: 20px; }
.about p { font-size: 15px; line-height: 1.75; color: var(--text-dim1); margin: 0 0 16px; max-width: 560px; }
.about-links { display: flex; gap: 20px; font-size: 14px; margin-top: 12px; }

/* FOOTER */
footer { border-top: 1px solid color-mix(in oklch, var(--text) 10%, transparent); padding-block: 32px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-faint2); }

/* ============ RIVA PAGE ============ */

.riva-hero p { max-width: 620px; }

.riva-showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding-block: 0 96px; }
@media (max-width: 760px) {
  .riva-showcase { grid-template-columns: 1fr; }
}

/* feature list */
.features-list { display: flex; flex-direction: column; gap: 28px; }
.feature-item { display: flex; gap: 16px; align-items: flex-start; transition: transform 0.18s ease; }
.feature-item:hover { transform: translateX(4px); }
.feature-icon { width: 34px; height: 34px; border-radius: 9px; background: color-mix(in oklch, var(--accent-light) 12%, transparent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feature-dot { width: 12px; height: 12px; background: var(--accent-mid); }
.feature-dot--circle { border-radius: 50%; }
.feature-dot--square { border-radius: 3px; }
.feature-dot--triangle { clip-path: polygon(0 0, 100% 50%, 0 100%); }
.feature-dot--bar { width: 3px; height: 12px; border-radius: 2px; }
.feature-title { font-family: 'Instrument Serif', serif; font-size: 20px; margin-bottom: 4px; }
.feature-body { font-size: 14px; line-height: 1.6; color: var(--text-dim2); }

/* phone device mockup — colors inside are fixed (a screenshot of the app's own light UI), not theme-driven */
.device-wrap { display: flex; justify-content: center; }
.device {
  position: relative; width: min(300px, 78vw); aspect-ratio: 402 / 874;
  border-radius: 40px; overflow: hidden; background: #F2F2F7;
  box-shadow: 0 30px 60px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.12);
}
.device-island { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 34%; height: 3%; min-height: 18px; border-radius: 100px; background: #000; z-index: 30; }
.device-status { position: absolute; top: 17px; left: 24px; z-index: 20; font-family: -apple-system, system-ui, sans-serif; font-size: 13px; font-weight: 600; color: #000; }
.device-home { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); width: 34%; height: 4px; border-radius: 100px; background: rgba(0,0,0,0.25); z-index: 30; }

.device-screens { position: absolute; inset: 0; }
@keyframes device-fade { 0%, 30% { opacity: 1; } 36%, 100% { opacity: 0; } }
.device-screen {
  position: absolute; inset: 0; padding: 17% 7% 0; overflow: hidden;
  font-family: 'IBM Plex Mono', monospace; color: #1a1a1a;
  opacity: 0;
  animation: device-fade 9s infinite;
}
.device-screen:nth-child(1) { animation-delay: 0s; }
.device-screen:nth-child(2) { animation-delay: 3s; }
.device-screen:nth-child(3) { animation-delay: 6s; }

.d-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: #7a7a7a; }
.d-greeting { font-family: 'Instrument Serif', serif; font-size: 24px; margin-top: 3px; color: #1a1a1a; }
.d-label { font-size: 13px; font-weight: 600; margin: 20px 0 10px; color: #1a1a1a; }
.d-title { font-family: 'Instrument Serif', serif; font-size: 24px; line-height: 1.25; margin: 8px 0 0; color: #1a1a1a; }
.d-tag { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #7a7a7a; }

.d-row { display: flex; flex-direction: column; gap: 10px; }
.d-card { background: #fff; border-radius: 13px; padding: 12px 13px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.d-item { display: flex; align-items: flex-start; gap: 9px; }
.d-item-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.d-item-title { font-size: 13.5px; font-weight: 600; color: #1a1a1a; }
.d-item-meta { font-size: 11px; color: #7a7a7a; margin-top: 2px; }

.d-stream { display: flex; align-items: center; gap: 12px; }
.d-ring { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.d-ring-inner { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 700; color: #1a1a1a; }
.d-stream-name { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.d-stream-meta { font-size: 11px; color: #7a7a7a; margin-top: 1px; }

.d-next { background: color-mix(in oklch, var(--accent-light) 10%, #F2F2F7); border: 1px solid color-mix(in oklch, var(--accent-light) 25%, transparent); border-radius: 13px; padding: 14px; margin-top: 18px; }
.d-next-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-dark); font-weight: 600; }
.d-next-title { font-size: 15px; font-weight: 600; margin-top: 5px; color: #1a1a1a; }
.d-next-meta { font-size: 11px; color: var(--accent-dark); margin-top: 3px; }

.d-pill { display: inline-block; font-size: 10.5px; padding: 3px 9px; border-radius: 100px; background: oklch(0.95 0.014 70); color: #1a1a1a; margin-top: 8px; }

.d-call-card { margin-top: 22px; background: #fff; border-radius: 15px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.d-call-number { font-size: 15px; margin-top: 7px; color: #1a1a1a; }
.d-call-btn { margin-top: 12px; text-align: center; background: var(--accent-dark); color: #fff; border-radius: 11px; padding: 11px; font-size: 13.5px; font-weight: 600; }

/* CTA band */
.cta-band { text-align: center; }
.cta-band h2 { font-size: 34px; margin-bottom: 14px; }
.cta-band p { font-size: 15px; line-height: 1.7; color: var(--text-dim2); max-width: 480px; margin: 0 auto 28px; }
