/* Rosewood Crating — site styles (mobile-first; tokens are LOCKED, see CLAUDE.md) */
@import url("tokens.css");

:root {
  /* 8px base scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --section-y: 4rem;
  --fs-h2: clamp(1.625rem, 3.5vw + 0.75rem, 2.5rem);
}

@media (min-width: 64rem) {
  :root {
    --section-y: 7rem;
  }
}

body {
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

.section {
  padding: var(--section-y) 0;
}

.h2 {
  font-size: var(--fs-h2);
  max-width: 24ch;
  margin: 0 0 var(--space-4);
}

a {
  color: inherit;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-espresso);
  color: var(--color-bone);
  padding: var(--space-1) var(--space-2);
  z-index: 10;
}

.skip-link:focus {
  left: var(--space-2);
}

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--color-hairline);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1); /* mobile: tight min-gap so the larger logo + button both fit */
  min-height: 4.5rem;
}

@media (min-width: 64rem) {
  .nav {
    gap: var(--space-3);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

/* Finalized wordmark logo (inline SVG, recolored to brand antique gold) */
.brand-logo {
  display: block;
  height: 1.8rem; /* very narrow phones (≤360px): step down so the button still fits */
  width: auto;
}

@media (min-width: 22.5rem) {
  .brand-logo {
    height: 2.3rem; /* normal phones: larger, still clears the quote button */
  }
}

@media (min-width: 48rem) {
  .brand-logo {
    height: 3.2rem; /* tablet/desktop: scaled up to match the quote button's presence */
  }
}

.footer-logo {
  display: block;
  width: 11.5rem;
  max-width: 55vw;
  height: auto;
  margin: 0 0 var(--space-3);
}

.logo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--color-hairline);
  color: var(--color-brass);
  flex: none;
}

.brand-words {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--color-bone);
  display: none;
}

.nav-links {
  display: none;
  gap: var(--space-4);
}

.nav-links a {
  text-decoration: none;
  color: var(--color-dim);
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
  padding: var(--space-2) 0; /* keeps tap target ≥44px */
  transition: color 150ms ease-out;
}

.nav-links a:hover {
  color: var(--color-brass-light);
}

@media (min-width: 48rem) {
  .brand-words {
    display: block;
  }

  .nav-links {
    display: flex;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem; /* 44px tap target */
  padding: 0.625rem 1.5rem;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 150ms ease-out, border-color 150ms ease-out,
    color 150ms ease-out, transform 150ms ease-out;
}

.btn-brass {
  background: var(--color-brass);
  color: var(--color-espresso);
}

.btn-brass:hover {
  background: var(--color-brass-light);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: var(--color-hairline);
  color: var(--color-bone);
}

.btn-ghost:hover {
  border-color: var(--color-brass);
  color: var(--color-brass-light);
  transform: translateY(-1px);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

/* ---------- Placeholder photo blocks ---------- */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tracking-mono);
}

.ph-3x4 {
  aspect-ratio: 3 / 4;
}

/* Real job photos — treatment is baked into the file (warm grade + espresso
   vignette); CSS only handles fit and a restrained hover lift. */
.photo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

img.ph-3x4,
img.ph-16x10,
img.ph-16x9 {
  height: auto;
}

.ph-16x10 {
  aspect-ratio: 16 / 10;
}

.ph-16x9 {
  aspect-ratio: 16 / 9;
}

/* ---------- Hero ---------- */
.hero-grid {
  display: grid;
  gap: var(--space-6);
}

.eyebrow {
  color: var(--color-brass);
  margin: 0 0 var(--space-2);
}

.hero-manifest {
  margin: var(--space-3) 0 0;
}

.hero-figure {
  /* full-bleed on mobile */
  margin: 0 calc(-1 * var(--gutter));
}

.hero-figure figcaption {
  padding: var(--space-2) var(--gutter) 0;
}

.frame {
  position: relative;
  padding: var(--space-2);
}

.corner {
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  border: 0 solid var(--color-brass);
}

.corner-tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.corner-tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.corner-bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.corner-br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

@media (min-width: 64rem) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 5rem;
  }

  .hero-figure {
    margin: 0;
  }

  .hero-figure figcaption {
    padding: var(--space-2) 0 0;
  }
}

