:root {
  --bg: #07080c;
  --bg-soft: #0d0f16;
  --ink: #eef0f4;
  --ink-muted: #9aa0ad;
  --ink-faint: #5c6270;
  --gold: #c9a86a;
  --gold-bright: #e3c98f;
  --buy: #3fbfa3;
  --buy-bright: #5fd8bd;
  --portal: #9b8cff;
  --portal-bright: #b6abff;
  --line: rgba(255, 255, 255, 0.08);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --wrap: 1080px;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- animated background canvas ---- */

#mesh {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.55;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.monogram {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  transition: border-color 0.3s;
}

.monogram:hover {
  border-color: var(--gold);
}

.site-header nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-left: 2.25rem;
  transition: color 0.3s;
}

.site-header nav a:hover {
  color: var(--gold-bright);
}

/* ---- shared ---- */

section {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 6rem 1.5rem;
}

.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.75rem;
}

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: #0a0a0f;
  background: var(--gold);
  padding: 0.85rem 1.9rem;
  border-radius: 3px;
  border: 1px solid var(--gold);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.btn:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn.ghost:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: transparent;
}

.btn-playbook {
  background: var(--buy);
  border-color: var(--buy);
  color: #04120e;
}

.btn-playbook:hover {
  background: var(--buy-bright);
  border-color: var(--buy-bright);
  color: #04120e;
}

.btn-portal {
  background: var(--portal);
  border-color: var(--portal);
  color: #0a0a12;
}

.btn-portal:hover {
  background: var(--portal-bright);
  border-color: var(--portal-bright);
  color: #0a0a12;
}

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

.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 3rem;
}

.hero-photo-frame {
  position: relative;
  width: 132px;
  height: 132px;
  margin-bottom: 2rem;
  border-radius: 50%;
}

.hero-photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 0 24px 12px rgba(0, 0, 0, 0.75);
}

.hero-photo {
  display: block;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 6px rgba(201, 168, 106, 0.12);
  background: transparent;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3.4rem, 11vw, 8.5rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.hero h1 .line {
  display: block;
}

.hero h1 .line:last-child {
  color: transparent;
  -webkit-text-stroke: 1px rgba(238, 240, 244, 0.55);
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  color: var(--gold-bright);
  margin-top: 2.25rem;
  letter-spacing: 0.04em;
}

.hero-sub {
  max-width: 34rem;
  color: var(--ink-muted);
  margin-top: 1.25rem;
  font-size: 1.02rem;
}

.hero-cta {
  margin-top: 2.75rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* reveal animation */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.reveal:nth-child(1) { animation-delay: 0.05s; }
.reveal:nth-child(2) { animation-delay: 0.18s; }
.reveal:nth-child(3) { animation-delay: 0.34s; }
.reveal:nth-child(4) { animation-delay: 0.48s; }
.reveal:nth-child(5) { animation-delay: 0.62s; }
.reveal:nth-child(6) { animation-delay: 0.76s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* scroll-triggered reveal for content below the fold */

.scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.scroll-reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

/* ---- pillars ---- */

.pillars {
  border-top: 1px solid var(--line);
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.pillar {
  display: block;
  width: 100%;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.005));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2.25rem 2rem;
  font-family: var(--sans);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.35s, transform 0.35s;
}

.pillar:hover {
  border-color: rgba(201, 168, 106, 0.45);
  transform: translateY(-4px);
}

.pillar-num {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 0.95rem;
  letter-spacing: 0.15em;
}

.pillar h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.7rem;
  margin: 0.9rem 0 1rem;
}

.pillar p {
  color: var(--ink-muted);
  font-size: 0.96rem;
  margin-bottom: 1.25rem;
}

.pillar-link {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.principle-trigger {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sans);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.principle-trigger:hover h2 {
  color: var(--gold-bright);
}

.principle-trigger .pillar-link {
  display: inline-block;
  margin-top: 1rem;
}

/* ---- philosophy ---- */

.philosophy {
  border-top: 1px solid var(--line);
}

.principles {
  list-style: none;
  padding: 0;
  counter-reset: principle;
  max-width: 46rem;
}

.principles li {
  counter-increment: principle;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  padding-left: 4.5rem;
}

.principles li:last-child {
  border-bottom: none;
}

.principles li::before {
  content: counter(principle, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2.65rem;
  font-family: var(--serif);
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.15em;
}

.principles h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 0.75rem;
}

.principles p {
  color: var(--ink-muted);
  max-width: 38rem;
}

/* ---- quote band ---- */

.quote-band {
  text-align: center;
  padding-top: 7rem;
  padding-bottom: 2rem;
}

.quote-band p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  line-height: 1.35;
  max-width: 20em;
  margin: 0 auto;
  color: var(--ink);
}

.quote-band cite {
  display: block;
  margin-top: 1.75rem;
  font-style: normal;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---- stats band ---- */

.stats-band {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2.25rem 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
}

.stat {
  flex: 1;
  min-width: 130px;
  text-align: center;
}

.stat-num {
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  color: var(--gold-bright);
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---- playbook moment ---- */

.playbook {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
}

.playbook-inner {
  position: relative;
  border: 1px solid rgba(63, 191, 163, 0.35);
  border-radius: 12px;
  padding: 3rem 2.75rem;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(63, 191, 163, 0.12), transparent 55%),
    linear-gradient(160deg, rgba(63, 191, 163, 0.05), rgba(255, 255, 255, 0.005));
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 460px);
  gap: 3.25rem;
  align-items: center;
}

/* Key phrases in the suite copy pop bright against the muted body text. */
.playbook-text strong {
  color: var(--ink);
  font-weight: 600;
}

/* Floating book cover that gently flips through the cover + five sample pages
   (crossfade), mirroring the Gumroad landing page. */
.playbook-cover {
  perspective: 1200px;
}
.pb-cover-stack {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 560 / 724;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 34px 70px -26px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.02);
  cursor: zoom-in;
  animation: pb-float 6s ease-in-out infinite;
}
.pb-cover-stack:hover {
  transform: translateY(-4px) scale(1.012);
}
.pb-zoom-hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 11px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
.pb-cover-stack:hover .pb-zoom-hint,
.pb-cover-stack:focus-visible .pb-zoom-hint {
  opacity: 1;
  transform: none;
}

