/* drew2apps — shared styles */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #fbf8f3;
  --bg-2: #f3eee6;
  --card: #ffffff;
  --ink: #16131c;
  --muted: #6b6577;
  --line: rgba(22, 19, 28, 0.1);
  --red: #ff4d5e;
  --green: #1fcb7a;
  --blue: #3d7bff;
  --yellow: #ffc93c;
  --purple: #8b5cf6;
  --shadow: 0 1px 2px rgba(22, 19, 28, 0.06), 0 8px 24px rgba(22, 19, 28, 0.06);
  --shadow-lg: 0 2px 4px rgba(22, 19, 28, 0.06), 0 18px 40px rgba(22, 19, 28, 0.12);
  --radius: 22px;
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121016;
    --bg-2: #1a1720;
    --card: #1d1a24;
    --ink: #f4f1ea;
    --muted: #a49eb0;
    --line: rgba(244, 241, 234, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121016;
  --bg-2: #1a1720;
  --card: #1d1a24;
  --ink: #f4f1ea;
  --muted: #a49eb0;
  --line: rgba(244, 241, 234, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
p { margin: 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.03em;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
}
.logo .two {
  display: inline-block;
  margin: 0 1px;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--green), var(--blue), var(--purple), var(--red));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: slide 8s linear infinite;
  font-size: 1.15em;
}
@keyframes slide { to { background-position: 300% 0; } }

.nav { display: flex; gap: 4px; }
.nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { color: var(--ink); background: var(--bg-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--bg-2); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 40px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 18px;
}
.eyebrow .dots { display: inline-flex; gap: 4px; }
.eyebrow .dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.hero h1 { font-size: clamp(44px, 7vw, 84px); font-weight: 800; }
.hero h1 .r { color: var(--red); }
.hero h1 .g { color: var(--green); }
.hero h1 .b { color: var(--blue); }
.hero .lede { margin-top: 22px; font-size: 19px; color: var(--muted); max-width: 30em; }
.hero .cta { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 -1px var(--line); }
.btn:active { transform: translateY(0); }