/* ---------- What we crate ---------- */
.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.tile {
  border: 1px solid var(--color-hairline);
  padding: var(--space-2);
  transition: border-color 150ms ease-out, transform 150ms ease-out;
}

.tile:hover,
.tile:focus-within {
  border-color: var(--color-brass);
  transform: translateY(-2px);
}

/* Whole tile is a link */
.tile-link-block {
  display: block;
  color: inherit;
  text-decoration: none;
}

.tile h3 {
  transition: color 150ms ease-out;
}

.tile:hover h3,
.tile:focus-within h3 {
  color: var(--color-brass-light);
}

.tile-link-block:focus-visible {
  outline: 2px solid var(--color-brass);
  outline-offset: 4px;
}

.tile-slot {
  margin: var(--space-2) 0 0;
}

.tile h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  margin: var(--space-1) 0;
}

.tile p:last-child {
  color: var(--color-dim);
  font-size: var(--fs-small);
  margin: 0;
}

/* Services tiles carry an extra "see deep page" link, so the description
   is no longer :last-child — style it explicitly. */
.tile-desc {
  color: var(--color-dim);
  font-size: var(--fs-small);
  margin: 0;
}

/* Homepage installation aside — secondary service, kept proportional */
.services-aside {
  margin: var(--space-4) 0 0;
  max-width: 62ch;
  color: var(--color-dim);
}

.services-aside strong {
  color: var(--color-bone);
  font-weight: 500;
}

.services-aside a {
  color: var(--color-brass);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  white-space: nowrap;
}

.services-aside a:hover {
  color: var(--color-brass-light);
}

.tile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 2.75rem; /* tap target */
  margin-top: var(--space-1);
  color: var(--color-brass);
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 150ms ease-out;
}

.tile-link:hover {
  color: var(--color-brass-light);
}

@media (min-width: 40rem) {
  .tiles {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .tiles {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Process ---------- */
.process {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
  /* vertical timeline on mobile */
  border-left: 1px solid var(--color-hairline);
}

.step {
  padding-left: var(--space-3);
}

.numeral {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--color-brass);
  margin: 0 0 var(--space-1);
}

.step-label {
  color: var(--color-brass-light);
  margin: 0 0 var(--space-1);
  font-weight: 500;
}

.step p:last-child {
  color: var(--color-dim);
  max-width: 38ch;
  margin: 0;
}

@media (min-width: 64rem) {
  .process {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    border-left: 0;
    border-top: 1px solid var(--color-hairline);
    padding-top: var(--space-4);
  }

  .step {
    padding-left: 0;
  }
}

/* ---------- Why Rosewood (heartwood band) ---------- */
.band {
  background: var(--color-heartwood);
}

.standards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.standards h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  margin: 0 0 var(--space-1);
}

.standards p {
  color: var(--color-dim);
  font-size: var(--fs-small);
  margin: 0;
  max-width: 44ch;
}

.verify {
  color: var(--color-brass-light);
}

@media (min-width: 40rem) {
  .standards {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6) var(--space-4);
  }
}

/* ---------- Partners page ---------- */
.pull-quote {
  margin: 0 0 var(--space-3);
}

.pull-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.75rem, 4vw + 0.5rem, 3rem);
  line-height: 1.2;
  color: var(--color-bone);
  margin: 0;
}

.promise-copy {
  max-width: 52ch;
  margin-bottom: 0;
}

.step-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  margin: 0 0 var(--space-1);
}

.direct-line {
  color: var(--color-brass-light);
  margin: 0;
}

.direct-line .phone {
  padding: 0;
}

/* ---------- Partner strip ---------- */
.partner {
  border-top: 1px solid var(--color-hairline);
  border-bottom: 1px solid var(--color-hairline);
  background: var(--color-surface);
}

.partner-line {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--color-brass-light);
  margin: var(--space-3) 0;
}

/* ---------- Services page ---------- */
.services-hero-figure {
  margin: var(--space-4) 0 0;
}

.services-hero-figure figcaption {
  margin-top: var(--space-2);
}

.process-more {
  margin-top: var(--space-4);
}

.process-more a {
  color: var(--color-brass);
  text-decoration: none;
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
  transition: color 150ms ease-out;
}

.process-more a:hover {
  color: var(--color-brass-light);
}

