/* ─── TOKENS ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --ink: #181715;
  --paper: #f1eee8;
  --surface-deep: #171615;
  --surface-text: #181715;
  --surface-deep-text: #f1eee8;
  --red: #a8221b;
  --contact-red: #a8221b;
  --warm: #6d5c48;
  --warm-on-dark: #cec1ae;
  --line: rgba(24,23,21,.22);
  --line-inverse: rgba(241,238,232,.25);
  --hero-background: #e7e2d9;
  --hero-text: #181715;
  --hero-art-veil: rgba(231,226,217,.32);
  --hero-copy-veil-strong: rgba(231,226,217,.72);
  --hero-copy-veil: rgba(231,226,217,.44);
  --hero-copy-veil-clear: rgba(231,226,217,0);
  --hero-button-bg: #181715;
  --hero-button-text: #f1eee8;
  --menu-bg: #171615;
  --menu-text: #f1eee8;
  --menu-border: #504c45;
  --menu-accent: #f08076;
  --skip-bg: #a8221b;
  --focus: #7c281f;
  --focus-on-red: #fff;
  --focus-on-dark: #f0c687;
  --contact-emphasis: #ffe1da;
  --footer-text: #d0ccc4;
  --footer-link: #f1eee8;
  --work-basket: #716b62;
  --image-line-mark: #d9d4ca;
  --image-line-base: #888;
  --pattern-line: rgba(17,17,17,.22);
  --motion-spring: cubic-bezier(.2,.8,.2,1);
  --display: "Arial Narrow","Helvetica Neue",Arial,sans-serif;
  --body:    "Helvetica Neue",Helvetica,Arial,sans-serif;
  --shell:   min(1180px,calc(100% - 3rem));

  /* grain overlay — SVG noise baked as data URI */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.038'/%3E%3C/svg%3E");
}

@supports (transition-timing-function: linear(0, 1)) {
  :root { --motion-spring: linear(0, .015 10%, .08 22%, .25 38%, .52 58%, .78 75%, .95 88%, 1.015 96%, 1 100%) }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #eeeae2;
    --paper: #151514;
    --surface-deep: #0e0e0d;
    --surface-text: #eeeae2;
    --surface-deep-text: #eeeae2;
    --red: #df625a;
    --contact-red: #86221c;
    --warm: #c4b59f;
    --warm-on-dark: #c4b59f;
    --line: rgba(238,234,226,.22);
    --line-inverse: rgba(238,234,226,.25);
    --hero-background: #111110;
    --hero-text: #f1eee8;
    --hero-art-veil: rgba(17,17,16,.42);
    --hero-copy-veil-strong: rgba(17,17,16,.86);
    --hero-copy-veil: rgba(17,17,16,.52);
    --hero-copy-veil-clear: rgba(17,17,16,0);
    --hero-button-bg: #f1eee8;
    --hero-button-text: #181715;
    --menu-bg: #0e0e0d;
    --menu-text: #eeeae2;
    --menu-border: #514c43;
    --menu-accent: #df625a;
    --skip-bg: #86221c;
    --focus: #f0c687;
    --focus-on-red: #f0c687;
    --focus-on-dark: #f0c687;
    --contact-emphasis: #f1c7a2;
    --footer-text: #d5d1c9;
    --footer-link: #f1eee8;
    --work-basket: #5f574d;
    --image-line-mark: #77716a;
    --image-line-base: #42403c;
    --pattern-line: rgba(238,234,226,.22);
  }
}

/* ─── RESET ──────────────────────────────────────────────────────────────── */
*          { box-sizing: border-box }
html       { scroll-behavior: smooth }
body       { margin: 0; background: var(--paper); color: var(--ink);
             font-family: var(--body); font-size: 16px; line-height: 1.5 }
