/* ==========================================================================
   playbookdesign — one-page site
   ========================================================================== */

:root {
  --bg: #05060F;
  --text: #F5F6F8;
  --muted: #9097AB;
  --faint: #5E6479;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --cyan: #5FE3FF;
  --blue: #5B8CFF;
  --violet: #A066FF;
  --pink: #FF9AD8;
  --accent: linear-gradient(90deg, var(--cyan) 0%, var(--blue) 34%, var(--violet) 68%, var(--pink) 100%);

  --font-sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: clamp(16px, 4vw, 40px);
  --orb: clamp(240px, min(80vw, 56svh), 600px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(160, 102, 255, 0.35); color: var(--text); }

h1, h2, h3, p { margin: 0; }
a { color: inherit; }

/* Shared type ------------------------------------------------------------ */

.label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.accent {
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Wordmark: "playbook" in the accent gradient, "design" in white mono */
.wordmark__a {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.055em;
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wordmark__b {
  font-family: var(--font-mono);
  font-weight: 300;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-left: 0.04em;
}

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

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 72px var(--gutter) 120px;
  text-align: center;
  overflow: hidden;
}

.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 55% 50% at 50% 42%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 55% 50% at 50% 42%, #000 0%, transparent 78%);
}

.hero__glow {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 40%;
  width: max(900px, 90vmax);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(closest-side at 46% 48%, rgba(91, 140, 255, 0.16), transparent 55%),
    radial-gradient(closest-side at 56% 54%, rgba(160, 102, 255, 0.14), transparent 60%),
    radial-gradient(closest-side at 50% 50%, rgba(95, 227, 255, 0.05), transparent 75%);
  filter: blur(30px);
  animation: breathe 14s ease-in-out infinite;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.orb {
  width: var(--orb);
  aspect-ratio: 1;
  /* the image carries empty glow below the spheres; tuck the wordmark into it */
  margin-bottom: calc(var(--orb) * -0.17);
}

.orb img {
  display: block;
  width: 100%;
  height: 100%;
  mix-blend-mode: lighten;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 60%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 60%, transparent 100%);
  animation: float 11s ease-in-out infinite;
  will-change: transform;
}

.wordmark {
  position: relative;
  font-size: clamp(2.6rem, 11vw, 7rem);
  line-height: 1.05;
  font-weight: 400;
  white-space: nowrap;
  padding-bottom: 0.08em; /* room for descenders under background-clip:text */
}

/* Slow light sweep across the gradient half of the wordmark */
.hero .wordmark__a {
  background-image:
    linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.55) 50%, transparent 58%),
    var(--accent);
  background-size: 260% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: 100% 0, 0 0;
  animation: sweep-text 9s var(--ease) 1.6s infinite;
}

.tagline {
  margin-top: clamp(14px, 2.2vw, 22px);
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.6vw, 0.9rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  text-wrap: balance;
  padding-left: 0.3em; /* balance trailing letter-spacing so it centres */
}

.cue {
  position: absolute;
  left: 50%;
  bottom: clamp(24px, 5svh, 48px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.3s;
}
.cue span { padding-left: 0.24em; }
.cue:hover, .cue:focus-visible { color: var(--text); }
.cue i {
  position: relative;
  width: 1px;
  height: 44px;
  overflow: hidden;
  background: linear-gradient(var(--line-strong), transparent);
}
.cue i::after {
  content: "";
  position: absolute;
  left: 0;
  top: -40%;
  width: 1px;
  height: 40%;
  background: linear-gradient(transparent, var(--cyan), var(--violet));
  animation: drip 2.8s var(--ease) infinite;
}

/* Contact ---------------------------------------------------------------- */

.contact {
  position: relative;
  padding: clamp(88px, 14vw, 160px) var(--gutter) clamp(88px, 12vw, 140px);
}

/* Thin rule with a slow travelling highlight */
.sweep {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(1100px, 100%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--line-strong) 20%, var(--line-strong) 80%, transparent);
  overflow: hidden;
}
.sweep::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), var(--pink), transparent);
  animation: sweep-line 7s var(--ease) infinite;
}

.contact__inner {
  max-width: 680px;
  margin: 0 auto;
}

.contact__title {
  margin-top: 18px;
  font-size: clamp(2rem, 5.4vw, 3.4rem);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text);
  text-wrap: balance;
}

.lede {
  margin-top: 20px;
  max-width: 54ch;
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}

.panel-wrap {
  position: relative;
  margin-top: clamp(36px, 6vw, 56px);
}

/* Light bleeding from behind the glass */
.panel-glow {
  position: absolute;
  inset: 4% -10% -14%;
  z-index: 0;
  background:
    radial-gradient(closest-side at 18% 38%, rgba(95, 227, 255, 0.34), transparent),
    radial-gradient(closest-side at 64% 58%, rgba(91, 140, 255, 0.36), transparent),
    radial-gradient(closest-side at 86% 86%, rgba(255, 154, 216, 0.30), transparent);
  filter: blur(60px);
  opacity: 0.85;
  animation: breathe 16s ease-in-out infinite;
}

