/* ============================================================
   SITE — jamesperly.com one-pager layout & sections.
   Depends on design-system.css (tokens) + components.css.
   ============================================================ */

/* ---------------- Base ---------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-text);
  background: var(--paper-200);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; }
a { color: inherit; }

/* Shared containers */
.wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  box-sizing: border-box;
}
.prose {
  max-width: var(--container-prose);
  margin: 0 auto;
}

/* Section shells */
.section { padding: var(--section-pad-y) 0; }
.section--paper { background: var(--paper-200); }
.section--sand  { background: var(--paper-300); }
.section--ink   { background: var(--ink-900); color: var(--paper-100); }
.section--ember { background: var(--ember-500); }

/* Display heading (Problem / Who / Coming Soon section titles) */
.display {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--ink-900);
  margin: 14px 0 0;
  font-size: var(--display-2);
}
.display--1 { font-size: var(--display-1); }

/* Prose text helpers */
.p {
  font-size: var(--text-md);
  line-height: 1.7;
  color: var(--ink-700);
  margin: 0 0 var(--space-5);
}
.p--strong { color: var(--ink-900); font-weight: 600; }
.p em, .em { font-style: italic; font-weight: 300; color: var(--ink-900); }
/* "isn't -> wasn't" correction device in the bio */
.edit-strike { color: var(--ink-400); text-decoration-thickness: 2px; margin-right: 0.08em; }

/* ---------------- Nav ---------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out);
}
.nav--scrolled {
  background: rgba(244, 237, 225, 0.88);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav__brand {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 24px;
  letter-spacing: 0.02em;
  color: var(--ink-900);
  text-decoration: none;
  line-height: 1;
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  background: var(--ink-900);
  color: var(--paper-100);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-8);
  align-items: center;
  min-height: 100vh;
  padding-top: 100px;
  padding-bottom: 60px;
}
.hero__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: 0.01em;
  margin: 18px 0 0;
  font-size: var(--display-hero);
  color: var(--paper-100);
}
.hero__title .dot { color: var(--ember-500); }
.hero__sub {
  font-weight: 200;
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--text-inverse-muted);
  max-width: 540px;
  margin: 24px 0 0;
}
.hero__support {
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.6;
  color: #B7AD9E;
  max-width: 520px;
  margin: 16px 0 0;
}
.hero__cta-row {
  display: flex;
  gap: var(--space-5);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--space-6);
}
.hero__textlink {
  color: var(--paper-100);
  font-weight: 600;
  font-size: var(--text-base);
  text-decoration: none;
  border-bottom: 2px solid var(--ember-500);
  padding-bottom: 2px;
}
/* Text anchors (unlike buttons/checkbox) had only the UA default outline, which
   is faint on the dark hero — give them a clear ember focus ring. */
.hero__textlink:focus-visible,
.nav__brand:focus-visible,
.footer__email a:focus-visible {
  outline: 2px solid var(--ember-400);
  outline-offset: 3px;
  border-radius: 2px;
}
.hero__micro { font-size: var(--text-sm); color: #8C8377; margin: 16px 0 0; }
.hero__media { position: relative; }
.hero__frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 5;
}
.hero__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero__badge {
  position: absolute;
  bottom: -14px;
  left: -14px;
  background: var(--ember-500);
  color: #fff;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 20px;
  letter-spacing: 0.03em;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

/* ---------------- Problem ---------------- */
.problem__body { max-width: var(--container-prose); margin: var(--space-7) auto 0; }
.problem__pullquote { margin: var(--space-7) 0; }
.problem__kicker {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--display-3);
  line-height: 1;
  color: var(--ink-900);
  margin: var(--space-6) 0 0;
}
.problem__kicker .ember { color: var(--ember-500); }

/* ---------------- Who ---------------- */
.who__lead {
  font-style: italic;
  font-weight: 300;
  color: var(--ink-700);
  margin: var(--space-5) 0 var(--space-6);
  font-size: var(--text-lg);
  line-height: 1.7;
}
.proof {
  max-width: var(--container-narrow);
  margin: var(--space-8) auto 0;
  display: grid;
  gap: var(--space-4);
}
.proof__item {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
  background: var(--paper-100);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.proof__icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--ember-100);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ember-600);
}
.proof__icon svg { width: 22px; height: 22px; }
.proof__title { font-weight: 600; font-size: var(--text-md); color: var(--ink-900); }
.proof__body {
  font-size: var(--text-base);
  color: var(--ink-500);
  margin-top: 2px;
  line-height: 1.5;
}