a          { color: inherit; text-decoration: none }
.shell     { width: var(--shell); margin-inline: auto }
.icon-sprite { position: absolute; overflow: hidden }
.arrow-icon {
  width: .85em;
  height: .85em;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -.05em;
  overflow: visible;
}

/* ─── SKIP LINK ──────────────────────────────────────────────────────────── */
.skip-link { position: absolute; left: 1rem; top: -5rem;
             background: var(--skip-bg); color: #fff; padding: .7rem 1rem; z-index: 20 }
.skip-link:focus { top: 1rem; outline: 3px solid #fff; outline-offset: 3px }

/* ─── HEADER ─────────────────────────────────────────────────────────────── */
.site-header { position: absolute; inset: 0 0 auto; z-index: 10; color: var(--hero-text) }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 1.75rem 0 }
.wordmark { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none }
.brand-logo {
  height: clamp(34px, 4.5vw, 44px);
  width: auto;
  max-width: 180px;
  display: block;
  object-fit: contain;
}
.site-nav  { display: flex; align-items: center; gap: 2rem;
             font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase }
.nav-contact { border-bottom: 1px solid var(--red); padding-bottom: .25rem; transition: opacity .16s ease-out }
.nav-contact:hover { opacity: .78 }
.menu-toggle { display: none; background: none; border: 0; color: inherit; font: inherit }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px }
.site-nav a:not(.nav-contact) { position: relative }
.site-nav a:not(.nav-contact)::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: .65rem;
  height: 1px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s var(--motion-spring);
}
.site-nav a:not(.nav-contact):hover::after,
.site-nav a:not(.nav-contact):focus-visible::after { transform: scaleX(1) }

/* ─── TYPOGRAPHY HELPERS ─────────────────────────────────────────────────── */
.eyebrow,
.work-meta { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase }

/* ─── HERO ───────────────────────────────────────────────────────────────── */
.hero {
  background: var(--hero-background);
  color: var(--hero-text);
  min-height: clamp(620px, 100vh, 1080px);
  min-height: clamp(620px, 100svh, 1080px);
  padding: 9rem 0 5rem;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Subtle grain over the woven hero backdrop. */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grain);
  pointer-events: none;
  opacity: .2;
}

.hero-grid {
  display: flex;
  align-items: flex-end;
  min-height: max(600px, calc(100vh - 14rem));
  min-height: max(600px, calc(100svh - 14rem));
  position: relative;
  z-index: 1;
}

.hero-copy  { position: relative; margin-top: auto; margin-bottom: clamp(1.5rem, 6vh, 4.5rem); max-width: 760px }

.hero h1,
.contact-section h2 {
  font: 700 clamp(4rem,9.5vw,10rem)/.84 var(--display);
  letter-spacing: -.075em;
  margin: 1.2rem 0 1.3rem;
  text-transform: uppercase;
}
.hero h1 em,
.contact-section h2 em { color: var(--red); font-style: normal }
.contact-section h2 em { color: var(--contact-emphasis) }

.hero-lede {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  max-width: 29rem;
  margin: 0 0 1.6rem;
  line-height: 1.55;
  color: var(--hero-text);
}

/* ─── BUTTON ─────────────────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  gap: 2rem;
  align-items: center;
  padding: 1rem 1.25rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: opacity .16s ease-out, transform .18s var(--motion-spring);
}
.button:hover { opacity: .86 }
.button:active { opacity: .82; transform: scale(.98) }
.button-light { background: var(--hero-button-bg); color: var(--hero-button-text) }

/* ─── HERO ART  ──────────────────────────────────────────────────────────── */
/* The authored responsive artwork stays decorative behind the live hero copy. */
.hero-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}

.hero-art-picture,
.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-art img { object-fit: cover; object-position: center }

.hero-art::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--hero-copy-veil-strong) 0%, var(--hero-copy-veil) 46%, var(--hero-copy-veil-clear) 80%),
    var(--hero-art-veil);
}

