/* ==========================================================================
   R Studio — Rewari
   Design system: "Contact Sheet"
   Palette : gelatin-silver paper, darkroom ink, safelight accent
   Type    : Bricolage Grotesque (display) / Inter Tight (body) / Martian Mono (edge print)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --paper:      #E7E5DF;
  --paper-hi:   #F3F2EE;
  --ink:        #16171A;
  --ink-soft:   #24262B;
  --grey:       #6C7076;
  --grey-light: #9DA1A6;
  --line:       #C9C6BE;
  --line-dark:  #33363C;
  --safelight:  #D64500;
  --white:      #FFFFFF;

  --ff-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --ff-body:    "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --ff-mono:    "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.84rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4:  clamp(2.6rem, 1.8rem + 4vw, 5.4rem);

  --gutter: clamp(1.15rem, 4vw, 3rem);
  --bleed: 1240px;
  --radius: 2px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: var(--step-0);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--ff-display); font-weight: 700; line-height: 1.04; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; }
button { font: inherit; }

:focus-visible {
  outline: 3px solid var(--safelight);
  outline-offset: 3px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--white); padding: 0.8rem 1.2rem;
}
.skip-link:focus { left: 0; }

.container { width: 100%; max-width: var(--bleed); margin-inline: auto; padding-inline: var(--gutter); }
.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;
}

/* ---------- Shared type ---------- */
.eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--safelight);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--safelight);
  flex: none;
}
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); max-width: 60ch; }
.prose { max-width: 68ch; }
.prose h2 { font-size: var(--step-2); margin: 2.6rem 0 0.9rem; }
.prose h3 { font-size: var(--step-1); margin: 2rem 0 0.6rem; }
.prose p { color: var(--ink-soft); }
.prose a { color: var(--safelight); text-underline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 1rem 1.6rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn:hover { background: var(--safelight); border-color: var(--safelight); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--white); }
.btn--on-dark { background: var(--white); color: var(--ink); border-color: var(--white); }
.btn--on-dark:hover { background: var(--safelight); border-color: var(--safelight); color: var(--white); }

/* ---------- Offer strip ---------- */
.offer-strip {
  background: var(--ink);
  color: var(--paper-hi);
  font-family: var(--ff-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.7rem 1rem;
}
.offer-strip strong { color: var(--safelight); font-weight: 400; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(231, 229, 223, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 74px;
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; flex: none; }
.brand img { width: 46px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--ff-display); font-weight: 700; font-size: 1.12rem; letter-spacing: -0.03em; }
.brand-sub {
  font-family: var(--ff-mono); font-size: 0.52rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--grey); margin-top: 4px;
}

.nav { display: flex; align-items: center; gap: clamp(0.9rem, 1.6vw, 1.7rem); }
.nav a {
  font-family: var(--ff-mono);
  font-size: 0.63rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav a:hover { color: var(--safelight); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--safelight); }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; background: none; border: 1px solid var(--line);
  border-radius: var(--radius); cursor: pointer; color: var(--ink);
}
.mobile-nav { display: none; border-top: 1px solid var(--line); background: var(--paper-hi); }
.mobile-nav.is-open { display: block; }
.mobile-nav ul { list-style: none; }
.mobile-nav a {
  display: block; padding: 0.95rem 0; text-decoration: none;
  font-family: var(--ff-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.mobile-nav li:last-child a { border-bottom: 0; }

@media (max-width: 1080px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Home hero ---------- */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: end; }
.hero h1 { font-size: var(--step-4); letter-spacing: -0.045em; }
.hero h1 em { font-style: normal; color: var(--safelight); }
.hero .lede { margin-top: 1.6rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.2rem; }
.hero-figure { position: relative; }
.hero-figure img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.hero-meta {
  font-family: var(--ff-mono); font-size: 0.6rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--grey);
  display: flex; justify-content: space-between; padding-top: 0.7rem;
  border-top: 1px solid var(--line); margin-top: 0.7rem;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero-figure { order: -1; }
}

/* ---------- Page hero (inner) ---------- */
.page-hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.8rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: var(--step-3); max-width: 18ch; }
.page-hero .lede { margin-top: 1.3rem; }
.breadcrumb { margin-bottom: 1.4rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.breadcrumb li {
  font-family: var(--ff-mono); font-size: 0.6rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--grey);
}
.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem; color: var(--line); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--safelight); }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--dark { background: var(--ink); color: var(--paper-hi); }
.section--dark .eyebrow { color: var(--safelight); }
.section--dark .lede { color: var(--grey-light); }
.section--dark p { color: var(--grey-light); }
.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: var(--step-3); }
.section-head p { margin-top: 1.1rem; color: var(--ink-soft); }
.section--dark .section-head p { color: var(--grey-light); }

