/* michellebachtold.com: temporary "A New Chapter" holding page. Same tokens as styles.css. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --cream:      #1c1f24;
  --paper:      #2e323a;
  --ink:        #fbf7ee;
  --ink-soft:   #cfc6b5;
  --ink-mute:   #a29a89;
  --field-edge: #847c69;
  --rule:       #3b4049;
  --rule-soft:  #2f343c;
  --gold:       #f0c674;
  --gold-deep:  #d4a445;
  --gold-soft:  #f7d98c;
  --gold-tint:  rgba(240, 198, 116, 0.18);
  --error:      #ff9a85;
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
  scrollbar-color: #4a4f58 var(--cream);
}

html { background-color: var(--cream); -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background-color: var(--cream);
  background-image:
    radial-gradient(52rem 38rem at 10% 6%, rgba(240, 198, 116, 0.075), transparent 64%),
    radial-gradient(44rem 34rem at 92% 78%, rgba(240, 198, 116, 0.045), transparent 68%);
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  font-size: 21px;
  line-height: 1.7;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(240, 198, 116, 0.32); color: var(--ink); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── layout: the letter beside its reply card ── */
.layout {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  column-gap: clamp(3.5rem, 7vw, 7rem);
  padding: clamp(3.5rem, 9vh, 6.5rem) clamp(1.4rem, 4vw, 3rem) clamp(3rem, 7vh, 5rem);
}

/* ── letterhead ── */
.emblem {
  position: relative;
  width: clamp(96px, 8.6vw, 124px);
  aspect-ratio: 1;
  margin-bottom: 2.1rem;
}
.emblem-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}
.emblem-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1px solid var(--rule);
  pointer-events: none;
}
.emblem-ring--inner { width: 205%; height: 205%; opacity: 0.6; }
.emblem-ring--outer { width: 330%; height: 330%; opacity: 0.32; }

.name {
  font-weight: 500;
  font-size: clamp(2.45rem, 4.5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: balance;
}
.cred {
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  font-size: clamp(0.98rem, 1.8vw, 1.6rem);
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.chapter {
  margin-top: 0.85rem;
  font-weight: 500;
  font-size: clamp(1.55rem, 2.35vw, 2.1rem);
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}
.chapter em,
.connect-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--gold-deep);
}

/* the site's gold rule: a dot with a hairline that draws away from it */
.rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 11rem;
  margin: 2.3rem 0 1.9rem;
}
.rule svg { width: 7px; height: 7px; fill: var(--gold); flex-shrink: 0; }
.rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--gold-soft), transparent);
  transform-origin: left center;
}

.greeting {
  font-style: italic;
  font-size: clamp(1.5rem, 2vw, 1.75rem);
  line-height: 1.35;
  color: var(--gold);
  margin-bottom: 1rem;
}
.body {
  max-width: 36rem;
  font-size: clamp(1.2rem, 1.45vw, 1.34rem);
  line-height: 1.7;
  color: var(--ink);
  text-wrap: pretty;
}
.body + .body { margin-top: 1.1rem; }

/* ── reply card ── */
.connect {
  position: relative;
  background: linear-gradient(180deg, #30343c 0%, #2a2e35 100%);
  border: 1px solid rgba(247, 217, 140, 0.13);
  border-radius: 4px;
  padding: clamp(2rem, 3.2vw, 2.75rem) clamp(1.5rem, 3vw, 2.6rem);
  box-shadow:
    inset 0 1px 0 rgba(251, 247, 238, 0.045),
    0 40px 80px -36px rgba(8, 9, 11, 0.72),
    0 14px 28px -18px rgba(8, 9, 11, 0.55);
}
.rule--card { width: 9rem; margin: 0 0 1.5rem; }

.connect-title {
  font-weight: 500;
  font-size: clamp(1.75rem, 2.3vw, 2.15rem);
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 1rem;
  text-wrap: balance;
}
.connect-ask > p {
  font-size: 1.16rem;
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}
.connect-ask > p + p { margin-top: 0.7rem; }
.connect-ask > .thanks { font-style: italic; color: var(--gold); }

/* ── form ── */
.signup { margin-top: 1.8rem; }
.hp { display: none !important; }

.field label {
  display: block;
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin-bottom: 0.45rem;
}
.field input {
  width: 100%;
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  font-size: 1.08rem;
  line-height: 1.4;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--field-edge);
  border-radius: 2px;
  padding: 0.8rem 0.95rem;
  caret-color: var(--gold);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px var(--gold-tint);
}
.field input[aria-invalid] { border-color: var(--error); }
.field input[aria-invalid]:focus { box-shadow: 0 0 0 3px rgba(255, 154, 133, 0.2); }
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: inset 0 0 0 100px var(--cream);
}
.field input:-webkit-autofill:focus {
  box-shadow: inset 0 0 0 100px var(--cream), 0 0 0 3px var(--gold-tint);
}
.field-error {
  min-height: 1.6rem;
  padding-top: 0.3rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--error);
}

.submit {
  width: 100%;
  margin-top: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  color: var(--cream);
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 2px;
  padding: 1rem 1.6rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.12s var(--ease-out);
}
.submit-arrow {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.22s var(--ease-out), opacity 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .submit:not(:disabled):hover { background-color: var(--gold-deep); border-color: var(--gold-deep); }
  .submit:not(:disabled):hover .submit-arrow { transform: translateX(3px); }
}
.submit:not(:disabled):active { transform: scale(0.98); }
.submit:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }
.submit:disabled { cursor: progress; }
.submit.is-sending { background-color: var(--gold-deep); border-color: var(--gold-deep); }
.submit.is-sending .submit-arrow { opacity: 0.45; }

