/* The look of Gary's website.
   Colours are set once at the top as "tokens" (named values), with a
   second set for dark mode, so changing a colour here changes it everywhere. */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.75);
  --rim: rgba(255, 255, 255, 0.95);
  --shadow: 0 12px 34px rgba(40, 30, 110, 0.1);
  --focus: #8b5cff;
  --grad: linear-gradient(100deg, #2aa8ff, #8b5cff 50%, #ff4d9a);
  --light-1: rgba(120, 210, 255, 0.55);
  --light-2: rgba(190, 140, 255, 0.45);
  --light-3: rgba(255, 150, 195, 0.4);
  --radius: 24px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b12;
    --surface: #15151f;
    --text: #f5f5f7;
    --muted: #a1a1ae;
    --line: rgba(255, 255, 255, 0.1);
    --glass: rgba(34, 32, 56, 0.55);
    --glass-strong: rgba(40, 38, 66, 0.78);
    --rim: rgba(255, 255, 255, 0.16);
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
    --focus: #b49bff;
    --light-1: rgba(60, 170, 255, 0.35);
    --light-2: rgba(150, 90, 255, 0.35);
    --light-3: rgba(255, 70, 170, 0.28);
  }
}

/* ---------- Basics ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px; /* so headings aren't hidden under the menu bar */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.container {
  width: min(1080px, 100% - 32px);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--surface);
  z-index: 100;
}

.skip:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Soft drifting colour light behind everything ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient span {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(40px);
  animation: drift 26s ease-in-out infinite alternate;
}

.ambient span:nth-child(1) {
  background: radial-gradient(circle, var(--light-1), transparent 65%);
  left: -15vmax;
  top: -20vmax;
}

.ambient span:nth-child(2) {
  background: radial-gradient(circle, var(--light-2), transparent 65%);
  right: -20vmax;
  top: 10vmax;
  animation-duration: 32s;
}

.ambient span:nth-child(3) {
  background: radial-gradient(circle, var(--light-3), transparent 65%);
  left: 20vmax;
  bottom: -30vmax;
  animation-duration: 38s;
}

@keyframes drift {
  to {
    transform: translate(6vmax, 4vmax) scale(1.1);
  }
}

/* ---------- Glass ---------- */

.glass {
  background: var(--glass);
  border: 1px solid var(--rim);
  box-shadow: var(--shadow), inset 0 1px 0 var(--rim);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
}

/* ---------- Menu bar ---------- */

.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 16px 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 8px 8px 8px 10px;
  border-radius: 999px;
}

.monogram {
  display: block;
  width: 38px;
  height: 38px;
  flex: none;
}

.monogram svg {
  display: block;
  width: 100%;
  height: 100%;
}

.monogram text {
  font: 800 15px var(--font);
  fill: #ffffff;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 2px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--glass-strong);
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #ffffff;
  background: var(--grad);
  box-shadow: 0 8px 22px rgba(139, 92, 255, 0.35);
}

.button.small {
  min-height: 38px;
  padding: 0 18px;
  font-size: 15px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 48px;
  min-height: min(760px, 88vh);
  padding-block: 48px 72px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(56px, 10vw, 112px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.tagline {
  margin: 16px 0 0;
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro {
  margin: 20px 0 32px;
  font-size: 19px;
  color: var(--muted);
}

.hero-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 40px;
  transform-style: preserve-3d;
  transition: transform 0.2s ease-out;
  will-change: transform;
}

.hero-card canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Caption and buttons on the Enzo card, lifted slightly towards the viewer in 3D */
.enzo-caption {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  transform: translateZ(30px);
}

.enzo-caption strong {
  color: var(--text);
}

.enzo-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px;
  transform: translateZ(30px);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--rim);
  background: var(--glass-strong);
  color: var(--text);
  font: 600 15px var(--font);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(40, 30, 110, 0.12);
  transition: transform 0.15s ease;
}

.pill:hover {
  transform: translateY(-1px);
}

.pill svg {
  width: 16px;
  height: 16px;
  fill: #f5a524;
}

.pill[aria-pressed="true"] svg {
  fill: #5ff0ff;
}

.pill.primary {
  border-color: transparent;
  background: var(--grad);
  color: #ffffff;
}

/* ---------- Sections ---------- */

.section {
  padding-block: 72px;
}

.section-head {
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(36px, 5.5vw, 60px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.lede {
  margin: 10px 0 0;
  font-size: 19px;
  color: var(--muted);
}

.panel {
  padding: 32px;
  border-radius: var(--radius);
}

/* Placeholders are dashed so they're obviously still to be written */
.placeholder {
  display: inline-block;
  padding: 4px 12px;
  border: 1.5px dashed var(--muted);
  border-radius: 10px;
  color: var(--muted);
}

.placeholder-button {
  outline: 2px dashed rgba(255, 255, 255, 0.8);
  outline-offset: -6px;
}

/* ---------- Games ---------- */

.game-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 20px;
  border-radius: 32px;
}

.game-preview {
  display: block;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(40, 30, 110, 0.2);
  transition: transform 0.2s ease;
}

.game-preview:hover {
  transform: scale(1.01);
}

.game-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.game-info h3 {
  margin: 0 0 8px;
  font-size: 34px;
  letter-spacing: -0.03em;
}

.game-info p {
  margin: 0 0 16px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--rim);
  font-size: 14px;
  font-weight: 600;
}