/* Zoom lightbox for the sample pages. */
.pb-zoom {
  border: 0;
  padding: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  place-items: center;
}
.pb-zoom[open] {
  display: grid;
}
.pb-zoom::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
.pb-zoom img {
  max-width: 92vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
.pb-zoom-close {
  position: fixed;
  top: 16px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}
.pb-zoom-close:hover {
  background: rgba(255, 255, 255, 0.24);
}
.pb-zoom-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
}
.pb-zoom-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}
.pb-zoom-prev {
  left: 20px;
}
.pb-zoom-next {
  right: 20px;
}
@media (max-width: 560px) {
  .pb-zoom-nav {
    width: 42px;
    height: 42px;
    font-size: 1.6rem;
  }
  .pb-zoom-prev {
    left: 8px;
  }
  .pb-zoom-next {
    right: 8px;
  }
}
.pb-cf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.pb-cf.on {
  opacity: 1;
}
@keyframes pb-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -9px; }
}
@media (prefers-reduced-motion: reduce) {
  .pb-cover-stack { animation: none; }
  .pb-cf { transition: none; }
}
@media (max-width: 720px) {
  .playbook-inner {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }
  .playbook-cover {
    order: -1;
    max-width: 300px;
    margin: 0 auto;
  }
}

.playbook-kicker {
  color: var(--buy-bright);
}

.playbook h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
}

.playbook-lead {
  color: var(--ink-muted);
  max-width: 42rem;
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
}

.playbook-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2.25rem;
  max-width: 44rem;
}

.playbook-features li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.85rem;
  color: var(--ink);
  font-size: 0.96rem;
}

.playbook-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--buy);
  box-shadow: 0 0 0 4px rgba(63, 191, 163, 0.15);
}

/* Stacked, not side by side: the "last updated" line sits directly above the
   download button so the date reads as a property of the file you're about to
   get, not as a separate note beside it. */
.playbook-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.playbook-updated {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

.playbook-cta .btn-playbook {
  font-size: 0.95rem;
  padding: 1rem 2.2rem;
}

@media (max-width: 620px) {
  .playbook-inner {
    padding: 2.25rem 1.5rem;
  }
}

/* ---- projects ---- */

.projects {
  border-top: 1px solid var(--line);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  display: block;
  width: 100%;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.005));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2rem 1.9rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.35s, transform 0.35s;
}

.project-card:hover {
  border-color: rgba(201, 168, 106, 0.45);
  transform: translateY(-4px);
  text-decoration: none;
}

.project-status {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  margin-bottom: 1rem;
}

.project-status.done {
  color: var(--gold-bright);
  border: 1px solid rgba(201, 168, 106, 0.4);
}

.project-status.progress {
  color: #8fb3a8;
  border: 1px solid rgba(143, 179, 168, 0.4);
}

.project-card h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.project-card p {
  color: var(--ink-muted);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.project-link {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---- project subpage ---- */

.project-hero {
  padding-top: 4rem;
}

.back-link {
  display: inline-block;
  color: var(--ink-faint);
  font-size: 0.85rem;
  text-decoration: none;
  margin-bottom: 2.5rem;
}

.back-link:hover {
  color: var(--gold-bright);
}

.project-hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.1;
  max-width: 20em;
  margin: 1.25rem 0 1.5rem;
}

.project-hero .project-tagline {
  color: var(--ink-muted);
  font-size: 1.1rem;
  max-width: 38rem;
}

.project-body {
  max-width: 42rem;
  padding-top: 1rem;
}

.project-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  margin: 3rem 0 1rem;
}