/* ── signed-up state (?sent=1) ── */
.joined { outline: none; }
.joined-mark {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1.2rem;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.joined-title {
  font-weight: 500;
  font-size: clamp(1.7rem, 2.2vw, 2rem);
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.7rem;
  text-wrap: balance;
}
.joined p { font-size: 1.16rem; line-height: 1.6; color: var(--ink); }

/* ── footer ── */
.foot {
  padding: 0 1.4rem 2.6rem;
  text-align: center;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.foot a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--ink-mute);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .foot a:hover { color: var(--gold); text-decoration-color: var(--gold-soft); }
}
.foot a:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; border-radius: 2px; }

/* ── entrance and scroll reveals ──
   Hidden states exist only under .js-reveals, which the page sets only when motion is allowed.
   Text starts blurred at low opacity rather than at 0, so it still counts for Largest Contentful Paint. */
.js-reveals .reveal {
  transition:
    opacity 1s var(--ease-out),
    filter 1s var(--ease-out),
    transform 1s var(--ease-out);
}
.js-reveals .reveal:not(.is-in) { opacity: 0.08; filter: blur(10px); transform: translateY(14px); }

.js-reveals .name.reveal     { transition-delay: 0.15s; }
.js-reveals .chapter.reveal  { transition-delay: 0.26s; }
.js-reveals .rule.reveal     { transition-delay: 0.36s; }
.js-reveals .greeting.reveal { transition-delay: 0.42s; }
.js-reveals .greeting + .body.reveal { transition-delay: 0.5s; }
.js-reveals .body + .body.reveal     { transition-delay: 0.58s; }

/* the tree grows up from its roots while the rings settle around it */
.js-reveals .emblem.reveal:not(.is-in) { opacity: 1; filter: none; transform: none; }
.js-reveals .emblem-img { transition: clip-path 1.5s var(--ease-out) 0.05s; }
.js-reveals .emblem:not(.is-in) .emblem-img { clip-path: inset(100% 0 0 0); }
.js-reveals .emblem.is-in .emblem-img { clip-path: inset(0 0 0 0); }
.js-reveals .emblem-ring { transition: opacity 1.6s var(--ease-out), scale 1.8s var(--ease-out); }
.js-reveals .emblem-ring--inner { transition-delay: 0.2s; }
.js-reveals .emblem-ring--outer { transition-delay: 0.34s; }
.js-reveals .emblem:not(.is-in) .emblem-ring { opacity: 0; scale: 0.82; }

.js-reveals .rule::after { transition: transform 1.1s var(--ease-out) 0.5s; }
.js-reveals .rule.reveal:not(.is-in)::after { transform: scaleX(0); }

.js-reveals .connect.reveal { transition-duration: 1.1s; }
.js-reveals .connect.reveal:not(.is-in) { opacity: 0; filter: none; transform: translateY(28px); }
.js-reveals .connect:not(.is-in) .rule--card::after { transform: scaleX(0); }
.js-reveals .rule--card::after { transition-delay: 0.35s; }

@media (prefers-reduced-motion: no-preference) {
  .joined:not([hidden]) { animation: joined-in 0.8s var(--ease-out) 0.25s both; }
  .joined-ring  { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.9s var(--ease-out) 0.55s forwards; }
  .joined-check { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.55s var(--ease-out) 1.05s forwards; }
}
@keyframes joined-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.field-error:not(:empty) { animation: error-in 0.18s var(--ease-out); }
@keyframes error-in { from { opacity: 0; transform: translateY(-3px); } }

@media (prefers-reduced-motion: reduce) {
  .field-error:not(:empty) { animation-name: error-fade; }
  .submit-arrow { transition: opacity 0.2s ease; }
  .submit:not(:disabled):hover .submit-arrow { transform: none; }
}
@keyframes error-fade { from { opacity: 0; } }

/* ── wide screens: the card arrives as the letter finishes ── */
@media (min-width: 961px) {
  .js-reveals .connect.reveal { transition-delay: 0.4s; }
  .js-reveals .rule--card::after { transition-delay: 0.75s; }
}

/* ── tablet and phone: one column ── */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 3.5rem;
    min-height: 0;
    max-width: 40rem;
    padding: 3.5rem 1.4rem 3rem;
  }
}
@media (max-width: 600px) {
  body { font-size: 20px; }
  .emblem { width: 88px; margin-bottom: 1.8rem; }
  .rule { margin: 2rem 0 1.6rem; }
  .connect { padding: 1.8rem 1.25rem 1.6rem; }
  .submit { padding-left: 1rem; padding-right: 1rem; }
}

@media print {
  body { background: #fff; color: #000; }
  .name, .chapter, .body, .connect-title, .connect-ask > p, .joined-title, .joined p, .field label { color: #000; }
  .js-reveals .reveal, .js-reveals .reveal:not(.is-in) { opacity: 1 !important; filter: none !important; transform: none !important; }
  .js-reveals .emblem-img { clip-path: none !important; }
  .emblem-ring, .signup, .foot { display: none; }
  .connect { box-shadow: none; background: none; border-color: #999; }
}

.signup-note {
  margin-top: 0.95rem;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink-mute);
}
.signup-note a, .foot-legal a { color: var(--ink-soft); text-decoration: underline; text-decoration-color: var(--ink-mute); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.foot-legal { margin-bottom: 0.5rem; }

.notice h2 {
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 1.8rem 0 0.6rem;
}
.notice-date {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.86rem;
  color: var(--ink-mute);
  margin: 0.4rem 0 1.6rem;
}
.notice .body a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.notice-back { margin-top: 2rem; }