/* ---------------- Testimonial ---------------- */
.tst__quote {
  margin: var(--space-6) 0 0;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.25;
  color: var(--paper-100);
  border-left: 3px solid var(--ember-500);
  padding-left: var(--space-6);
}
.tst__cite {
  margin-top: var(--space-6);
  padding-left: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-inverse-muted);
}
.tst__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid var(--ember-500);
}
.tst__affil {
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-inverse);
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  color: #8C8377;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------------- Workshops ---------------- */
.ws__head { text-align: center; }
.ws__sub {
  font-weight: 200;
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--ink-700);
  margin: var(--space-4) auto 0;
  max-width: 620px;
}
.ws__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-8);
}
.ws-card { display: flex; flex-direction: column; }
.ws-card__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--display-3);
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--ink-900);
  margin: 16px 0 12px;
}
.ws-card__hook {
  font-style: italic;
  font-weight: 300;
  font-size: var(--text-md);
  color: var(--ink-900);
  line-height: 1.35;
  margin: 0 0 16px;
}
.ws-card__list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.ws-card__list li {
  position: relative;
  padding-left: 22px;
  font-size: var(--text-base);
  color: var(--ink-700);
  line-height: 1.45;
}
.ws-card__list li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--ember-500);
  font-weight: 600;
}
.ws-card__who {
  font-size: var(--text-sm);
  color: var(--ink-500);
  margin: 0 0 18px;
  line-height: 1.4;
}

/* ---------------- Coming Soon ---------------- */
.cs__list { display: grid; gap: var(--space-5); margin-top: var(--space-6); }
.cs__item { border-top: 2px solid var(--ink-900); padding-top: var(--space-4); }
.cs__term {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--text-2xl);
  letter-spacing: 0.01em;
  color: var(--ink-900);
  line-height: 1;
}
.cs__desc {
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--ink-700);
  margin: 10px 0 0;
}
.cs__cta { margin-top: var(--space-6); }

/* ---------------- Lead form ---------------- */
.form-wrap { max-width: 620px; margin: 0 auto; }
.form-head { text-align: center; margin-bottom: var(--space-7); }
.form-head__eyebrow {
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  /* solid white (not 0.8 alpha) — white-on-ember is only ~4.5:1, so no transparency */
  color: #fff;
}
.form-head__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--display-1);
  line-height: 0.92;
  color: #fff;
  margin: 12px 0 0;
}
.form-head__sub {
  font-weight: 200;
  font-size: var(--text-lg);
  color: #fff;
  margin: 16px 0 0;
}
.lead-form {
  background: var(--paper-100);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: var(--space-5);
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.fld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; }
.lead-form__submit-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-top: var(--space-2);
}
.lead-form__reassure {
  font-size: var(--text-sm);
  color: var(--ink-500);
  margin: 0;
  text-align: center;
}
.lead-form__error {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--error-500);
  margin: 0;
  text-align: center;
}

/* Success state */
.form-success { text-align: center; }
.form-success__inner { max-width: var(--container-prose); margin: 0 auto; text-align: center; }
.form-success__icon {
  display: inline-flex;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ember-500);
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 24px;
}
.form-success__icon svg { width: 34px; height: 34px; }
.form-success__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--display-2);
  margin: 0;
  color: var(--paper-100);
}
.form-success__text {
  font-weight: 200;
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--text-inverse-muted);
  max-width: 520px;
  margin: 18px auto 0;
}

/* ---------------- Footer ---------------- */
.footer {
  background: var(--ink-900);
  color: var(--paper-100);
  padding: var(--space-7) 0;
}
.footer__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: #8C8377;
  font-size: var(--text-sm);
}
.footer__brand {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 20px;
  color: var(--paper-100);
  letter-spacing: 0.02em;
}
.footer__legal { text-align: right; }

/* ---------------- Sticky CTA (mobile) ---------------- */
.sticky-cta {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: rgba(244, 237, 225, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-soft);
  transform: translateY(120%);
  transition: transform var(--dur) var(--ease-out);
}
.sticky-cta--show { transform: translateY(0); }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; min-height: auto; }
  .ws__grid { grid-template-columns: 1fr; }
  .fld-grid, .topic-grid { grid-template-columns: 1fr; }
  .footer__meta { flex-direction: column; }
  .footer__legal { text-align: left; }
  .sticky-cta { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
