/* frame theory — warm minimal */
:root {
  --ivory: #f4efe6;
  --ivory-deep: #ece3d0;
  --card: #faf7ef;
  --ink: #2b2620;
  --muted: #6f6455;
  --tan: #c9a87f;
  --tan-dark: #b8946a;
  --hairline: #dcd2bd;
  --white: #fffdf8;
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
h1, h2, h3 { font-weight: 300; letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 0.5em; }
h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
p { margin: 0 0 1em; }
a { color: inherit; }

.wrap { width: min(1200px, 100% - 3rem); margin-inline: auto; }
.lede { color: var(--muted); font-size: 1.06rem; max-width: 34rem; }

/* Skip link */
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--ink); color: var(--ivory);
  padding: 0.75rem 1.25rem; border-radius: 999px; text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

/* Focus */
:focus-visible {
  outline: 3px solid var(--tan-dark);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.85rem 2.25rem;
  font-family: var(--font); font-size: 0.95rem; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.btn-pill { border-radius: 999px; }
.btn-tan { background: var(--tan); color: var(--ink); }
.btn-tan:hover { background: var(--tan-dark); }
.btn-dark { background: var(--ink); color: var(--ivory); }
.btn-dark:hover { background: #453d32; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--ivory); }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--ivory) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--hairline); }
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark {
  font-size: 1.35rem; font-weight: 400; letter-spacing: -0.02em;
  text-decoration: none; white-space: nowrap;
}
.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav ul { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.site-nav a:not(.btn) { text-decoration: none; font-size: 1rem; color: var(--ink); }
.site-nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }
.site-nav .btn { min-height: 44px; padding: 0.6rem 1.6rem; }
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 7px;
  width: 48px; height: 48px; background: none; border: 0; cursor: pointer; padding: 12px;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--ink); transition: transform 0.3s ease, opacity 0.3s ease; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--white);
  isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(30,24,16,0.28), rgba(30,24,16,0.18) 45%, rgba(30,24,16,0.42));
}
.hero-content { padding-top: var(--header-h); }
.hero h1 {
  font-size: clamp(2.75rem, 8vw, 6rem);
  color: var(--white); text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0,0,0,0.25);
}
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.3rem); color: #f3ede0; margin: 0.75rem auto 2rem; max-width: 36rem; }
.hero .btn-tan { font-size: 1rem; padding: 1rem 2.75rem; }

/* Sections */
.services, .work, .process, .brief { padding: clamp(4rem, 9vw, 7.5rem) 0; }
.work { background: var(--card); }
.process { background: var(--ivory-deep); }

/* Services */
.services-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.services-copy .btn { margin-top: 1.75rem; }
.services-media img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(43,38,32,0.12);
}
.accordion { margin-top: 2rem; border-top: 1px solid var(--hairline); }
.accordion-item { border-bottom: 1px solid var(--hairline); }
.accordion-item h3 { margin: 0; }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 64px; padding: 1.1rem 0.25rem;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font); font-size: 1.35rem; font-weight: 400; letter-spacing: -0.01em; color: var(--ink);
  text-align: left;
}
.accordion-icon { position: relative; flex: 0 0 22px; height: 22px; }
.accordion-icon::before, .accordion-icon::after {
  content: ""; position: absolute; top: 50%; left: 50%; background: var(--ink);
  transform: translate(-50%, -50%); transition: transform 0.3s ease, opacity 0.3s ease;
}
.accordion-icon::before { width: 18px; height: 2px; }
.accordion-icon::after { width: 2px; height: 18px; }
.accordion-trigger[aria-expanded="true"] .accordion-icon::after { opacity: 0; transform: translate(-50%, -50%) rotate(90deg); }
.accordion-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s ease; }
.accordion-panel[hidden] { display: none; }
.accordion-panel > p { overflow: hidden; margin: 0; color: var(--muted); max-width: 32rem; }
.accordion-item.open .accordion-panel { grid-template-rows: 1fr; }
.accordion-item.open .accordion-panel > p { padding: 0 0.25rem 1.4rem; }

