/* ==========================================================================
   Ruchie Landau Photography — SMS Messaging site
   Single stylesheet. No build step, no frameworks, no third-party requests.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Warm, photographic neutrals. */
  --paper: #fbf9f6;
  --paper-raised: #ffffff;
  --paper-tint: #f4f0ea;

  /* All three clear WCAG AA (4.5:1) against both --paper and --paper-tint. */
  --ink: #221f1c;
  --ink-muted: #57514a;
  --ink-faint: #6b655c;
  --ink-placeholder: #736c63;

  --line: #e4ddd3;
  --line-strong: #cfc5b8;

  --accent: #8a7355;
  --accent-deep: #6b5942;

  --error: #93341f;
  --error-tint: #fdf3f0;

  --focus: #3f3a34;

  /* Type */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;

  /* Rhythm */
  --measure: 66ch;
  --shell: 68rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-gap: clamp(3.25rem, 7.5vw, 5.5rem);
  --radius: 4px;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  /* Guards against any single wide element forcing a sideways scroll. */
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 6.5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.65rem, 4vw, 2.25rem);
}

h3 {
  font-size: clamp(1.15rem, 2.4vw, 1.3rem);
  letter-spacing: 0;
}

p {
  margin: 0 0 1.15em;
  max-width: var(--measure);
}

p:last-child {
  margin-bottom: 0;
}

ul {
  max-width: var(--measure);
}

strong {
  font-weight: 600;
}

a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

a:hover {
  color: var(--ink);
}

/* One consistent, high-contrast focus treatment everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell--narrow {
  max-width: 48rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
  color: var(--paper);
}

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

/* --------------------------------------------------------------------------
   4. Header + navigation
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  padding-block: clamp(1.5rem, 4vw, 2.25rem);
}

.site-header__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.5rem);
  text-align: center;
}

.wordmark {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.2vw, 1.5rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.35;
}

.wordmark:hover {
  color: var(--accent-deep);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem clamp(1rem, 3vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.5rem 0.15rem;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-muted);
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.site-nav .external-mark {
  font-size: 0.85em;
  margin-left: 0.35em;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-block: clamp(3rem, 9vw, 5.5rem) clamp(2.5rem, 7vw, 4.5rem);
  text-align: center;
}

.eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  max-width: none;
}

.hero h1 {
  margin-bottom: 0.5em;
}

.hero .lede,
.page-intro .lede {
  margin-inline: auto;
  max-width: 40rem;
  font-size: clamp(1.0625rem, 2.4vw, 1.1875rem);
  color: var(--ink-muted);
}

.rule {
  width: 3.5rem;
  height: 1px;
  margin: clamp(1.75rem, 4vw, 2.5rem) auto;
  background: var(--line-strong);
  border: 0;
}

.operator-note {
  margin: 0 auto;
  max-width: 34rem;
  font-size: 0.9375rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* --------------------------------------------------------------------------
   6. Sections + cards
   -------------------------------------------------------------------------- */

/* Vertical rhythm: sections alternate between plain and tinted bands, and the
   band edge is a visible rule — so every section carries the same padding on
   both sides and the rule always gets equal breathing room above and below. */
.section {
  padding-block: var(--section-gap);
}

.section--tinted {
  background: var(--paper-tint);
  border-block: 1px solid var(--line);
}

.section__head {
  max-width: 40rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

.section--centered .section__head {
  margin-inline: auto;
  text-align: center;
}

/* Centred intro copy reads better on a shorter measure. */
.section--centered .section__head p {
  margin-inline: auto;
  max-width: 34rem;
  text-wrap: pretty;
}

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 3rem);
  max-width: 42rem;
  margin-inline: auto;
  box-shadow: 0 1px 2px rgba(34, 31, 28, 0.03),
    0 12px 32px -20px rgba(34, 31, 28, 0.22);
}

.card h2 {
  margin-top: 0;
}

.card__intro {
  color: var(--ink-muted);
  margin-bottom: 2rem;
}

.card__footnote {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

/* --------------------------------------------------------------------------
   7. Forms
   -------------------------------------------------------------------------- */

.field {
  margin-bottom: 1.75rem;
}

.field > label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
}