/* ---------- Deep service pages (motorcycle / piano) ---------- */
.feature {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.feature-media {
  margin: 0;
}

.feature-media figcaption {
  margin-top: var(--space-2);
}

.feature .story {
  margin-top: 0;
}

@media (min-width: 64rem) {
  .feature {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
  }

  /* alternate sides for editorial rhythm */
  .feature-rev .feature-media {
    order: 2;
  }
}

/* ---------- About page ---------- */
.story {
  max-width: var(--measure);
}

.photo-pending {
  border: 1px solid var(--color-hairline);
  padding: var(--space-4) var(--space-3);
  margin-top: var(--space-4);
  text-align: center;
}

.photo-pending p {
  margin: 0;
  color: var(--color-brass);
}

.area-note {
  color: var(--color-brass-light);
  margin: 0;
}

/* ---------- CTA ---------- */
.cta-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta .h2 {
  margin-left: auto;
  margin-right: auto;
}

.cta .btn-row {
  justify-content: center;
}

.phone {
  text-decoration: none;
  color: var(--color-brass-light);
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem; /* tap target */
  padding: 0 var(--space-2);
}

/* ---------- Quote form ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.quote-container {
  max-width: 44rem;
}

.quote-call {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: var(--space-3) 0 0;
}

.quote-form {
  margin-top: var(--space-6);
}

.path-toggle {
  display: flex;
  border: 1px solid var(--color-hairline);
  padding: 0;
  margin: 0 0 var(--space-4);
}

.toggle-opt {
  flex: 1;
}

.toggle-opt input {
  position: absolute;
  opacity: 0;
}

.toggle-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem; /* 44px tap target */
  padding: var(--space-1) var(--space-2);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-dim);
  text-align: center;
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}

.toggle-opt input:checked + span {
  background: var(--color-brass);
  color: var(--color-espresso);
}

.toggle-opt input:focus-visible + span {
  outline: 2px solid var(--color-brass-light);
  outline-offset: -2px;
}

.field {
  margin-bottom: var(--space-3);
}

.field label {
  display: block;
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.req {
  color: var(--color-brass);
}

.field-hint {
  color: var(--color-muted);
  font-weight: 400;
}

p.field-hint {
  margin: var(--space-1) 0 0;
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field textarea,
.field select {
  width: 100%;
  min-height: 2.75rem; /* 44px tap target */
  padding: 0.625rem 0.875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-hairline);
  border-radius: 0;
  color: var(--color-bone);
  font-family: var(--font-body);
  font-size: 1rem; /* ≥16px so iOS doesn't zoom on focus */
  line-height: 1.4;
  transition: border-color 150ms ease-out;
}

.field textarea {
  resize: vertical;
}

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: var(--color-brass);
}

.field input[type="file"] {
  display: block;
  width: 100%;
  padding: var(--space-1) 0;
  color: var(--color-dim);
  font-size: var(--fs-small);
}

/* Brass error state */
.field.has-error input,
.field.has-error textarea,
.field.has-error select {
  border-color: var(--color-brass-light);
}

.field-error {
  color: var(--color-brass-light);
  margin: var(--space-1) 0 0;
}

.field-row {
  display: grid;
  gap: 0 var(--space-2);
}

@media (min-width: 40rem) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Photo thumbnails */
.thumbs {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.thumbs li {
  position: relative;
}

.thumbs img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border: 1px solid var(--color-hairline);
}

.thumb-remove {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-espresso);
  border: 1px solid var(--color-brass);
  color: var(--color-brass-light);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.form-note {
  color: var(--color-brass-light);
  margin: var(--space-4) 0 var(--space-3);
}

/* Submission-failure banner — shown by js/quote.js on network/Formspree error */
.form-error-banner {
  color: var(--color-brass-light);
  border: 1px solid var(--color-brass);
  border-left-width: 3px;
  padding: var(--space-2) var(--space-3);
  margin: var(--space-4) 0 var(--space-3);
}

.form-error-banner .phone {
  padding: 0;
}

.btn-submit {
  width: 100%;
}

@media (min-width: 40rem) {
  .btn-submit {
    width: auto;
  }
}

/* Success state */
.form-success {
  margin-top: var(--space-6);
  border: 1px solid var(--color-hairline);
  padding: var(--space-4);
}

.rose-mark {
  display: block;
  margin: 0 0 var(--space-3);
}