/* RGB venn — additive color on a dark stage */
.stage {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 32px;
  background: #0d0b11;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
  border: 1px solid var(--line);
}
.stage .c {
  position: absolute;
  width: 54%;
  height: 54%;
  border-radius: 50%;
  mix-blend-mode: screen;
  filter: blur(0.5px);
}
.stage .c.r { background: #ff0000; left: 23%; top: 14%; animation: drift-r 14s ease-in-out infinite; }
.stage .c.g { background: #00ff00; left: 10%; top: 38%; animation: drift-g 16s ease-in-out infinite; }
.stage .c.b { background: #0000ff; left: 36%; top: 38%; animation: drift-b 18s ease-in-out infinite; }
@keyframes drift-r { 50% { transform: translate(4%, 6%); } }
@keyframes drift-g { 50% { transform: translate(6%, -4%); } }
@keyframes drift-b { 50% { transform: translate(-6%, -3%); } }
.stage .label {
  position: absolute;
  left: 18px;
  bottom: 16px;
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}

/* ---------- sections ---------- */
.section { padding: 48px 0 72px; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.section-head h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; }
.section-head p { color: var(--muted); }

/* ---------- app cards ---------- */
.apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.app-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.app-card:hover { transform: translateY(-4px) rotate(-0.4deg); box-shadow: var(--shadow-lg); }
.app-card .art { aspect-ratio: 4 / 3; position: relative; overflow: hidden; }
.app-card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.app-card h3 { font-size: 28px; font-weight: 800; display: flex; align-items: center; gap: 12px; }
.app-card h3 .ico { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.app-card h3 .ico.drop { border-radius: 0; box-shadow: none; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.18)); }
.app-card .tag { color: var(--muted); font-size: 15px; }
.app-card .play {
  margin-top: auto;
  padding-top: 14px;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.app-card:hover .play .arrow { transform: translateX(4px); }
.play .arrow { transition: transform 0.2s; }

/* card art: RGB */
.art-rgb { background: #0d0b11; display: grid; place-items: center; }
.art-rgb .sliders { width: 70%; display: grid; gap: 18px; }
.art-rgb .sl { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); position: relative; }
.art-rgb .sl::before { content: ""; position: absolute; inset: 0 auto 0 0; border-radius: 3px; width: var(--w); background: var(--c); }
.art-rgb .sl::after {
  content: ""; position: absolute; top: 50%; left: var(--w);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--c); transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px #0d0b11;
}
.art-rgb .swatch-word {
  font: 800 54px/1 var(--font-display);
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  text-align: center;
}
.art-rgb .swatch-word span:nth-child(1) { color: #ff4040; }
.art-rgb .swatch-word span:nth-child(2) { color: #34d058; }
.art-rgb .swatch-word span:nth-child(3) { color: #4d8bff; }

/* card art: Transition */
.art-transition { display: grid; place-items: center; animation: hue 14s linear infinite; background: linear-gradient(135deg, hsl(var(--h, 200) 85% 62%), hsl(calc(var(--h, 200) + 70) 80% 52%)); }
@property --h { syntax: "<number>"; inherits: true; initial-value: 0; }
@keyframes hue { from { --h: 0; } to { --h: 360; } }
.art-transition .clock {
  font: 800 64px/1 var(--font-display);
  color: #fff;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

/* card art: Colorize */
.art-colorize { background: var(--bg-2); display: grid; place-items: center; }
.art-colorize .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 62%; }
.art-colorize .grid i { aspect-ratio: 1; border-radius: 8px; background: #8b5cf6; display: block; }
.art-colorize .grid i.odd { background: #9d72f8; outline: 3px solid var(--ink); outline-offset: 2px; }

/* card art: Trace Race (featured, full width on desktop) */
.app-card.feature { grid-column: 1 / -1; flex-direction: row; }
.app-card.feature .art { flex: 0 0 52%; aspect-ratio: auto; min-height: 300px; }
.app-card.feature .body { justify-content: center; padding: 34px 36px; }
.app-card.feature h3 { font-size: 36px; }
.app-card.feature .tag { font-size: 17px; max-width: 30em; }
.badge-new { align-self: flex-start; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #2a1600; background: linear-gradient(180deg, #ffbf5c, #ff8f1f); padding: 5px 10px; border-radius: 999px; }
.art-trace { display: grid; place-items: center; background: radial-gradient(110% 90% at 50% 20%, #262e66, #0b1022 62%);
  background-image: radial-gradient(1.3px 1.3px at 14px 22px, #fff, transparent 70%), radial-gradient(1px 1px at 92px 70px, rgba(255,255,255,.6), transparent 70%), radial-gradient(1.4px 1.4px at 160px 140px, rgba(255,255,255,.8), transparent 70%), radial-gradient(1px 1px at 48px 176px, rgba(255,255,255,.5), transparent 70%), radial-gradient(110% 90% at 50% 20%, #262e66, #0b1022 62%);
  background-size: 210px 200px, 210px 200px, 210px 200px, 210px 200px, 100% 100%; }
.art-trace svg { width: min(62%, 240px); overflow: visible; }
.art-trace .base { fill: none; stroke: #35427e; stroke-width: 6; stroke-linejoin: round; }
.art-trace .glow { fill: none; stroke: #ff9f2e; stroke-width: 6; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(255, 159, 46, 0.9)); stroke-dasharray: 100 100; stroke-dashoffset: 100; animation: trace-draw 4.5s cubic-bezier(0.6, 0.1, 0.3, 1) infinite; }
@keyframes trace-draw { 0% { stroke-dashoffset: 100; opacity: 1; } 55% { stroke-dashoffset: 0; } 82% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }

/* ---------- now strip ---------- */
.now-strip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  box-shadow: var(--shadow);
}
.now-strip .badge {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--yellow), var(--red));
  color: #fff; font: 800 22px/1 var(--font-display);
}
.now-strip h3 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.now-strip p { color: var(--muted); font-size: 16px; }

/* ---------- about ---------- */
.about-hero { padding: 64px 0 24px; }
.about-hero h1 { font-size: clamp(44px, 7vw, 76px); font-weight: 800; }
.about-hero .lede { margin-top: 18px; font-size: 20px; color: var(--muted); max-width: 34em; }
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; padding-top: 24px; padding-bottom: 80px; align-items: start; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.panel h2 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.panel .meta { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.now-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.now-list li { display: grid; grid-template-columns: 14px 1fr; gap: 14px; }
.now-list li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; margin-top: 7px; background: var(--dot, var(--blue)); }
.now-list strong { display: block; }
.now-list span { color: var(--muted); font-size: 16px; }
.links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.links a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 14px; text-decoration: none;
  background: var(--bg-2); font-weight: 600;
  transition: transform 0.15s;
}
.links a:hover { transform: translateX(4px); }
.links a small { color: var(--muted); font-weight: 500; }
.prose p + p { margin-top: 14px; }

/* ---------- app pages ---------- */
.app-page { padding: 40px 0 72px; }
.app-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.app-top h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 800; }
.app-top .tag { color: var(--muted); margin-top: 6px; }
.back { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 15px; display: inline-block; margin-bottom: 18px; }
.back:hover { color: var(--ink); }
.app-frame {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.app-notes { margin-top: 28px; color: var(--muted); max-width: 40em; font-size: 16px; }
.app-notes strong { color: var(--ink); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.rgb-bar { display: flex; height: 4px; }
.rgb-bar i { flex: 1; }

/* ---------- 404 ---------- */
.notfound { padding: 96px 0; text-align: center; }
.notfound h1 { font-size: clamp(64px, 14vw, 160px); font-weight: 800; }
.notfound p { color: var(--muted); margin: 12px 0 28px; font-size: 19px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { padding-top: 40px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; }
  .stage { max-width: 420px; width: 100%; justify-self: center; }
  .apps { grid-template-columns: 1fr 1fr; }
  .app-card.feature .art { flex-basis: 46%; min-height: 260px; }
  .app-card.feature .body { padding: 26px; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .apps { grid-template-columns: 1fr; }
  .app-card.feature { flex-direction: column; }
  .app-card.feature .art { aspect-ratio: 4 / 3; min-height: 0; }
  .app-card.feature .body { padding: 20px 22px 22px; }
  .app-card.feature h3 { font-size: 28px; }
  .now-strip { grid-template-columns: 1fr; text-align: left; }
  .section-head { flex-direction: column; align-items: start; }
  .nav a { padding: 8px 10px; }
  .logo { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- standalone (Android app / installed) mode ----------
   Same pages, minus the website chrome. Turned on by ?standalone or when running inside the app wrapper. */
.standalone body { min-height: 100dvh; background: var(--app-bg, var(--bg)); }
.standalone .site-header, .standalone .site-footer, .standalone .rgb-bar,
.standalone .back, .standalone .app-top, .standalone .app-notes { display: none !important; }
.standalone .app-page { padding: 0; }
.standalone .app-page > .wrap { max-width: none; padding: 0; }
.standalone .app-frame { border: 0; border-radius: 0; box-shadow: none; min-height: 100dvh; }
/* Android edge-to-edge: pad for the status and navigation bars (Capacitor injects
   --safe-area-inset-* on older WebViews, newer ones support env()). */
.standalone {
  --sat: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --sar: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  --sab: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --sal: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
}
.standalone body { padding: var(--sat) var(--sar) var(--sab) var(--sal); }
.standalone .app-frame { min-height: calc(100dvh - var(--sat) - var(--sab)); }

/* ---------- thoughts (blog) ---------- */
.wrap.narrow { max-width: 760px; }
.blog-hero { padding: 64px 0 18px; }
.blog-hero h1 { font-size: clamp(44px, 7vw, 72px); font-weight: 800; }
.blog-hero .lede { margin-top: 14px; font-size: 20px; color: var(--muted); }
.blog-hero .lede a { color: inherit; font-size: 15px; font-weight: 600; margin-left: 6px; }
.post-list { list-style: none; padding: 0; margin: 18px 0 88px; border-top: 1px solid var(--line); }
.post-list li { border-bottom: 1px solid var(--line); }
.post-link { display: block; padding: 26px 0; text-decoration: none; color: inherit; }
.post-link time { color: var(--muted); font-size: 14px; font-weight: 600; }
.post-link h2 { font-size: clamp(24px, 3.4vw, 30px); font-weight: 800; margin-top: 6px; transition: color 0.2s; }
.post-link p { color: var(--muted); margin-top: 6px; }
.post-link:hover h2 { color: var(--blue); }
.empty-note { color: var(--muted); padding: 32px 0 96px; font-size: 18px; }
.post { padding: 48px 0 88px; }
.post-head h1 { font-size: clamp(36px, 6vw, 56px); font-weight: 800; line-height: 1.05; margin-top: 8px; }
.post-meta { color: var(--muted); margin-top: 14px; font-size: 15px; font-weight: 500; }
.prose { margin-top: 34px; font-size: 19px; line-height: 1.72; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 28px; font-weight: 800; margin-top: 1.8em; line-height: 1.2; }
.prose h3 { font-size: 22px; font-weight: 800; margin-top: 1.5em; }
.prose a { color: var(--blue); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--purple); color: var(--muted); }
.prose code { font: 0.86em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg-2); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--bg-2); padding: 16px 18px; border-radius: 14px; overflow-x: auto; font-size: 15px; line-height: 1.55; }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 14px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-nav a { text-decoration: none; color: inherit; font-weight: 700; }
.post-nav a small { display: block; color: var(--muted); font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.post-nav .older { text-align: right; }
