/* Stephen Perry Coaching — mobile-first stylesheet */

@font-face { font-family: "Caudex"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/caudex-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Caudex"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/caudex-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/open-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/open-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/open-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #141414;          /* near-black */
  --bg-alt: #252525;      /* charcoal */
  --heading: #ebebeb;     /* off-white */
  --h1: #d9d9d9;
  --sub: #c4c4c4;
  --text: #a8a8a8;        /* readable grey body */
  --text-strong: #e6e6e6;
  --button: #8a8a8a;
  --button-ink: #141414;
  --submit: #5e5e5e;
  --focus: #ffffff;
  --error: #ff9b8f;
  --gutter: 20px;
  --serif: "Caudex", Georgia, "Times New Roman", serif;
  --sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --header-h: 68px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img { display: block; max-width: 100%; height: auto; }
p { margin: 0; }
h1, h2 { margin: 0; font-family: var(--serif); font-weight: 400; color: var(--heading); }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.nowrap { white-space: nowrap; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--heading); color: var(--bg); padding: 10px 14px; border-radius: 6px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 10px; }

section[id] { scroll-margin-top: var(--header-h); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
}
.header-inner {
  position: relative;
  max-width: calc(1200px + 2 * var(--gutter)); margin: 0 auto;
  height: var(--header-h);
  padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: block; border-radius: 4px; }
.brand img { width: 140px; height: auto; }

.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-right: -10px;
  background: transparent; border: 0; border-radius: 6px; color: var(--heading);
  cursor: pointer;
}
.menu-toggle-bars, .menu-toggle-bars::before {
  display: block; width: 26px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .2s ease;
}
.menu-toggle-bars { position: relative; transform: translateY(-4px); }
.menu-toggle-bars::before { content: ""; position: absolute; left: 0; top: 8px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { transform: translateY(0) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { top: 0; transform: rotate(-90deg); }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; text-decoration: none; color: var(--heading);
  font-size: 1.0625rem; border-radius: 4px; white-space: nowrap;
}
.site-nav a[aria-current="page"] {
  color: #fff; font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px;
}

/* Mobile menu panel (shown only when JS is running and menu is open) */
.js .site-nav {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg);
  border-top: 1px solid #2a2a2a; border-bottom: 1px solid #2a2a2a;
  padding: 8px var(--gutter) 16px;
}
.js .site-nav:not(.is-open) { display: none; }
.js .site-nav a { padding: 12px 0; }
.js .site-nav a[aria-current="page"] { text-underline-offset: 6px; }

