/* ============================================================
   JW Web redesign — shared base styles
   Two directions (A: editorial, B: technical) swap via [data-dir]
   ============================================================ */

:root {
  /* Brand palette — from the JW Web logo (amber / coral / brick on cream) */
  --ink: #2a1c16;        /* warm espresso near-black */
  --ink-2: #3a2920;
  --paper: #f5f2ec;      /* warm cream */
  --paper-2: #ece6da;
  --line: rgba(42, 28, 22, 0.14);
  --muted: rgba(42, 28, 22, 0.56);
  --accent: #f16d59;     /* logo coral */
  --accent-2: #fdba2e;   /* logo amber */
  --accent-3: #a64a3b;   /* logo brick */

  --radius: 4px;
  --maxw: 1240px;
  --gutter: clamp(20px, 4vw, 48px);

  --serif: "Newsreader", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* Dark variant — warm darks to stay on-brand */
[data-theme="dark"] {
  --ink: #f3ece2;
  --ink-2: #e2d8ca;
  --paper: #1a120d;
  --paper-2: #241912;
  --line: rgba(243, 236, 226, 0.14);
  --muted: rgba(243, 236, 226, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--paper); color: var(--ink); }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.hair { height: 1px; background: var(--line); width: 100%; }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.eyebrow .dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%;
  vertical-align: middle; margin-right: 8px;
  transform: translateY(-1px);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 var(--gutter);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-weight: 600; font-size: 14px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 12px;
  letter-spacing: -0.02em;
}
.brand-logo { height: 44px; width: auto; }
[data-theme="dark"] .brand-logo { filter: brightness(1.08); }
footer .brand-logo { height: 48px; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-size: 13px; color: var(--muted);
  transition: color .2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-cta {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.02em;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background .2s ease, color .2s ease;
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn .arrow { transition: transform .25s ease; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Sections common ---------- */
section { padding: clamp(64px, 10vh, 120px) 0; position: relative; }
.section-head {
  display: grid; grid-template-columns: 1fr 2fr; gap: 48px;
  padding-bottom: 48px; align-items: end;
}
.section-head h2 {
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.05; letter-spacing: -0.02em;
}
.section-head .lede { color: var(--muted); max-width: 52ch; font-size: 17px; }

@media (max-width: 780px) {
  .section-head { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- Service cards (shared grid) ---------- */
.services {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.service {
  grid-column: span 4;
  background: var(--paper);
  padding: 36px;
  min-height: 240px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
  transition: background .25s ease;
}
.service:hover { background: var(--paper-2); }
.service .num {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.08em;
}
.service h3 {
  font-size: 22px; letter-spacing: -0.01em; margin-top: 40px;
  font-weight: 500;
}
.service p { color: var(--muted); font-size: 14px; margin-top: 10px; }
.service .tag {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent);
  margin-top: 24px;
}
.service.big { grid-column: span 8; }
.service.half { grid-column: span 6; }
@media (max-width: 900px) {
  .service, .service.big, .service.half { grid-column: span 12; }
}

/* ---------- Process ---------- */
.process {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.step {
  padding: 36px 24px 40px;
  border-right: 1px solid var(--line);
  position: relative;
}
.step:last-child { border-right: 0; }
.step .idx {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.12em;
}
.step h4 {
  font-size: 20px; margin-top: 24px; font-weight: 500;
  letter-spacing: -0.01em;
}
.step p { font-size: 13px; color: var(--muted); margin-top: 8px; }
@media (max-width: 900px) {
  .process { grid-template-columns: 1fr 1fr; }
  .step { border-bottom: 1px solid var(--line); }
  .step:nth-child(2n) { border-right: 0; }
}

/* ---------- Work grid ---------- */
.work {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.case {
  grid-column: span 6;
  display: flex; flex-direction: column; gap: 16px;
}
.case .thumb {
  aspect-ratio: 4/3;
  background:
    repeating-linear-gradient(135deg,
      var(--paper-2) 0 12px,
      var(--paper) 12px 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.case .thumb { overflow: hidden; padding: 0; }
.case .thumb img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  transition: object-position 6s ease, transform .6s ease;
  will-change: object-position;
}
/* parallax: on hover, slowly pan the full-page screenshot top -> bottom */
.case:hover .thumb img { object-position: center bottom; transform: scale(1.02); }
.case .meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.06em;
}
.case h4 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.case p { color: var(--muted); font-size: 14px; }
@media (max-width: 780px) { .case { grid-column: span 12; } }

/* ---------- Testimonials ---------- */
.quotes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
}
.quote {
  background: var(--paper);
  padding: 40px;
}
.quote blockquote {
  font-size: 22px; line-height: 1.35; letter-spacing: -0.01em;
  max-width: 42ch;
}
.quote cite {
  display: block; margin-top: 24px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  font-style: normal; letter-spacing: 0.08em; text-transform: uppercase;
}
@media (max-width: 780px) { .quotes { grid-template-columns: 1fr; } }

/* ---------- Contact form ---------- */
.contact-grid {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px;
  margin-top: 16px; align-items: start;
}
.contact-form {
  border: 1px solid var(--line); background: var(--paper);
  padding: 32px; display: flex; flex-direction: column; gap: 18px;
}
.cf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cf-field { display: flex; flex-direction: column; gap: 7px; }
.cf-field label {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted);
}
.cf-opt { text-transform: none; letter-spacing: 0; }
.cf-field input, .cf-field textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 13px; width: 100%; transition: border-color .2s ease;
}
.cf-field input:focus, .cf-field textarea:focus { outline: none; border-color: var(--ink); }
.cf-field textarea { resize: vertical; min-height: 120px; }
.cf-field.cf-invalid input, .cf-field.cf-invalid textarea { border-color: var(--accent); }
.cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.cf-foot button[disabled] { opacity: 0.6; cursor: progress; }
.cf-status { font-size: 14px; color: var(--muted); }
.cf-status.cf-ok { color: #1f8a7a; }
.cf-status.cf-err { color: var(--accent-3); }
.contact-alt {
  display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line);
}
.contact-alt .service { min-height: 0; }
@media (max-width: 780px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .cf-two { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 40px;
  background: var(--paper);
}
.foot-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
}
.foot-grid h5 {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin-bottom: 16px;
  font-weight: 500;
}
.foot-grid a { display: block; font-size: 14px; padding: 4px 0; color: var(--ink); }
.foot-grid a:hover { color: var(--accent); }
.foot-bottom {
  display: flex; justify-content: space-between;
  margin-top: 64px; padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.06em;
}
@media (max-width: 780px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Fade in on scroll (progressive enhancement) ----------
   Content is visible by default; it's only hidden (then animated in)
   when JS is present (html.js) — so a JS failure never blanks the page. */
.js .rise { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s ease; }
.js .rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .rise { opacity: 1; transform: none; transition: none; }
  .case .thumb img, .case:hover .thumb img {
    object-position: center top; transform: none; transition: none;
  }
}