/* Progressive enhancement: let the woven field lag gently behind native scroll. */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-art {
      animation: weave-scroll-depth 1s linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 82vh;
    }
    @keyframes weave-scroll-depth {
      to { transform: translate3d(0, 1rem, 0) scale(1.015) }
    }
  }
}


/* ─── WEAVE PATTERNS (work cards, section accents) ───────────────────────── */
/* Plain weave — crisp grid for the red card */
.pattern-plain {
  background-color: var(--red);
  background-image:
    linear-gradient(90deg, rgba(0,0,0,.18) 2px, transparent 2px),
    linear-gradient(0deg,  rgba(0,0,0,.18) 2px, transparent 2px);
  background-size: 24px 24px;
}

/* 2/2 Twill — diagonal shift */
.pattern-twill {
  background-color: var(--paper);
  background-image:
    linear-gradient(135deg,
      var(--pattern-line) 0px 2px,
      transparent 2px 12px,
      var(--pattern-line) 12px 14px,
      transparent 14px 24px
    ),
    linear-gradient(45deg,
      var(--pattern-line) 0px 2px,
      transparent 2px 24px
    );
  background-size: 24px 24px;
}

/* Basket weave — alternating blocks */
.pattern-basket {
  background-color: var(--work-basket);
  background-image:
    repeating-linear-gradient(90deg,
      rgba(255,255,255,.45) 0 10px,
      transparent 10px 20px
    ),
    repeating-linear-gradient(0deg,
      rgba(255,255,255,.45) 0 10px,
      transparent 10px 20px
    );
  background-size: 20px 20px;
}

/* ─── SECTIONS ───────────────────────────────────────────────────────────── */
.section        { padding: 7rem 0 }
.section-light  { background: var(--paper); color: var(--surface-text) }
.section-black  { background: var(--surface-deep); color: var(--surface-deep-text) }

/* Linen grain on light sections */
.section-light::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grain);
  pointer-events: none;
  opacity: .4;
}
.section-light { position: relative }

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(12rem, 1fr);
  align-items: end;
  gap: clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-bottom: 4rem;
}
.heading-inverse { border-color: var(--line-inverse) }
.section-black .section-intro,
.section-black .work-meta { color: var(--warm-on-dark) }

h2 {
  font: 700 clamp(2.8rem,6vw,6rem)/.9 var(--display);
  letter-spacing: -.06em;
  text-transform: uppercase;
  margin: 0;
}
.section-intro { margin: 0; max-width: 16rem; color: var(--warm) }

/* ─── SERVICES ───────────────────────────────────────────────────────────── */
.service {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 2rem 0;
}
.service:last-child  { border-bottom: 1px solid var(--line) }
.service h3 { margin: 0 }

.service h3,
.work-card h3,
.process-list h3 {
  font: 700 clamp(1.4rem,2.4vw,2.2rem)/1 var(--display);
  letter-spacing: -.03em;
  text-transform: uppercase;
  margin: 0 0 .75rem;
}
.service p       { max-width: 28rem; margin: 0 }

/* ─── WORK GRID ──────────────────────────────────────────────────────────── */
.work-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 1rem }
.work-card-large { margin-top: 3rem }

.work-image {
  height: 320px;
  margin-bottom: 1.25rem;
  overflow: hidden;
  position: relative;
}
.work-card-large .work-image { height: 430px }

/* subtle grain on all work images */
.work-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grain);
  opacity: .5;
  pointer-events: none;
}

.work-meta { color: var(--warm); margin: 0 0 .35rem }
.work-card h3 { font-size: 1.35rem }
.work-card > p:not(.work-meta) {
  max-width: 26rem;
  margin: .65rem 0 0;
  color: var(--warm-on-dark);
  font-size: .95rem;
  line-height: 1.55;
}

