:root {
  --cream: #f5f3ee;
  --ink: #2b2a28;
  --mute: #8a8780;
  --coral: #ff6b4a;
  --rule: rgba(43, 42, 40, 0.10);

  --bg: var(--cream);
  --fg: var(--ink);
  --mute-fg: var(--mute);

  --max-width: 920px;
  --hero-height: 100vh; /* fallback */

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "Space Grotesk", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0c0a;
    --fg: #ece9e0;
    --mute-fg: #807d75;
    --rule: rgba(236, 233, 224, 0.10);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.hero #hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* ==================== topbar ==================== */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
  border: none;
}

.topbar nav {
  display: flex;
  gap: 22px;
}

.topbar nav a {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--mute-fg);
  text-decoration: none;
  border: none;
  transition: color 0.2s ease;
}

.topbar nav a:hover {
  color: var(--fg);
}

/* ==================== layout ==================== */

main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* ==================== hero ==================== */

.hero {
  position: relative;
  /* Full-bleed out of the max-width content column to span the viewport */
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  min-height: var(--hero-height);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 80px;
  padding-bottom: 60px;
}

/* Keep the hero text aligned with the rest of the page's readable column */
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* Scrim behind hero text so the headline stays crisp over the animation */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    120% 90% at 30% 50%,
    var(--bg) 0%,
    color-mix(in srgb, var(--bg) 70%, transparent) 45%,
    transparent 80%
  );
}

.hero .kicker,
.hero .hero-headline {
  position: relative;
  z-index: 2;
}

.kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 24px;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 9vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.hero-headline em {
  font-style: normal;
  font-weight: 700;
  color: var(--coral);
}

/* ==================== sections ==================== */

section {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
}

section h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute-fg);
  margin: 0 0 36px;
}

/* ==================== meter strip ==================== */

.meter-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.meter-cell {
  background: var(--bg);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.meter-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.meter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute-fg);
}

@media (max-width: 600px) {
  .meter-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== app rows ==================== */

.app-rows {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}

.app-rows li {
  list-style: none;
  margin: 0;
  border-bottom: 1px solid var(--rule);
}

.app-row {
  display: grid;
  grid-template-columns: 64px 1fr auto 32px;
  align-items: center;
  gap: 24px;
  padding: 28px 4px;
  text-decoration: none;
  color: inherit;
  border: none;
  transition: background 0.25s ease, padding-left 0.25s ease;
}

.app-row:hover {
  background: color-mix(in srgb, var(--coral) 6%, var(--bg));
  padding-left: 18px;
}

.row-num {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--mute-fg);
}

.row-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.row-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral);
}

.row-arrow {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--mute-fg);
  text-align: right;
  transition: color 0.25s ease, transform 0.25s ease;
}

.app-row:hover .row-arrow {
  color: var(--coral);
  transform: translateX(8px);
}

@media (max-width: 600px) {
  .app-row {
    grid-template-columns: 40px 1fr 24px;
    gap: 14px;
  }
  .row-tag {
    display: none;
  }
}

/* ==================== old grid (kept for backwards compat — unused now) ==================== */

/* ==================== apps grid ==================== */

.app-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.app-list li {
  list-style: none;
  margin: 0;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
  padding: 32px 28px 36px;
  text-decoration: none;
  color: inherit;
  border: none;
  position: relative;
  transition: background 0.25s ease;
}

.app-card:hover {
  background: color-mix(in srgb, var(--coral) 6%, var(--bg));
}

.app-card .app-arrow {
  position: absolute;
  right: 28px;
  bottom: 28px;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--mute-fg);
  transition: color 0.25s ease, transform 0.25s ease;
}

.app-card:hover .app-arrow {
  color: var(--coral);
  transform: translateX(6px);
}

.app-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.app-num {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--mute-fg);
}

.app-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral);
}

.app-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--fg);
}

.app-card p {
  font-size: 15px;
  color: var(--mute-fg);
  margin: 0;
  line-height: 1.55;
}

@media (max-width: 700px) {
  .app-list {
    grid-template-columns: 1fr;
  }
}