.project-body h2:first-child {
  margin-top: 0;
}

.project-body p {
  color: var(--ink-muted);
}

.project-body p + p {
  margin-top: 1rem;
}

.project-body ul {
  margin-top: 1rem;
  padding-left: 1.25rem;
  color: var(--ink-muted);
}

.project-body li {
  margin-bottom: 0.6rem;
}

.project-body li::marker {
  color: var(--gold);
}

.project-footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding-top: 3rem;
  padding-bottom: 5rem;
}

/* ---- about ---- */

.about {
  border-top: 1px solid var(--line);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 4rem;
}

.about-lead {
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.about-text p + p {
  margin-top: 1.25rem;
  color: var(--ink-muted);
}

.credentials {
  border-left: 1px solid var(--line);
  padding-left: 2.5rem;
  align-self: start;
}

.credentials h3 {
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.credentials ul {
  list-style: none;
  padding: 0;
}

.credentials li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.credentials li:last-child {
  border-bottom: none;
}

@media (max-width: 760px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .credentials {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 2rem;
  }
}

.about-more {
  margin-top: 2.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.about-more .btn {
  cursor: pointer;
}

/* ---- connect ---- */

.connect {
  border-top: 1px solid var(--line);
  text-align: center;
  padding-bottom: 7rem;
}

.connect h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.4rem);
  max-width: 16em;
  margin: 0 auto;
}

.connect-sub {
  color: var(--ink-muted);
  margin-top: 1.25rem;
}

.connect-links {
  margin-top: 2.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- contact form ---- */

.contact-form {
  max-width: 34rem;
  margin: 2.75rem auto 0;
  text-align: left;
}

.hidden-field {
  display: none;
}

.contact-form label {
  display: block;
  margin-bottom: 1.25rem;
}

.contact-form label span {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.8rem 1rem;
  transition: border-color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.contact-form textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.form-actions .btn {
  cursor: pointer;
}

/* ---- credentials modal ---- */

.creds-more {
  margin-top: 1.5rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--gold);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}

.creds-more:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

#game-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem 1.75rem 1.75rem;
  width: calc(100vw - 1.5rem);
  max-height: 92vh;
  overflow: hidden;
}

#share-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem 1.75rem 1.9rem;
  max-width: 560px;
  width: calc(100vw - 3rem);
  max-height: 92vh;
  overflow-y: auto;
}

#share-modal::backdrop {
  background: rgba(4, 5, 8, 0.85);
  backdrop-filter: blur(3px);
}

.share-card {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0.75rem 0 1.25rem;
}

.share-field {
  margin-bottom: 1.25rem;
}

.share-field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}

.share-field input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.7rem 0.9rem;
  transition: border-color 0.3s;
}

.share-field input:focus {
  outline: none;
  border-color: var(--gold);
}

.share-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.share-actions .btn {
  cursor: pointer;
  flex: 1;
  min-width: 130px;
  text-align: center;
}

#game-modal::backdrop {
  background: rgba(4, 5, 8, 0.8);
  backdrop-filter: blur(3px);
}

.game-wrap {
  position: relative;
  margin-top: 0.75rem;
}

#game-canvas {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(201, 168, 106, 0.05), transparent 60%),
    #07080c;
  cursor: pointer;
  touch-action: none;
}

.game-hud {
  position: absolute;
  top: 0.9rem;
  left: 1.1rem;
  right: 1.1rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.game-hud strong {
  color: var(--gold-bright);
  font-weight: 600;
  margin-left: 0.35rem;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(7, 8, 12, 0.82);
  border-radius: 8px;
  padding: 1.5rem;
}

.game-overlay.game-hidden {
  display: none;
}

.game-hidden {
  display: none !important;
}

.game-overlay h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.5rem;
}