/* ─── PROCESS ────────────────────────────────────────────────────────────── */
.process-list {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.process-list li { border-top: 1px solid var(--line); padding-top: 1rem }
.process-list p { max-width: 16rem; margin: 0 }

/* Herringbone rule between process items — rendered as a thin stripe */
.process-section {
  position: relative;
  overflow: hidden;
}
.process-section::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 4px;
  background-image:
    repeating-linear-gradient(45deg, var(--warm) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, var(--warm) 0 2px, transparent 2px 14px);
  background-size: 28px 28px;
  opacity: .45;
}

/* ─── CONTACT ────────────────────────────────────────────────────────────── */
.contact-section  { background: var(--contact-red); color: #fff; padding: 6rem 0; position: relative; overflow: hidden }
.contact-grid     { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: start }
.contact-section h2  { font-size: clamp(3.25rem,4vw,4rem); margin: 1.25rem 0 }
.contact-link {
  display: inline-block;
  border-bottom: 1px solid rgba(255,255,255,.6);
  padding-bottom: .35rem;
  font-size: 1.2rem;
  transition: border-color .18s ease-out, opacity .16s ease-out, transform .18s var(--motion-spring);
}
.contact-link:hover { border-color: #fff; opacity: .86 }
.contact-link:active { transform: translateY(1px) }
.contact-form {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 1rem;
}
.form-guidance,
.contact-note,
.form-field-wide,
.contact-status,
.contact-fallback { grid-column: 1 / -1 }
.form-guidance { margin: 0; color: #fff; font-size: .92rem }
.contact-note { margin: -.6rem 0 0; color: #fff; font-size: .88rem; line-height: 1.45 }
.form-field { min-width: 0 }
.form-field label {
  display: block;
  margin: 0 0 .45rem;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .035em;
}
.optional-label { font-weight: 400; letter-spacing: 0 }
.form-field input,
.form-field select,
.form-field textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  border: 1px solid #5a1510;
  border-radius: 0;
  padding: .72rem .8rem;
  background: #fff;
  color: #181715;
  font: inherit;
  line-height: 1.4;
}
.form-field textarea { min-height: 10rem; resize: vertical }
.form-field input::placeholder,
.form-field textarea::placeholder { color: #625b55; opacity: 1 }
.contact-submit {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 1.5rem;
  min-height: 3rem;
  border: 1px solid #fff;
  border-radius: 0;
  padding: .75rem 1rem;
  background: #fff;
  color: var(--contact-red);
  font: 700 .75rem/1.2 var(--body);
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .16s ease-out, transform .18s var(--motion-spring);
}
.contact-submit:hover { opacity: .88 }
.contact-submit:active { transform: scale(.98) }
.contact-submit:disabled { cursor: wait; opacity: .7 }
.contact-form[aria-busy="true"] .contact-submit { cursor: wait }
.contact-status { margin: 0; min-height: 1.5em; font-weight: 700 }
.contact-status:empty { display: none }
.contact-fallback { margin: .15rem 0 0; color: #fff }
.contact-fallback .contact-link { margin-left: .25rem; font-weight: 700 }
.form-trap {
  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;
}

@media (max-width: 900px) {
  .contact-grid { display: block }
  .contact-copy { margin-bottom: 2.5rem }
}

/* Wabi-sabi: ghost weave in contact background */
.contact-section::before {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 420px;
  height: 420px;
  background-image:
    repeating-linear-gradient(45deg,  rgba(255,255,255,.07) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.07) 0 2px, transparent 2px 18px);
  background-size: 36px 36px;
  pointer-events: none;
  transform: rotate(-6deg);
}

/* ─── WEAVE DIVIDER STRIP ────────────────────────────────────────────────── */
/* The thin woven band between hero and services — Swiss rule meets craft texture */
.weave-strip {
  line-height: 0;
  display: block;
}
.weave-strip svg { display: block }

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface-deep);
  color: var(--footer-text);
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 1.5rem 0;
}
.site-footer .shell { display: flex; justify-content: space-between; gap: 1rem }
.site-footer a { color: var(--footer-link) }

/* ─── FOCUS ──────────────────────────────────────────────────────────────── */
:focus-visible                      { outline: 3px solid var(--focus); outline-offset: 5px }
.site-header :focus-visible         { outline-color: var(--focus) }
.site-footer :focus-visible         { outline-color: var(--focus-on-dark) }
.contact-section :focus-visible     { outline-color: var(--focus-on-red) }

/* ─── MOBILE ─────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  :root { --shell: min(calc(100% - 2rem), 1180px) }
  .header-inner  { padding: 1.25rem 0 }
  .brand-logo    { height: clamp(28px, 6vw, 34px); max-width: 140px }
  .menu-toggle   { display: flex; align-items: center; gap: .7rem; min-height: 44px; padding: .5rem 0; cursor: pointer;
                   text-transform: uppercase; font-size: .75rem; font-weight: 700; letter-spacing: .1em }
  .menu-icon     { font-size: 1.5rem; line-height: .5; color: var(--menu-accent);
                   transform-origin: center; transition: transform .2s var(--motion-spring) }
  .menu-toggle[aria-expanded="true"] .menu-icon { transform: rotate(45deg) }
  .site-nav      { position: absolute; top: 4.5rem; left: 1rem; right: 1rem; padding: .5rem 1rem;
                   background: var(--menu-bg); color: var(--menu-text); flex-direction: column; align-items: flex-start;
                   gap: .5rem; border: 1px solid var(--menu-border) }
  .js-enabled .site-nav { display: flex; visibility: hidden; opacity: 0; pointer-events: none;
                          transform: translateY(-.35rem);
                          transition: opacity .16s ease-out, transform .2s var(--motion-spring), visibility 0s linear .2s }
  .js-enabled .site-nav.is-open { visibility: visible; opacity: 1; pointer-events: auto; transform: translateY(0);
                                  transition-delay: 0s }
  .hero          { padding-top: 7rem; min-height: 100vh; min-height: 100svh; }
  .hero-grid     { min-height: 620px }
  .hero-copy     { margin-bottom: 1.5rem; max-width: min(100%, 35rem); }
  .hero h1       { font-size: clamp(2.8rem,14vw,5.8rem) }
  .section       { padding: 4rem 0 }
  .section-heading { display: block; margin-bottom: 3rem }
  .section-heading h2 { margin: 0 0 1rem }
  .section-intro { max-width: 22rem }
  .service       { grid-template-columns: 1fr; gap: .65rem; padding: 1.5rem 0 }
  .service h3    { font-size: 1.4rem }
  .service p     { font-size: .9rem }
  .work-grid     { display: block }
  .work-card, .work-card-large { margin: 0 0 3rem }
  .work-image, .work-card-large .work-image { height: 260px }
  .process-list  { display: block }
  .process-list li { margin-bottom: 2.5rem }
  .contact-grid  { display: block }
  .contact-section { padding: 4rem 0 }
  .contact-section h2 { font-size: clamp(3.5rem,18vw,7rem) }
  .contact-form { grid-template-columns: 1fr; gap: 1rem }
  .site-footer .shell { flex-wrap: wrap }
  .site-footer a { width: 100% }
}

/* ─── REDUCED MOTION ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(24,23,21,.55);
    --line-inverse: rgba(241,238,232,.58);
  }
  :focus-visible { outline-width: 4px }
}

@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
  :root {
    --line: rgba(238,234,226,.58);
    --line-inverse: rgba(238,234,226,.62);
  }
}

@media (forced-colors: active) {
  .hero-art { display: none }
  .hero { background: Canvas; color: CanvasText }
  .site-header { color: CanvasText }
  .button-light { background: ButtonFace; color: ButtonText; border: 1px solid ButtonText }
  .skip-link { background: Highlight; color: HighlightText }
  :focus-visible { outline-color: Highlight }
}