.field__hint {
  margin: 0 0 0.65rem;
  font-size: 0.9375rem;
  color: var(--ink-faint);
  max-width: none;
}

input[type="tel"] {
  display: block;
  width: 100%;
  /* 16px minimum keeps iOS Safari from zooming on focus. */
  font-size: 1.0625rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper-raised);
  padding: 0.9rem 1rem;
  min-height: 3.25rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="tel"]::placeholder {
  color: var(--ink-placeholder);
}

input[type="tel"]:hover {
  border-color: var(--ink-faint);
}

input[type="tel"]:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--focus);
}

input[type="tel"][aria-invalid="true"] {
  border-color: var(--error);
  border-width: 2px;
  background: var(--error-tint);
}

/* Consent block — deliberately generous, readable, and visually distinct. */
.consent {
  margin: 0 0 1.75rem;
  padding: clamp(1.1rem, 3.5vw, 1.5rem);
  background: var(--paper-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.consent__control {
  display: flex;
  align-items: flex-start;
  gap: clamp(0.7rem, 2.5vw, 0.9rem);
}

/* Deliberately larger than a default checkbox: this is the consent control and
   it has to be obvious and easy to hit on a phone. */
.consent__control input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0.05rem 0 0;
  accent-color: var(--accent-deep);
  cursor: pointer;
}

.consent__control input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.consent__text {
  display: block;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  max-width: none;
  cursor: pointer;
}

.consent__text a {
  font-weight: 600;
  white-space: nowrap;
}

.consent[data-invalid="true"] {
  border-color: var(--error);
  border-width: 2px;
  background: var(--error-tint);
}

/* Inline validation messages. Never colour alone: icon + text + aria. */
.field-error {
  display: none;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.65rem 0 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--error);
  max-width: none;
}

.field-error[data-visible="true"] {
  display: flex;
}

.field-error::before {
  content: "!";
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.375rem;
  /* Roomier once there is width for it; tighter on narrow phones so long
     labels such as "Unsubscribe from SMS" stay on one line. */
  padding: 0.95rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    color 0.2s ease, transform 0.12s ease;
}

.button:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--paper);
}

.button:active {
  transform: translateY(1px);
}

