/* ==========================================================================
   The 5-Day Mental Reset — Arcane Vault
   ========================================================================== */

:root {
  /* Colour */
  --night: #141516;          /* hero base, buttons */
  --night-deep: #0d0e0f;
  --ivory: #f5f1ea;          /* page background */
  --ivory-card: #faf8f4;     /* sign-up card */
  --sand: #ebe4d8;           /* icon discs */
  --line: #ddd5c8;           /* dividers, input borders */
  --ink: #16171a;            /* headings on ivory */
  --ink-body: #2c2b29;       /* body text on ivory */
  --muted: #5d5850;          /* secondary text */
  --hero-title: #f4eee4;
  --hero-lead: #eadfcd;
  --hero-body: #d9d2c7;
  --error: #a3352b;
  --success: #3f6b4e;

  /* Type */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Figtree", "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --radius-card: 18px;
  --radius-control: 8px;
  --radius-button: 12px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink-body);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, p, ul { margin: 0; }
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }
ul { padding: 0; list-style: none; }
svg { display: block; }
button, input { font: inherit; color: inherit; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px));
}

.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: 1rem; top: -4rem;
  z-index: 10;
  padding: .75rem 1rem;
  background: var(--ivory);
  color: var(--ink);
  border-radius: var(--radius-control);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 2px solid #b08e68;
  outline-offset: 3px;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--night);
  color: var(--hero-title);
  min-height: clamp(540px, 72vh, 640px);
  padding-top: env(safe-area-inset-top, 0px);
}

.hero__scene {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero__art,
.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% center;
}
/* Readability wash: dark on the text side, clear on the scene side */
.hero__scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(13, 14, 15, .94) 0%,
      rgba(13, 14, 15, .82) 32%,
      rgba(13, 14, 15, .35) 55%,
      rgba(13, 14, 15, 0) 72%),
    linear-gradient(180deg, rgba(13, 14, 15, .35) 0%, rgba(13, 14, 15, 0) 25%);
}
/* Subtle film grain */
.hero__scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: .07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero__inner {
  position: relative;
  padding-top: clamp(1.75rem, 3.5vw, 2.5rem);
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 2rem;
}
.brand {
  font-family: var(--sans);
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--hero-title);
}
.topbar__meta {
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--hero-body);
}

.hero__content {
  max-width: 34rem;
  margin-top: clamp(2.5rem, 6vw, 4.25rem);
}
.hero__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 7.2vw, 5.4rem);
  line-height: .98;
  letter-spacing: -.022em;
  font-optical-sizing: auto;
  color: var(--hero-title);
  text-shadow: 0 2px 30px rgba(0, 0, 0, .35);
}
.hero__lead {
  margin-top: clamp(1.25rem, 2.4vw, 1.75rem);
  max-width: 29rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1.22;
  letter-spacing: -.005em;
  color: var(--hero-lead);
}
.hero__body {
  margin-top: 1.4rem;
  max-width: 32rem;
  font-size: clamp(1rem, 1.35vw, 1.17rem);
  line-height: 1.55;
  color: var(--hero-body);
}

/* ==========================================================================
   What you'll learn
   ========================================================================== */
.learn {
  padding-top: clamp(2.75rem, 5vw, 3.25rem);
  padding-bottom: clamp(2rem, 4vw, 2.75rem);
  background: var(--ivory);
}
.learn__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 2.6vw, 2.05rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  text-align: center;
  color: var(--ink);
}
.learn__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: clamp(1.75rem, 3vw, 2.25rem);
}
.learn__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  text-align: center;
}
.learn__item + .learn__item {
  border-left: 1px solid var(--line);
}
.learn__item p {
  max-width: 11.5rem;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink-body);
}
.learn__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--sand);
}
.learn__icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   Sign-up
   ========================================================================== */
.signup {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: clamp(1rem, 3vw, 1.75rem);
  padding-bottom: clamp(3.5rem, 7vw, 5rem);
  background: linear-gradient(180deg, var(--ivory) 0%, #f1ece3 55%, #ece6db 100%);
}
.signup__mist {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 70%;
  z-index: -1;
  pointer-events: none;
}
.signup__mist svg { width: 100%; height: 100%; }

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

.signup__card {
  width: 100%;
  max-width: 666px;
  padding: clamp(2rem, 4.5vw, 2.6rem) clamp(1.25rem, 5vw, 3.5rem) clamp(1.75rem, 3.5vw, 2rem);
  background: rgba(250, 248, 244, .94);
  border: 1px solid rgba(221, 213, 200, .7);
  border-radius: var(--radius-card);
  box-shadow:
    0 1px 2px rgba(60, 48, 33, .05),
    0 18px 50px -18px rgba(60, 48, 33, .22);
}
@supports (backdrop-filter: blur(8px)) {
  .signup__card {
    background: rgba(250, 248, 244, .86);
    backdrop-filter: blur(8px);
  }
}

.signup__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -.015em;
  text-align: center;
  color: var(--ink);
}

.signup__form {
  margin-top: clamp(1.4rem, 3vw, 1.75rem);
}

