/* The Failure School: site styles.
   One stylesheet for every page. Brand: Satoshi, ink on soft grey, white panels, one blue for actions. */

@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('../fonts/Satoshi-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;      /* 4.9:1 on white, 4.6:1 on --bg */
  --bg: #f5f5f7;
  --panel: #ffffff;
  --line: rgba(29, 29, 31, .12);
  --blue: #0071e3;       /* white text on it: 4.7:1 */
  --blue-dark: #0058b0;
  --blue-tint: #e8f1fd;
  --radius: 20px;
  --radius-sm: 14px;
  --wrap: 1120px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Satoshi', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
h1 { font-size: clamp(36px, 7.4vw, 72px); letter-spacing: -.035em; }
h2 { font-size: clamp(28px, 4.6vw, 44px); }
h3 { font-size: 21px; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 24px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 245, 247, .9);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { color: var(--ink); font-weight: 700; font-size: 19px; letter-spacing: -.02em; text-decoration: none; margin-right: auto; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.nav-desktop { display: none; gap: 28px; align-items: center; }
.nav-desktop a, .menu nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 16px; }
.nav-desktop a:hover, .menu nav a:hover { color: var(--ink); }
.nav-desktop a[aria-current="page"], .menu nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }

.menu { position: relative; }
.menu summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  font-weight: 700; font-size: 15px; color: var(--ink); background: rgba(29, 29, 31, .06);
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--ink); color: #fff; }
.menu nav {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: min(280px, calc(100vw - 32px));
  background: var(--panel); border-radius: var(--radius-sm);
  box-shadow: 0 12px 40px rgba(29, 29, 31, .14);
  padding: 8px; display: grid;
}
.menu nav a { padding: 12px 14px; border-radius: 10px; font-size: 17px; }
.menu nav a:hover { background: var(--bg); }
.site-header .header-cta { white-space: nowrap; }
@media (max-width: 420px) {
  .site-header .wrap { gap: 10px; }
  .site-header .btn-small { padding: 0 14px; }
  .menu summary { padding: 0 12px; }
}
@media (max-width: 359px) { .site-header .header-cta { display: none; } }