.button--quiet {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.button--quiet:hover {
  color: var(--ink);
  background: var(--paper-tint);
  border-color: var(--ink);
}

@media (min-width: 30rem) {
  .button {
    width: auto;
    min-width: 15rem;
    padding-inline: 2rem;
  }
}

/* Loading state. aria-disabled rather than [disabled], so focus is retained;
   the submit handler guards against a second submission. */
.button.is-busy {
  cursor: progress;
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.button.is-busy::before {
  content: "";
  width: 1rem;
  height: 1rem;
  margin-right: 0.75rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .button.is-busy::before {
    animation: none;
    border-right-color: currentColor;
    opacity: 0.5;
  }
}

/* --------------------------------------------------------------------------
   7b. Success state
   --------------------------------------------------------------------------
   A card holds two sibling views — the form and the result — and swaps them
   by toggling [hidden]. Focus moves to the result so it is announced.
   -------------------------------------------------------------------------- */

.card__view:focus {
  outline: none;
}

.card__view:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 6px;
  border-radius: 2px;
}

.result__mark {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1.5rem;
  color: var(--paper);
  background: var(--accent-deep);
  border-radius: 50%;
}

.result__mark svg {
  width: 1.75rem;
  height: 1.75rem;
}

.result__title {
  margin-bottom: 0.5em;
}

.result__lead {
  font-size: clamp(1.0625rem, 2.4vw, 1.125rem);
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.result__lead [data-masked-phone] {
  white-space: nowrap;
}

.result p:not(.result__lead):not(.result__aside) {
  color: var(--ink-muted);
  margin-bottom: 0.75em;
}

.result__aside {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--ink-faint);
}

/* Understated text button for "sign up another number". */
.link-button {
  display: inline-block;
  margin-top: 1.75rem;
  padding: 0.5rem 0;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--accent-deep);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.link-button:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* --------------------------------------------------------------------------
   7c. Contact methods (Need help?)
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  gap: 1.25rem;
  /* Wide enough that the email address never has to break mid-word. */
  max-width: 58rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.contact-grid li {
  display: grid;
  gap: 0.3rem;
  padding: 1.25rem 1rem;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.contact-grid__label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.contact-grid__value {
  font-size: 0.9375rem;
  color: var(--ink);
  /* Last-resort safety so a long address can never push the layout sideways. */
  overflow-wrap: break-word;
}

a.contact-grid__value {
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  justify-self: center;
  /* Centred grid items size to their content and would otherwise spill out of
     the cell. min-width:0 removes the automatic min-content floor so the cap
     applies and overflow-wrap can break as a last resort. */
  max-width: 100%;
  min-width: 0;
}

a.contact-grid__value:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* Three across only once each column is comfortably wider than the email
   address; below this the cards stack full width. */
@media (min-width: 56rem) {
  .contact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .contact-grid li {
    align-content: start;
  }
}

.section__note {
  max-width: 38rem;
  margin: clamp(1.75rem, 4vw, 2.25rem) auto 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  text-align: center;
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   8. FAQ / program information
   -------------------------------------------------------------------------- */

.faq {
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.5rem);
  max-width: 46rem;
  margin-inline: auto;
}

@media (min-width: 48rem) {
  .faq {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 60rem;
  }
}

.faq__item h3 {
  margin-bottom: 0.4em;
}

.faq__item p {
  color: var(--ink-muted);
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   9. Long-form legal pages
   -------------------------------------------------------------------------- */

.page-intro {
  padding-block: clamp(3rem, 8vw, 4.5rem) clamp(1.5rem, 4vw, 2rem);
  text-align: center;
}

.doc {
  /* Slightly tighter measure than the rest of the site: long-form legal copy
     is easier to read on a shorter line. */
  --measure: 60ch;
  padding-bottom: var(--section-gap);
}

.doc__meta {
  margin: 0 0 clamp(2rem, 5vw, 3rem);
  font-size: 0.9375rem;
  color: var(--ink-faint);
  text-align: center;
  max-width: none;
}

.doc section {
  margin-bottom: clamp(2.25rem, 5vw, 3rem);
}

.doc h2 {
  font-size: clamp(1.4rem, 3.2vw, 1.75rem);
  padding-top: 0.25rem;
}

/* Sub-headings need clear separation from body copy at the same optical size. */
.doc h3 {
  margin-top: 2rem;
  font-size: clamp(1.25rem, 2.8vw, 1.375rem);
}

.doc ul {
  padding-left: 1.25rem;
  margin: 0 0 1.15em;
}

.doc li {
  margin-bottom: 0.5rem;
}

.doc li:last-child {
  margin-bottom: 0;
}

.doc .callout {
  padding: clamp(1.25rem, 4vw, 1.75rem);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.doc .callout > :last-child {
  margin-bottom: 0;
}

.term-list {
  margin: 0;
  display: grid;
  gap: 0.9rem 1.5rem;
}

.term-list dt {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}

.term-list dd {
  margin: 0.15rem 0 0;
  color: var(--ink-muted);
}

@media (min-width: 40rem) {
  .term-list {
    grid-template-columns: 12rem minmax(0, 1fr);
    align-items: baseline;
  }

  .term-list dt {
    grid-column: 1;
  }

  .term-list dd {
    grid-column: 2;
    margin-top: 0;
  }
}

.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: clamp(1.5rem, 4vw, 2rem);
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-tint);
  padding-block: clamp(2.5rem, 7vw, 4rem);
}

.site-footer__inner {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  text-align: center;
}

.site-footer .wordmark {
  font-size: 1rem;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem clamp(1rem, 3vw, 1.75rem);
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}

.footer-nav a {
  display: inline-block;
  padding: 0.35rem 0.1rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}

.footer-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.site-footer__legal {
  font-size: 0.875rem;
  color: var(--ink-faint);
  max-width: 34rem;
}

.site-footer__legal p {
  max-width: none;
}