.panel {
  position: relative;
  z-index: 1;
  padding: clamp(22px, 4.5vw, 40px);
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 24, 44, 0.55), rgba(8, 9, 22, 0.7));
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 40px 100px -40px rgba(0, 0, 0, 0.9);
}

/* Pointer-following glow on the panel border */
.panel::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(160, 102, 255, 0.7), rgba(91, 140, 255, 0.25) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.panel:hover::after, .panel:focus-within::after { opacity: 1; }

/* Form ------------------------------------------------------------------- */

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 16px;
}
.field--full { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.opt { color: var(--faint); letter-spacing: 0.12em; }

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* avoids iOS zoom on focus */
  color: var(--text);
  background: rgba(5, 6, 15, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 148px; resize: vertical; line-height: 1.55; }
.field input::placeholder,
.field textarea::placeholder { color: var(--faint); }

.field input:hover,
.field textarea:hover { border-color: var(--line-strong); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(91, 140, 255, 0.7);
  background: rgba(5, 6, 15, 0.85);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.14), 0 0 28px -6px rgba(91, 140, 255, 0.55);
}

.field.is-invalid input,
.field.is-invalid textarea { border-color: rgba(255, 154, 216, 0.75); }

.field__error {
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--pink);
}
.field__error:empty { display: none; }

.form__foot {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
}

.form__note { font-size: 0.85rem; color: var(--faint); }

.form__status { margin-top: 16px; font-size: 0.92rem; }
.form__status:empty { display: none; }
.form__status.is-error { color: var(--pink); }

/* Primary button */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 22px 15px 24px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: 600 0.95rem/1 var(--font-sans);
  letter-spacing: -0.01em;
  color: var(--bg);
  background: linear-gradient(90deg, var(--cyan), var(--blue) 30%, var(--violet) 62%, var(--pink) 100%);
  background-size: 160% 100%;
  background-position: 0% 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 10px 34px -12px rgba(91, 140, 255, 0.8);
  transition: background-position 0.7s var(--ease), box-shadow 0.4s var(--ease), transform 0.2s var(--ease);
}
.btn:hover {
  background-position: 100% 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 14px 46px -10px rgba(160, 102, 255, 0.85);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.btn__icon { transition: transform 0.4s var(--ease); }
.btn:hover .btn__icon { transform: translateX(3px); }

.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"] .btn__icon { animation: nudge 0.9s ease-in-out infinite; }

/* Success state */
.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(16px, 4vw, 32px) 0;
  outline: none;
}
.success[hidden] { display: none; }
.success__orb {
  width: 120px;
  height: 120px;
  mix-blend-mode: lighten;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 55%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 55%, transparent 100%);
  animation: float 9s ease-in-out infinite;
  margin-bottom: 8px;
}
.success__title {
  margin: 12px 0 10px;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--text);
}
.success.is-shown { animation: fade-up 0.8s var(--ease) both; }

/* Footer ----------------------------------------------------------------- */

.footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  border-top: 1px solid var(--line);
}
.footer__brand { font-size: 1.15rem; line-height: 1; }
.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 28px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--faint);
}
.footer__copy { text-transform: uppercase; }
.footer__email {
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}
.footer__email:hover, .footer__email:focus-visible { color: var(--text); }

.form__status a { color: var(--text); text-underline-offset: 3px; }

/* Motion ----------------------------------------------------------------- */

.js .intro { opacity: 0; animation: fade-up 1.2s var(--ease) var(--d, 0ms) forwards; }
.js .cue.intro { animation-name: fade-in; }

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal:nth-child(2) { transition-delay: 80ms; }
.js .reveal:nth-child(3) { transition-delay: 160ms; }
.js .reveal:nth-child(4) { transition-delay: 240ms; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  50%      { transform: translateY(-2.2%) rotate(-2deg) scale(1.015); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.06); }
}
.panel-glow { animation-name: breathe-in-place; }
@keyframes breathe-in-place {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50%      { opacity: 0.95; transform: scale(1.04); }
}

@keyframes sweep-text {
  0%   { background-position: 100% 0, 0 0; }
  45%  { background-position: 0% 0, 0 0; }
  100% { background-position: 0% 0, 0 0; }
}

@keyframes sweep-line {
  0%   { transform: translateX(-100%); opacity: 0; }
  15%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translateX(340%); opacity: 0; }
}

@keyframes drip {
  0%   { top: -40%; }
  100% { top: 110%; }
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .intro, .js .reveal { opacity: 1; transform: none; filter: none; }
}