/* Without JS: no toggle, show links inline */
html:not(.js) .menu-toggle { display: none; }
html:not(.js) .site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: flex-end; }
html:not(.js) .site-nav a { font-size: .9375rem; }

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  font-family: var(--sans); font-size: 1.0625rem; font-weight: 400; line-height: 1.2;
  text-decoration: none; text-align: center;
  padding: 16px 32px; border: 0; border-radius: 8px; cursor: pointer;
  transition: background-color .15s ease;
}
.button-hero { background: var(--button); color: var(--button-ink); }
.button-hero:hover { background: #9a9a9a; }
.button-submit { background: var(--submit); color: #fff; }
.button-submit:hover { background: #6e6e6e; }
.button-submit[disabled] { opacity: .7; cursor: progress; }

/* ---------- Hero ---------- */
.hero { padding: 36px var(--gutter) 56px; }
.hero-inner { max-width: 1200px; margin: 0 auto; }
.hero-copy { text-align: center; }
.hero h1 {
  color: var(--h1);
  font-size: clamp(2.125rem, 1.45rem + 3vw, 3.25rem);
  line-height: 1.12;
  margin: 0 auto;
  max-width: 11em;
  text-wrap: balance;
}
.hero-sub {
  margin: 18px auto 0; max-width: 22em;
  color: var(--sub);
  font-size: clamp(1.3125rem, 1.1rem + .9vw, 1.75rem);
  line-height: 1.35;
  text-wrap: balance;
}
.hero-text { margin: 32px auto 0; max-width: 32em; }
.button-hero { margin-top: 36px; }
.hero-media { margin-top: 48px; }
.portrait {
  width: 100%;
  aspect-ratio: 7 / 6;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 12px;
}

/* ---------- Shared section bits ---------- */
.label {
  font-family: var(--serif);
  font-size: .875rem; letter-spacing: .18em; line-height: 1.4;
  color: var(--heading);
}
.story h2, .style h2, .contact h2 {
  font-size: clamp(2rem, 1.55rem + 2vw, 2.75rem);
  line-height: 1.25;
}

/* ---------- My Story ---------- */
.story { background: var(--bg); padding: 64px var(--gutter) 80px; }
.reading { max-width: 640px; margin: 0 auto; text-align: left; }
.story h2 { margin-top: 36px; max-width: 13em; }
.story p:not(.label) { margin-top: 32px; }
.story h2 + p { margin-top: 48px; }

/* ---------- Coaching style ---------- */
.style { background: var(--bg-alt); padding: 64px var(--gutter) 72px; }
.style-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.style h2 { max-width: 14em; margin: 0 auto; }
.style-group { margin-top: 32px; color: #d0d0d0; }
.style-group p + p { margin-top: 16px; }
.style-bold { margin-top: 48px; color: var(--text-strong); }
.style-bold strong { font-weight: 700; }
.style-close { margin-top: 16px; color: #d0d0d0; font-weight: 400; }

/* ---------- Contact ---------- */
.contact { background: var(--bg-alt); padding: 32px var(--gutter) 80px; }
.contact-inner { max-width: 640px; margin: 0 auto; text-align: left; }
.contact h2 { margin-top: 36px; }
.contact-intro { margin-top: 28px; }
.direct-email { margin-top: 48px; }
.email-label { font-size: .8125rem; letter-spacing: .08em; color: var(--text); }
.email-link {
  color: var(--text-strong); font-size: 1.125rem; text-decoration: none;
  overflow-wrap: anywhere; word-break: break-word;
  border-radius: 3px;
}
.email-link:hover { text-decoration: underline; }

.contact-form { margin-top: 56px; }
.field { margin-top: 18px; }
.field:first-child { margin-top: 0; }
.field label { display: block; margin-bottom: 8px; color: #f0f0f0; font-weight: 600; font-size: 1rem; }
.field input[type="text"], .field input[type="email"], .field textarea {
  display: block; width: 100%;
  font: inherit; font-size: 1.0625rem; /* ≥16px stops iOS zoom on focus */
  color: #1a1a1a; background: #fff;
  border: 1px solid #8a8a8a; border-radius: 10px;
  padding: 14px 16px;
  -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #6f6f6f; opacity: 1; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.field [aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }

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

.field-consent {
  margin-top: 24px;
  display: grid; grid-template-columns: 22px 1fr; column-gap: 12px; align-items: start;
}
.field-consent input {
  width: 20px; height: 20px; margin: 3px 0 0; accent-color: #5e5e5e; cursor: pointer;
}
.field-consent label { margin: 0; font-weight: 400; color: var(--sub); line-height: 1.6; cursor: pointer; }
.field-consent label a { color: #f0f0f0; font-weight: 700; text-decoration: none; border-radius: 3px; }
.field-consent label a:hover { text-decoration: underline; }
.field-consent .field-error { grid-column: 2; }

.field-error { margin-top: 6px; color: var(--error); font-size: .9375rem; }
.button-submit { margin-top: 28px; }

.form-status {
  margin-top: 20px; padding: 14px 16px; border-radius: 8px;
  background: #1c1c1c; color: var(--text-strong); border-left: 3px solid #9a9a9a;
}
.form-status.is-error { border-left-color: var(--error); }
.form-status a { color: #fff; overflow-wrap: anywhere; }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  :root { --gutter: 40px; --header-h: 84px; }
  .brand img { width: 160px; }

  .hero { padding: 72px var(--gutter) 104px; }
  .hero-inner {
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 64px; align-items: center;
  }
  .hero-copy { text-align: left; }
  .hero h1, .hero-sub, .hero-text { margin-left: 0; margin-right: 0; }
  .hero-media { margin-top: 0; max-width: 480px; justify-self: end; width: 100%; }
  .portrait { aspect-ratio: 5 / 6; object-position: 50% 28%; }

  .story { padding: 112px var(--gutter) 120px; }
  .style { padding: 104px var(--gutter) 112px; }
  .contact { padding: 40px var(--gutter) 112px; }
}

/* Inline header navigation once all six links fit on one line */
@media (min-width: 1120px) {
  .js .menu-toggle { display: none; }
  .js .site-nav, .js .site-nav:not(.is-open) {
    display: block; position: static; padding: 0; border: 0; background: none;
  }
  .site-nav ul, html:not(.js) .site-nav ul { display: flex; flex-wrap: nowrap; gap: 30px; }
  .js .site-nav a, .site-nav a { padding: 6px 0; font-size: 1rem; }
  .site-nav a:hover { text-decoration: underline; text-underline-offset: 7px; }
}

/* ---------- Standalone content pages ---------- */
body.page-sub { background: var(--bg-alt); }
.page { background: var(--bg-alt); padding: 48px var(--gutter) 88px; }
.page h1 {
  font-size: clamp(2.125rem, 1.6rem + 2.2vw, 3rem);
  line-height: 1.2;
  text-wrap: balance;
}
.page-body { margin-top: 36px; color: #b4b4b4; }
.page-body p + p { margin-top: 1.05em; }
.page-body .topic { color: #c8c8c8; }
.page-body .topic strong { color: var(--text-strong); font-weight: 700; }
.page-body .topic + .topic { margin-top: 1.4em; }
.page-body .closing { margin-top: 1.6em; color: var(--text-strong); }
.closing-link {
  color: #fff; font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  border-radius: 3px;
}
.closing-link:hover { text-decoration-thickness: 2px; }

/* Contact page */
.contact-page { padding-top: 48px; }
.contact h1 {
  margin-top: 36px;
  font-size: clamp(2.125rem, 1.6rem + 2.2vw, 3rem);
  line-height: 1.2;
}

@media (min-width: 900px) {
  .page { padding: 88px var(--gutter) 120px; }
  .contact-page { padding-top: 88px; }
}