/* ---------- Contact sheet grid (signature) ---------- */
.contact-sheet {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: clamp(1rem, 2vw, 1.6rem);
}
.frame {
  background: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
/* sprocket perforations, top + bottom, like 35mm film */
.frame::before, .frame::after {
  content: "";
  position: absolute; left: 0; right: 0; height: 9px;
  background-image: repeating-linear-gradient(
    to right,
    var(--ink-soft) 0 7px,
    transparent 7px 15px
  );
  z-index: 2; pointer-events: none;
}
.frame::before { top: 0; }
.frame::after { bottom: 34px; }
.frame-btn {
  display: block; width: 100%; padding: 9px 0 0; border: 0; background: none; cursor: zoom-in;
}
.frame img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: saturate(0.55) contrast(1.04);
  transform: scale(1.001);
  transition: filter 0.45s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.frame:hover img, .frame-btn:focus-visible img { filter: saturate(1) contrast(1); transform: scale(1.045); }
.frame-edge {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 0.55rem 0.85rem; height: 34px;
  font-family: var(--ff-mono); font-size: 0.56rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--grey-light);
  background: var(--ink);
}
.frame-title { color: var(--paper-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame-num { color: var(--safelight); flex: none; }

/* ---------- Service cards ---------- */
.service-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.service {
  background: var(--paper-hi);
  padding: clamp(1.6rem, 3vw, 2.4rem);
  display: flex; flex-direction: column; gap: 0.7rem;
  text-decoration: none;
  transition: background 0.3s ease;
}
.service:hover { background: var(--white); }
.service-index { font-family: var(--ff-mono); font-size: 0.6rem; letter-spacing: 0.16em; color: var(--safelight); }
.service h3 { font-size: var(--step-1); }
.service p { font-size: var(--step--1); color: var(--grey); margin: 0; line-height: 1.6; }
.service-go { font-family: var(--ff-mono); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; margin-top: auto; padding-top: 0.9rem; }

/* ---------- FAQ ---------- */
.faq { border-bottom: 1px solid var(--line); padding: 1.2rem 0; }
.faq summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: var(--step-1); font-weight: 600; }
.faq summary::after {
  content: "+"; font-family: var(--ff-mono); font-size: 1.1rem; color: var(--safelight); flex: none;
}
.faq[open] summary::after { content: "\2212"; }
.faq p { margin: 0.9rem 0 0.3rem; color: var(--grey); max-width: 66ch; }

/* ---------- Stats ---------- */
.stats { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.stat dt { font-family: var(--ff-mono); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--grey); }
.stat dd { margin: 0.5rem 0 0; font-family: var(--ff-display); font-weight: 700; font-size: var(--step-3); letter-spacing: -0.04em; }

/* ---------- Split media ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split video, .split img { width: 100%; object-fit: cover; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--safelight); color: var(--white); padding: clamp(2.6rem, 6vw, 4.5rem) 0; }
.cta-band h2 { font-size: var(--step-3); max-width: 20ch; }
.cta-band p { margin-top: 1rem; max-width: 52ch; color: rgba(255,255,255,0.9); }
.cta-band .btn { background: var(--ink); border-color: var(--ink); margin-top: 1.8rem; }
.cta-band .btn:hover { background: var(--white); color: var(--ink); border-color: var(--white); }

/* ---------- Form ---------- */
.form-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 900px) { .form-layout { grid-template-columns: 1fr; } }
.field { margin-bottom: 1.3rem; }
.field label {
  display: block; font-family: var(--ff-mono); font-size: 0.6rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--grey); margin-bottom: 0.5rem;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 0.85rem 0.95rem;
  font-family: var(--ff-body); font-size: var(--step-0);
  color: var(--ink); background: var(--paper-hi);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--safelight); background: var(--white); outline: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.consent { display: flex; gap: 0.8rem; align-items: flex-start; margin: 1.6rem 0; }