.small-print {
  margin: 14px 0 0 !important;
  font-size: 14px;
  color: var(--muted);
}

.coming {
  margin-top: 16px;
  padding: 18px 24px;
  border-radius: 20px;
  text-align: center;
  color: var(--muted);
  border-style: dashed;
}

.coming p {
  margin: 0;
}

/* ---------- Reading list ---------- */

.books {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.books details {
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--rim);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  transition: transform 0.2s ease;
}

.books details:hover {
  transform: translateY(-2px);
}

.books summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
}

.books summary::-webkit-details-marker {
  display: none;
}

.num {
  flex: none;
  width: 38px;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The gradient shows behind the cover while it loads, or if it ever can't load */
.cover {
  flex: none;
  width: 44px;
  height: 66px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--grad);
  box-shadow: 0 4px 12px rgba(30, 20, 80, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.book {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: auto;
}

.title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.author {
  font-size: 15px;
  color: var(--muted);
}

.tag,
.badge {
  flex: none;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge {
  border: 1.5px solid currentColor;
  color: #8b5cff;
}

.tag-negotiation { background: rgba(255, 77, 154, 0.16); color: #c01c66; }
.tag-leadership { background: rgba(255, 149, 0, 0.18); color: #a85800; }
.tag-innovation { background: rgba(42, 168, 255, 0.18); color: #0a6db5; }
.tag-goals { background: rgba(139, 92, 255, 0.18); color: #5b2fd6; }
.tag-business { background: rgba(62, 123, 250, 0.16); color: #2450b8; }
.tag-strategy { background: rgba(18, 165, 148, 0.18); color: #0b7568; }
.tag-founders { background: rgba(245, 165, 36, 0.2); color: #8f5600; }
.tag-life { background: rgba(48, 164, 108, 0.18); color: #17703f; }

@media (prefers-color-scheme: dark) {
  .tag-negotiation { color: #ff8cc0; }
  .tag-leadership { color: #ffb44d; }
  .tag-innovation { color: #7cc8ff; }
  .tag-goals { color: #c4abff; }
  .tag-business { color: #93b4ff; }
  .tag-strategy { color: #5fe0cf; }
  .tag-founders { color: #ffcc66; }
  .tag-life { color: #7fe0a8; }
  .badge { color: #c4abff; }
}

.chevron {
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

details[open] .chevron {
  transform: rotate(-135deg);
}

.takeaway {
  padding: 0 20px 18px 134px; /* lines up with the book title */
}

.credit {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Amazon Associates disclosure, shown before the book links */
.disclosure {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.takeaway p {
  margin: 0 0 10px;
  font-size: 17px;
}

.takeaway a {
  font-size: 15px;
  font-weight: 600;
  color: var(--focus);
  text-decoration: none;
}

.takeaway a:hover {
  text-decoration: underline;
}

/* ---------- Contact and footer ---------- */

.contact p {
  margin: 0 0 16px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 32px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.footer p {
  margin: 0;
}

.footer a {
  text-decoration: none;
}

/* ---------- Fade-in as sections scroll into view ----------
   Only switched on when the script runs and motion is allowed, so the
   page is always readable even if something goes wrong. */

.motion .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.motion .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ambient span {
    animation: none;
  }

  .button,
  .pill,
  .books details,
  .game-preview,
  .hero-card {
    transition: none;
  }
}

/* ---------- Phones and tablets ---------- */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    min-height: 0;
    padding-block: 32px 48px;
  }

  .hero-card {
    width: min(420px, 100%);
    margin-inline: auto;
  }

  .game-card {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .wide-only {
    display: none;
  }

  .nav-links a {
    padding: 8px 10px;
  }

  .section {
    padding-block: 48px;
  }

  .panel {
    padding: 22px;
  }

  .books summary {
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 14px 16px;
  }

  .num {
    width: 30px;
    font-size: 19px;
  }

  .book {
    flex: 1 1 calc(100% - 110px);
    padding-right: 22px; /* room for the open/close arrow */
  }

  .cover {
    width: 36px;
    height: 54px;
  }

  .tag,
  .badge {
    margin-left: 90px; /* under the title, past the number and cover */
  }

  .badge {
    margin-left: 0;
  }

  .chevron {
    position: absolute;
    right: 20px;
    margin-top: 6px;
  }

  .books details {
    position: relative;
  }

  .takeaway {
    padding: 0 16px 16px 16px;
  }

  .footer {
    flex-direction: column;
  }
}