.game-tag {
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.game-instructions {
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 1.75rem;
  max-width: 30rem;
}

.game-result {
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

.game-result strong {
  color: var(--gold-bright);
}

.game-best-line {
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  display: none;
}

.game-over-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.game-over-actions .btn {
  cursor: pointer;
}

@media (max-width: 640px) {
  /* Full-screen on mobile: the floating-card treatment (rounded corners,
     backdrop margin) reads as cramped at phone width, and every pixel of
     screen matters for an arcade game played with a thumb. env() insets
     keep the header clear of a notch/dynamic island and the actions clear
     of the home-indicator area. */
  /* [open] matters here, not just as a hook: an ID selector's specificity
     beats the UA stylesheet's dialog:not([open]) { display: none }, so a
     bare #game-modal { display: flex } rule would force the dialog to
     render full-screen even while closed -- visible on page load, and
     stuck on screen (with the backdrop gone) after close(). Scoping every
     property to #game-modal[open] means this block only ever applies while
     the dialog is genuinely open, so the browser's native hide-when-closed
     behavior is never overridden. */
  #game-modal[open] {
    top: 0;
    left: 0;
    transform: none;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* falls back to the line above on browsers without dvh */
    max-width: none;
    max-height: none;
    border: none;
    border-radius: 0;
    padding: calc(1rem + env(safe-area-inset-top, 0px))
      calc(1rem + env(safe-area-inset-right, 0px))
      calc(1rem + env(safe-area-inset-bottom, 0px))
      calc(1rem + env(safe-area-inset-left, 0px));
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  /* The canvas locks to an 860:480 ratio, so at phone widths it renders too
     short to hold the start/end overlay text without overflowing into the
     modal header above. Decouple the canvas from the wrap's flow height so
     the wrap can be tall enough for the overlay on its own. flex: 1 lets the
     wrap (and the centered canvas inside it) claim the full screen instead
     of just its min-height. */
  .game-wrap {
    flex: 1;
    min-height: 22rem;
  }

  #game-canvas {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
  }

  .game-overlay {
    padding: 1rem;
  }

  .game-overlay h2 {
    font-size: 1.6rem;
  }

  .game-tag {
    font-size: 0.92rem;
    margin-bottom: 0.6rem;
  }

  .game-instructions {
    font-size: 0.8rem;
    line-height: 1.5;
    margin-bottom: 1rem;
  }
}

.hero-cta .btn {
  cursor: pointer;
}

#essay-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2rem 2.5rem 2.75rem;
  max-width: 700px;
  width: calc(100vw - 3rem);
  max-height: 85vh;
  overflow-y: auto;
}

#essay-modal::backdrop {
  background: rgba(4, 5, 8, 0.75);
  backdrop-filter: blur(3px);
}

#essay-modal-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0.5rem 0 1.5rem;
}

.essay-body {
  max-width: 60ch;
  margin: 0 auto;
}

.essay-body p {
  color: var(--ink-muted);
  line-height: 1.75;
  margin-bottom: 1.3rem;
}

.essay-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  font-size: 1.3rem;
  margin: 2.25rem 0 1rem;
}

.essay-body h2:first-of-type {
  margin-top: 1.5rem;
}

#concept-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2rem 2.25rem 2.5rem;
  max-width: 560px;
  width: calc(100vw - 3rem);
  max-height: 85vh;
  overflow-y: auto;
}

#concept-modal::backdrop {
  background: rgba(4, 5, 8, 0.75);
  backdrop-filter: blur(3px);
}

.concept-modal-num {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.concept-canvas {
  display: block;
  width: 100%;
  height: 170px;
  margin: 0.5rem 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.02), transparent 70%);
}

#concept-modal-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 4vw, 2rem);
  margin: 0 0 1rem;
}

#concept-modal .project-body {
  max-width: none;
  padding-top: 0;
}

#project-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2rem 2.25rem 2.5rem;
  max-width: 680px;
  width: calc(100vw - 3rem);
  max-height: 85vh;
  overflow-y: auto;
}

#project-modal::backdrop {
  background: rgba(4, 5, 8, 0.75);
  backdrop-filter: blur(3px);
}

#project-modal .modal-head {
  margin-bottom: 0.5rem;
}

#project-modal-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.15;
  margin: 0.5rem 0 0.75rem;
}

#project-modal .project-tagline {
  color: var(--ink-muted);
  font-size: 1rem;
  margin-bottom: 0;
}

#project-modal .project-body {
  max-width: none;
  padding-top: 0;
}

#creds-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2rem 2.25rem;
  max-width: 620px;
  width: calc(100vw - 3rem);
  max-height: 80vh;
  overflow-y: auto;
}

#creds-modal::backdrop {
  background: rgba(4, 5, 8, 0.75);
  backdrop-filter: blur(3px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

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

.cert-list {
  list-style: none;
  padding: 0;
}

.cert-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.cert-list li:last-child {
  border-bottom: none;
}

.cert-list strong {
  display: block;
  font-weight: 500;
  font-size: 0.98rem;
}

.cert-list span {
  display: block;
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.cert-list .cred-id {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  opacity: 0.7;
  margin-top: 0.25rem;
}

.cert-list a {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.45rem 0.9rem;
  white-space: nowrap;
  transition: border-color 0.3s, color 0.3s;
}

.cert-list a:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--ink-faint);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--gold-bright);
}