.consent input { width: 20px; height: 20px; flex: none; margin-top: 3px; accent-color: var(--safelight); }
.consent label { font-size: var(--step--1); color: var(--grey); line-height: 1.55; text-transform: none; letter-spacing: 0; font-family: var(--ff-body); }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-status { margin-top: 1rem; font-size: var(--step--1); min-height: 1.4em; }
.form-status[data-state="error"] { color: var(--safelight); }
.form-status[data-state="ok"] { color: #1B7A3E; }
.btn[aria-disabled="true"] { opacity: 0.6; pointer-events: none; }

.info-card { border: 1px solid var(--line); background: var(--paper-hi); padding: clamp(1.5rem, 3vw, 2.2rem); }
.info-card h2 { font-size: var(--step-1); margin-bottom: 1.2rem; }
.info-list { list-style: none; display: flex; flex-direction: column; gap: 1.1rem; }
.info-list li { display: flex; gap: 0.9rem; align-items: flex-start; font-size: var(--step--1); }
.info-list svg { flex: none; margin-top: 2px; fill: var(--safelight); }
.info-list a { text-decoration: none; }
.info-list a:hover { color: var(--safelight); }

.map-frame { border: 1px solid var(--line); margin-top: clamp(2rem, 4vw, 3rem); }
.map-frame iframe { width: 100%; height: 420px; border: 0; display: block; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--grey-light); padding: clamp(3rem, 6vw, 4.5rem) 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr; gap: clamp(2rem, 4vw, 3.5rem); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 {
  font-family: var(--ff-mono); font-size: 0.62rem; font-weight: 400;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--safelight); margin-bottom: 1.2rem;
}
.site-footer p { font-size: var(--step--1); line-height: 1.7; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.footer-links a { text-decoration: none; font-size: var(--step--1); }
.footer-links a:hover { color: var(--safelight); }
.socials { display: flex; gap: 0.7rem; margin-top: 1.6rem; }
.socials a {
  width: 38px; height: 38px; border: 1px solid var(--line-dark); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; transition: border-color 0.2s ease, background 0.2s ease;
}
.socials a:hover { border-color: var(--safelight); background: var(--safelight); }
.socials img { width: 17px; height: 17px; object-fit: contain; }
.footer-base {
  margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.5rem; border-top: 1px solid var(--line-dark);
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  font-family: var(--ff-mono); font-size: 0.58rem; letter-spacing: 0.13em; text-transform: uppercase;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 11, 13, 0.94);
  display: none; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
}
.lightbox[open], .lightbox.is-open { display: flex; }
.lightbox-inner { max-width: 1000px; width: 100%; }
.lightbox img { width: 100%; max-height: 76vh; object-fit: contain; margin-inline: auto; }
.lightbox-caption {
  margin-top: 1.1rem; text-align: center;
  font-family: var(--ff-mono); font-size: 0.68rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-hi);
}
.lightbox-close {
  position: absolute; top: 1.2rem; right: 1.2rem;
  width: 46px; height: 46px; background: none; border: 1px solid var(--line-dark);
  color: var(--paper-hi); font-size: 1.5rem; line-height: 1; cursor: pointer; border-radius: 50%;
}
.lightbox-close:hover { border-color: var(--safelight); color: var(--safelight); }

/* ---------- Utility page (404 / thank-you) ---------- */
.centered { min-height: 58vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 4rem 0; }
.centered h1 { font-size: var(--step-3); }
.centered p { margin-top: 1.1rem; max-width: 46ch; color: var(--grey); }

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

/* ---------- Print ---------- */
@media print {
  .site-header, .offer-strip, .lightbox, .cta-band { display: none; }
  body { background: #fff; }
}