.form-success .h2:focus {
  outline: none;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-hairline);
  padding: var(--space-6) 0;
}

.footer-wordmark {
  display: block;
  margin: 0 0 var(--space-2);
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem; /* tap target */
  text-decoration: none;
  color: var(--color-dim);
  font-size: var(--fs-small);
  letter-spacing: 0.04em;
  transition: color 150ms ease-out;
}

.footer-links a:hover {
  color: var(--color-brass-light);
}

.link-pending {
  color: var(--color-muted);
}

.fine-print {
  color: var(--color-muted);
  margin-top: var(--space-3);
}

/* ---------- Scroll reveals (whisper motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease-out var(--reveal-delay, 0ms),
      transform 600ms ease-out var(--reveal-delay, 0ms);
  }

  .js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ===================================================================
   TWO-TONE SCHEME (owner-approved, 2026-06-30)
   Light (ivory) is the default ground (tokens.css). Photo-grid sections
   and the footer opt into dark espresso via `.panel-dark` / `.site-footer`,
   which re-map the palette variables to the dark set so all descendants
   render dark. Every light<->dark boundary carries a full-bleed brass seam.
   =================================================================== */

/* dark panels: the work-photo grids + the footer */
.panel-dark,
.site-footer {
  --color-espresso: #14100c;
  --color-surface: #1c1612;
  --color-heartwood: #3b1f18;
  --color-bone: #efe6d6;
  --color-dim: #c7bba4;
  --color-muted: #9a8e78;
  --color-brass: #b68b4c;
  --color-brass-light: #d6b377;
  --color-hairline: rgba(214, 179, 119, 0.2);
  background: var(--color-espresso);
  color: var(--color-bone);
}

/* full-bleed brass seam at each light<->dark boundary */
.panel-dark {
  border-top: 1px solid #b68b4c;
  border-bottom: 1px solid #b68b4c;
}
.site-footer {
  border-top: 1px solid #b68b4c;
}

/* on ivory, dark-treated photos get a thin frame so they sit, not float;
   inside dark panels the photos pop edge-to-edge */
.photo {
  border: 1px solid var(--color-hairline);
}
.panel-dark .photo,
.site-footer .photo {
  border: 0;
}

/* nav wordmark sits on ivory -> deep gold (footer mark stays brand brass on dark) */
.brand-logo text {
  fill: var(--color-brass);
}

/* success-state rose mark adapts to the light ground */
.rose-mark path {
  stroke: var(--color-brass);
}

/* ===================================================================
   MOBILE NAVIGATION (accessible hamburger) — primary nav reachable <768px
   =================================================================== */
.site-header { position: relative; }
.brand { margin-right: auto; }            /* mobile: push toggle + CTA right */

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;                          /* 44px tap target */
  height: 2.75rem;
  padding: 0.65rem;
  background: transparent;
  border: 1px solid var(--color-hairline);
  cursor: pointer;
  order: 0;
}
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-brass);
  transition: transform 150ms ease-out, opacity 150ms ease-out;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 48rem) {
  .nav-toggle { display: none; }           /* desktop: real nav-links show instead */
  .brand { margin-right: 0; }
}

@media (max-width: 47.99rem) {
  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    left: 0; right: 0; top: 100%;
    z-index: 30;
    background: var(--color-espresso);          /* ivory ground */
    border-top: 1px solid var(--color-hairline);
    border-bottom: 1px solid var(--color-brass); /* echoes the brass seam */
    padding: var(--space-1) var(--gutter) var(--space-2);
    box-shadow: 0 10px 24px rgba(33, 25, 19, 0.1);
  }
  .nav-links.is-open a {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-hairline);
  }
  .nav-links.is-open a:last-child { border-bottom: 0; }
}

/* ===================================================================
   SIGNATURE MOTION — hero unveil (ONE deliberate moment, reduced-motion-safe)
   The framed hero image is revealed with a left-to-right clip wipe on load,
   like sliding open a crate panel. Replaces the generic fade-up on the hero.
   =================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-figure {
    animation: hero-unveil 1000ms cubic-bezier(0.22, 0.72, 0.2, 1) both;
  }
  @keyframes hero-unveil {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
  }
}

/* Honeypot field — hidden from humans; bots that fill it are rejected by Web3Forms */
.hp-field { display: none; }