@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .menu { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  background: var(--blue); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 17px; line-height: 1.2; text-align: center;
  border: 2px solid var(--blue); transition: background-color .2s ease, border-color .2s ease;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-small { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn-quiet { background: transparent; color: var(--ink); border-color: rgba(29, 29, 31, .2); }
.btn-quiet:hover { background: rgba(29, 29, 31, .05); color: var(--ink); border-color: rgba(29, 29, 31, .35); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.note { color: var(--muted); font-size: 15px; }

/* ---------- Sections ---------- */
main { padding-bottom: 16px; }
.hero { padding-top: 56px; padding-bottom: 40px; }
.hero h1 { max-width: 15ch; }
.hero .lede { font-size: clamp(19px, 2.3vw, 23px); line-height: 1.45; color: var(--ink-2); max-width: 40ch; margin: 22px 0 30px; }
.hero .note { margin-top: 14px; }
@media (min-width: 768px) { .hero { padding-top: 96px; padding-bottom: 56px; } }

.panel { background: var(--panel); border-radius: var(--radius); padding: 36px 22px; margin: 0 0 16px; }
@media (min-width: 768px) { .panel { padding: 64px 56px; } }
.panel-ink { background: var(--ink); color: #fff; }
.panel-ink h2, .panel-ink h3 { color: #fff; }
.panel-ink p { color: rgba(255, 255, 255, .78); }
.panel-tint { background: var(--blue-tint); }

.section-head { max-width: 680px; margin-bottom: 32px; }
.section-head p { color: var(--ink-2); font-size: 19px; line-height: 1.5; margin-top: 14px; }
.panel-ink .section-head p { color: rgba(255, 255, 255, .8); }
.section-head p.badge, .panel-ink .section-head p.badge { color: #fff; font-size: 15px; line-height: 1.2; margin-top: 0; }
.panel-ink .badge { background: #fff; color: var(--ink); }
.panel-ink .section-head p.badge { color: var(--ink); }
.panel-ink .badge span { background: var(--ink); color: #fff; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.center .actions { justify-content: center; }

.grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card { background: var(--bg); border-radius: var(--radius-sm); padding: 24px; display: flex; flex-direction: column; }
.panel-tint .card, .panel-ink .card { background: var(--panel); }
.panel-ink .card h3 { color: var(--ink); }
.panel-ink .card p { color: var(--ink-2); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-2); font-size: 16px; }
.card .more { margin-top: auto; padding-top: 16px; font-weight: 700; text-decoration: none; }
.card .num { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; margin-bottom: 16px; }
.card .label { color: var(--muted); font-size: 14px; font-weight: 700; margin-bottom: 6px; }

/* Photos from past sessions */
.photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; }
@media (min-width: 768px) { .photos { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.photos img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-sm); background: #e4e4e8; }
.photos figcaption { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }

/* A note from Phil */
.founder { display: grid; gap: 26px; align-items: center; }
@media (min-width: 800px) { .founder { grid-template-columns: 300px 1fr; gap: 56px; } }
.founder img { width: 100%; max-width: 200px; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); background: #e4e4e8; }
@media (min-width: 800px) { .founder img { max-width: 300px; } }
.founder h2 { margin-bottom: 18px; }
.founder .words p { font-size: 19px; line-height: 1.6; color: var(--ink-2); max-width: 60ch; }
.founder .sig { margin-top: 22px; line-height: 1.4; }
.founder .sig strong { display: block; color: var(--ink); font-size: 18px; }
.founder .sig span { color: var(--muted); font-size: 15px; }
.founder-small { gap: 18px; align-items: start; }
@media (min-width: 800px) { .founder-small { grid-template-columns: 140px 1fr; gap: 32px; } }
.founder-small img { max-width: 104px; border-radius: 50%; }
@media (min-width: 800px) { .founder-small img { max-width: 140px; } }

/* "Sound familiar?" quotes */
.feelings { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 12px; }
@media (min-width: 700px) { .feelings { grid-template-columns: repeat(2, 1fr); } }
.feelings li { background: var(--bg); border-radius: var(--radius-sm); padding: 20px 22px; font-size: 19px; line-height: 1.45; font-weight: 500; color: var(--ink); }
.kicker { font-size: clamp(20px, 2.4vw, 24px); line-height: 1.4; font-weight: 500; max-width: 34ch; }

/* Testimonials */
.quote { margin: 0; background: var(--bg); border-radius: var(--radius-sm); padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.quote blockquote { margin: 0; font-size: 18px; line-height: 1.55; color: var(--ink); }
.quote figcaption { color: var(--muted); font-size: 15px; margin-top: auto; }
.quote figcaption strong { color: var(--ink); }

/* The four weeks, detailed */
.week { border-top: 1px solid var(--line); padding: 36px 0; display: grid; gap: 20px; }
.week:first-of-type { border-top: 0; padding-top: 0; }
@media (min-width: 900px) { .week { grid-template-columns: 260px 1fr; gap: 40px; } }
.week-title .label { color: var(--blue); font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.week-title p { color: var(--ink-2); margin-top: 10px; }
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps-list li { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 16px; color: var(--ink-2); }
.steps-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.steps-list strong { color: var(--ink); }
@media (max-width: 420px) { .steps-list li { grid-template-columns: 1fr; gap: 2px; } }
.card .leave { margin-top: auto; }
.leave { margin-top: 16px; background: var(--blue-tint); border-radius: 12px; padding: 14px 16px; font-size: 16px; }

/* Numbered path */
.path { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 14px; }
.path li { counter-increment: step; position: relative; background: var(--bg); border-radius: var(--radius-sm); padding: 20px 22px 20px 70px; color: var(--ink-2); font-size: 16px; }
.path li::before { content: counter(step); position: absolute; left: 20px; top: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.path strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 4px; }

/* Key facts */
.facts { display: grid; gap: 0; margin: 0 0 28px; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 700; color: var(--ink); }
.facts dd { margin: 0; color: var(--ink-2); }
@media (max-width: 420px) { .facts div { grid-template-columns: 1fr; gap: 2px; } }

/* FAQ */
.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative;
  font-weight: 700; font-size: 19px; line-height: 1.35; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 16px; font-size: 26px; font-weight: 500; color: var(--muted); }
.faq details[open] summary::after { content: '\2212'; }
.faq details > div { padding: 0 0 22px; color: var(--ink-2); max-width: 64ch; }

/* Badge */
.badge { display: inline-flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; border-radius: 999px; padding: 8px 16px 8px 8px; font-weight: 700; font-size: 15px; }
.badge span { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }

/* ---------- Application form ---------- */
.form-panel { max-width: 680px; margin-left: auto; margin-right: auto; }
.apply-form { display: grid; gap: 34px; }
.q { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.q > label, .q legend { font-weight: 700; font-size: 20px; line-height: 1.3; letter-spacing: -.01em; color: var(--ink); padding: 0; }
.q .optional { font-weight: 500; color: var(--muted); font-size: 16px; }
.q .hint { color: var(--muted); font-size: 15px; margin: -2px 0 4px; }
.field {
  width: 100%; min-height: 54px; padding: 12px 16px;
  font: inherit; font-size: 18px; color: var(--ink);
  background: var(--bg); border: 2px solid transparent; border-radius: 14px;
  transition: border-color .15s ease, background-color .15s ease;
}
.field::placeholder { color: #8a8a90; }
.field:hover { background: #eeeef1; }
.field:focus { outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 113, 227, .15); }
textarea.field { min-height: 132px; resize: vertical; line-height: 1.5; }
.field[aria-invalid="true"] { border-color: #c4271a; background: #fff; }
.field-error { color: #c4271a; font-size: 15px; font-weight: 500; margin: 0; }
.field-error:empty { display: none; }

.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill span {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 18px; border-radius: 999px;
  background: var(--bg); border: 2px solid transparent; font-weight: 500; font-size: 16px; color: var(--ink-2);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.pill:hover span { background: #eeeef1; }
.pill input:checked + span { background: var(--blue-tint); border-color: var(--blue); color: var(--ink); font-weight: 700; }
.pill input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 17px; color: var(--ink-2); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--blue); flex: none; cursor: pointer; }

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

.submit-row { display: grid; gap: 14px; }
.submit-row .btn { width: 100%; min-height: 58px; font-size: 18px; }
.submit-row .btn[disabled] { opacity: .65; cursor: progress; }
.form-error { background: #fdecea; color: #8a1c12; border-radius: 12px; padding: 14px 16px; font-size: 16px; margin: 0; }
.form-error:empty { display: none; }
.form-error a { color: #8a1c12; font-weight: 700; }

.done { text-align: center; padding: 8px 0; }
.done .tick { width: 72px; height: 72px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; margin-bottom: 22px; }
.done h2 { margin-bottom: 14px; }
.done h2:focus { outline: none; }
.done p { color: var(--ink-2); font-size: 19px; max-width: 34ch; margin-left: auto; margin-right: auto; }
.done .actions { justify-content: center; margin-top: 26px; }
@media (prefers-reduced-motion: no-preference) { .done { animation: rise .4s ease-out; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.site-footer { padding: 48px 0 40px; color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: grid; gap: 28px; }
@media (min-width: 768px) { .site-footer .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer .brand { font-size: 18px; }
.site-footer p { margin-top: 6px; }
.site-footer h2 { font-size: 14px; letter-spacing: 0; color: var(--ink); margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