/* Fields */
.field {
  position: relative;
}
.field + .field__error + .field,
.field__error + .field {
  margin-top: .8rem;
}
.field__icon {
  position: absolute;
  left: 1.05rem;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  fill: none;
  stroke: #6a655d;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.field__input {
  display: block;
  width: 100%;
  height: 56px;
  padding: 0 1rem 0 3.4rem;
  background: #fcfbf8;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-size: 1.05rem;      /* ≥16px prevents iOS zoom */
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field__input::placeholder { color: #8a847b; opacity: 1; }
.field__input:hover { border-color: #c9c0b1; }
.field__input:focus {
  outline: none;
  border-color: #8f7a5f;
  box-shadow: 0 0 0 3px rgba(176, 142, 104, .2);
}
.field__input[aria-invalid="true"] {
  border-color: var(--error);
}
.field__input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(163, 53, 43, .15);
}
.field__error {
  margin-top: .4rem;
  font-size: .875rem;
  color: var(--error);
}

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

.signup__hint {
  margin-top: .9rem;
  font-size: .875rem;
  line-height: 1.45;
  color: var(--ink-body);
}

/* Button */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  min-height: 64px;
  margin-top: 1.25rem;
  padding: .9rem 1.5rem;
  background: var(--night);
  color: #f7f3ec;
  border: 0;
  border-radius: var(--radius-button);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.button:hover { background: #26282a; }
.button:active { transform: translateY(1px); }
.button:focus-visible { outline-offset: 4px; }
.button__arrow {
  font-size: 1.2em;
  line-height: 1;
  transition: transform .2s ease;
}
.button:hover .button__arrow { transform: translateX(3px); }
.button[aria-busy="true"] {
  cursor: progress;
  background: #3a3c3f;
}
.button[aria-busy="true"] .button__arrow { visibility: hidden; }

.signup__status {
  margin-top: .75rem;
  font-size: .9rem;
  text-align: center;
  color: var(--error);
}
.signup__status:empty { display: none; }

.signup__note {
  margin-top: 1.1rem;
  font-size: .95rem;
  line-height: 1.5;
  text-align: center;
  color: var(--ink-body);
}

/* Success state */
.signup__success {
  margin-top: 1.5rem;
  text-align: center;
  outline: none;
}
.signup__success-icon {
  display: inline-grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--sand);
}
.signup__success-icon svg {
  width: 26px; height: 26px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.signup__success-title {
  margin-top: 1rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--ink);
}
.signup__success-text {
  max-width: 30rem;
  margin: .6rem auto 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-body);
}
.signup__success-text strong {
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

/* Closing lines */
.closing {
  max-width: 40rem;
  margin-top: clamp(3.5rem, 7vw, 4.5rem);
  text-align: center;
}
.closing__lead {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
  line-height: 1.3;
  letter-spacing: -.005em;
  color: var(--ink);
}
.closing__text {
  max-width: 28rem;
  margin: .35rem auto 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
  line-height: 1.3;
  color: var(--muted);
}

/* Footer */
.footer {
  padding: 1.25rem var(--gutter) calc(1.25rem + env(safe-area-inset-bottom, 0px));
  background: #e6e0d4;
  text-align: center;
  font-size: .8rem;
  letter-spacing: .04em;
  color: #6d675e;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet & below: benefits become a readable list */
@media (max-width: 960px) {
  .learn__list {
    grid-template-columns: 1fr;
    max-width: 34rem;
    margin-inline: auto;
  }
  .learn__item {
    flex-direction: row;
    gap: 1.25rem;
    padding: 1rem 0;
    text-align: left;
  }
  .learn__item + .learn__item {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .learn__item p { max-width: none; }
  .learn__icon { width: 56px; height: 56px; }
  .learn__icon svg { width: 26px; height: 26px; }
}

/* Hero on narrower screens: scene sits behind, wash from bottom */
@media (max-width: 820px) {
  /* Text on the dark sky, landscape revealed underneath */
  .hero {
    min-height: 0;
    background: #101113;
  }
  .hero__inner { padding-bottom: clamp(15rem, 62vw, 22rem); }
  .hero__art,
  .hero__photo {
    top: auto;
    height: clamp(26rem, 112vw, 38rem);
    object-position: 80% center;
  }
  .hero__scene::after {
    background: linear-gradient(180deg,
      rgba(16, 17, 19, 1) 0%,
      rgba(16, 17, 19, .92) 38%,
      rgba(16, 17, 19, .55) 55%,
      rgba(16, 17, 19, 0) 72%,
      rgba(16, 17, 19, 0) 88%,
      rgba(16, 17, 19, .35) 100%);
  }
  .hero__content { max-width: 36rem; }
}

@media (max-width: 560px) {
  .topbar { flex-direction: column; gap: .35rem; }
  .brand { font-size: .85rem; }
  .topbar__meta { font-size: .72rem; }
  .hero__title { font-size: clamp(2.6rem, 12.5vw, 3.4rem); }
  .button {
    font-size: .98rem;
    letter-spacing: .06em;
    min-height: 60px;
  }
  .signup__card { border-radius: 14px; }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* ==========================================================================
   Thank-you page (thank-you.html)
   ========================================================================== */
.thanks__main {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: calc(3rem + env(safe-area-inset-top, 0px));
}
.thanks__brand {
  margin-bottom: 2rem;
  color: var(--ink);
}
.thanks .signup__success { margin-top: 0; }