/* ==================== flagship case study ==================== */

.flagship-head {
  margin-bottom: 24px;
}

.flagship-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 10px;
}

.flagship-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--fg);
}

.flagship-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--mute-fg);
  max-width: 640px;
  margin: 0 0 40px;
}

.flagship-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.flagship-cell {
  background: var(--bg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flagship-cell-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
}

.flagship-cell p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
}

@media (max-width: 600px) {
  .flagship-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== dossier (experience / education) ==================== */

.dossier-rows {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}

.dossier-row {
  list-style: none;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 28px 4px;
  border-bottom: 1px solid var(--rule);
}

.dossier-when {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute-fg);
  padding-top: 6px;
}

.dossier-what h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3.5vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--fg);
}

.dossier-org {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--coral);
  margin: 0 0 8px;
}

.dossier-note {
  font-size: 15px;
  line-height: 1.55;
  color: var(--mute-fg);
  margin: 0;
  max-width: 560px;
}

@media (max-width: 600px) {
  .dossier-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .dossier-when {
    padding-top: 0;
  }
}

/* ==================== working stack ==================== */

.stack-groups {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}

.stack-group {
  list-style: none;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 24px 4px;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.stack-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral);
}

.stack-group p {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg);
}

@media (max-width: 600px) {
  .stack-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ==================== contact lead ==================== */

.contact-lead {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 36px;
}

/* ==================== elsewhere ==================== */

.link-rows {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}

.link-row {
  list-style: none;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
}

.link-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute-fg);
  align-self: center;
}

.link-row a {
  color: var(--fg);
  text-decoration: none;
  border: none;
  transition: color 0.2s ease;
}

.link-row a:hover {
  color: var(--coral);
}

.placeholder-row .placeholder {
  color: var(--mute-fg);
  font-style: italic;
  font-size: 14px;
}

/* ==================== philosophy ==================== */

.philosophy ul.bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 32px;
}

.philosophy li {
  font-size: 15px;
  color: var(--mute-fg);
  line-height: 1.6;
  padding-left: 0;
}

.philosophy li strong {
  display: block;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
  font-size: 15px;
}

@media (max-width: 700px) {
  .philosophy ul.bullets {
    grid-template-columns: 1fr;
  }
}

/* ==================== generic content (used by /privacy & /support) ==================== */

main h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 80px 0 8px;
}

main h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 28px 0 8px;
  color: var(--fg);
}

main p, main li {
  font-size: 16px;
  color: var(--fg);
}

.lead {
  font-size: 18px;
  color: var(--mute-fg);
}

.meta {
  color: var(--mute-fg);
  font-size: 14px;
  margin-top: -4px;
}

main ul {
  padding-left: 20px;
}

main a {
  color: var(--coral);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 0.2s ease;
}

main a:hover {
  color: var(--fg);
}

.contact {
  font-size: 18px;
  margin: 24px 0;
}

/* ==================== app detail pages ==================== */

main .back {
  margin-top: 100px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--mute-fg);
}

main .back a {
  color: var(--mute-fg);
  border: none;
}

main .back a:hover {
  color: var(--fg);
}

main .kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 12px;
}

.placeholder {
  color: var(--mute-fg);
  font-style: italic;
}

.app-section {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

.app-section h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute-fg);
  margin: 0 0 12px;
}

/* ==================== footer ==================== */

footer {
  margin-top: 80px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  color: var(--mute-fg);
  font-size: 14px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer a {
  color: var(--mute-fg);
  text-decoration: none;
  border: none;
}

footer a:hover {
  color: var(--fg);
}

.footer-end {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

/* Subtle, low-key grenade — the hidden flashbang trigger. */
.footer-grenade {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.28;
  filter: grayscale(0.4);
  transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.footer-grenade:hover,
.footer-grenade:focus-visible {
  opacity: 1;
  filter: grayscale(0);
  transform: translateY(-1px) rotate(-8deg);
  outline: none;
}

@media print {
  .footer-grenade { display: none !important; }
}

/* ==================== reveal ==================== */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  #hero-canvas { display: none; }
}