/* Portfolio */
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.75rem 0 2.25rem; }
.filter-btn {
  min-height: 44px; padding: 0.55rem 1.4rem; border-radius: 999px;
  border: 1px solid var(--hairline); background: transparent; cursor: pointer;
  font-family: var(--font); font-size: 0.92rem; color: var(--ink);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.filter-btn:hover { border-color: var(--ink); }
.filter-btn.is-active { background: var(--ink); border-color: var(--ink); color: var(--ivory); }
.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.work-item { margin: 0; transition: opacity 0.3s ease, transform 0.3s ease; }
.work-item[hidden] { display: none; }
.work-open {
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  border-radius: var(--radius); overflow: hidden; background: var(--ivory-deep);
}
.work-open img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover;
  transition: transform 0.5s ease;
}
.work-open:hover img { transform: scale(1.04); }
.work-item figcaption {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem;
  padding: 0.7rem 0.15rem 0; font-size: 0.95rem;
}
.work-item figcaption em { font-style: normal; color: var(--muted); font-size: 0.85rem; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(28,23,17,0.92); }
.lightbox-figure { position: relative; margin: 0; max-width: min(92vw, 1100px); max-height: 86vh; }
.lightbox-figure img {
  max-width: 100%; max-height: 78vh; object-fit: contain;
  border-radius: 8px; background: #1c1711;
}
.lightbox-figure figcaption { color: #f3ede0; text-align: center; padding-top: 0.9rem; font-size: 1rem; }
.lightbox-btn {
  position: absolute; z-index: 2;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(243,237,224,0.35); background: rgba(28,23,17,0.55); color: #f3ede0;
  font-size: 1.6rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.25s ease;
  touch-action: manipulation;
}
.lightbox-btn:hover { background: rgba(28,23,17,0.85); }
.lightbox-close { top: 1.25rem; right: 1.25rem; }
.lightbox-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.25rem; top: 50%; transform: translateY(-50%); }

/* Process */
.process-grid {
  list-style: none; margin: 2.5rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
}
.process-grid li { border-top: 1px solid var(--hairline); padding-top: 1.25rem; }
.process-num { font-size: 0.9rem; letter-spacing: 0.15em; color: var(--tan-dark); font-weight: 500; }
.process-grid h3 { font-size: 1.4rem; margin: 0.5rem 0; }
.process-grid p { color: var(--muted); font-size: 0.98rem; margin: 0; }

/* Brief builder */
.brief-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-weight: 500; font-size: 0.95rem; margin-bottom: 0.45rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.85rem 1.1rem; min-height: 52px;
  font-family: var(--font); font-size: 1rem; color: var(--ink);
  background: var(--white); border: 1px solid var(--hairline); border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { min-height: 132px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--tan-dark); box-shadow: 0 0 0 3px rgba(201,168,127,0.25);
}
.preview-heading { font-size: 1.25rem; margin-bottom: 1rem; }
.brief-preview-wrap { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.brief-preview {
  background: var(--white); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 1.75rem; min-height: 320px; white-space: pre-wrap; font-size: 0.98rem;
}
.brief-preview h4 { margin: 0 0 0.75rem; font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em; }
.brief-preview .bp-row { margin-bottom: 0.5rem; }
.brief-preview .bp-label { font-weight: 600; }
.brief-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.brief-status { min-height: 1.5em; color: var(--tan-dark); font-size: 0.92rem; margin-top: 0.75rem; }

/* Footer */
.site-footer { background: var(--ink); color: #ece4d2; padding: 4rem 0 2.5rem; }
.footer-inner { display: flex; flex-direction: column; gap: 1.25rem; }
.site-footer .wordmark { color: #f4efe6; }
.footer-contact { margin: 0; }
.footer-contact a { color: var(--tan); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.footer-nav a { text-decoration: none; color: #ece4d2; }
.footer-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-copy { margin: 1rem 0 0; font-size: 0.88rem; color: #a89a83; }

/* Responsive */
@media (max-width: 960px) {
  .services-grid { grid-template-columns: 1fr; }
  .services-media img { aspect-ratio: 16/10; }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .brief-grid { grid-template-columns: 1fr; }
  .brief-preview-wrap { position: static; }
}
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ivory); border-bottom: 1px solid var(--hairline);
    padding: 0.5rem 1.5rem 1.5rem;
    transform: translateY(-130%); visibility: hidden;
    transition: transform 0.35s ease, visibility 0.35s ease;
    box-shadow: 0 24px 40px rgba(43,38,32,0.12);
  }
  .site-nav.is-open { transform: translateY(0); visibility: visible; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: 0.9rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--hairline); }
  .site-nav .btn { margin-top: 1.25rem; width: 100%; }
}
@media (max-width: 560px) {
  .portfolio-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .lightbox-prev { left: 0.6rem; }
  .lightbox-next { right: 0.6rem; }
  .wrap { width: calc(100% - 2.5rem); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
