/* =========================================================
   Maggie Sy Interiors: design system
   Tokens are the single source of truth. Change a value here
   and it changes everywhere.
   ========================================================= */
:root {
  /* Color (approved palette) */
  --burgundy: #542333;   /* signature accent: buttons, links, labels, fine rules */
  --ivory: #F5F1EB;      /* page background */
  --stone: #E8E0D6;      /* soft fills, footer */
  --taupe: #C8BBAA;      /* borders, placeholders */
  --brown: #82766B;      /* secondary text (meets AA at body size on ivory) */
  --espresso: #292521;   /* primary text */
  --white: #FFFFFF;
  --line: #D9CFC3;

  /* Type: two families */
  --display: "Gilda Display", "Times New Roman", serif;          /* existing hero typeface, preserved */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;      /* editorial serif: headings, quotes, body */

  --fs-body: clamp(1.02rem, 0.98rem + 0.2vw, 1.14rem);
  --fs-small: 0.9rem;
  --fs-label: 0.86rem;
  --fs-h1: clamp(2.1rem, 1.6rem + 2vw, 3.4rem);
  --fs-h2: clamp(1.5rem, 1.25rem + 0.9vw, 2.1rem);
  --fs-h3: clamp(1.15rem, 1.05rem + 0.35vw, 1.35rem);
  --fs-quote: clamp(1.35rem, 1.15rem + 0.8vw, 1.85rem);

  /* Space */
  --gutter: clamp(20px, 5vw, 72px);
  --max: 1320px;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px;
  --section: clamp(80px, 11vw, 168px);
  --radius: 0;
  --header-h: 88px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--ivory); color: var(--espresso);
  font-family: var(--serif); font-size: var(--fs-body); line-height: 1.7;
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--burgundy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--espresso); }
:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--burgundy); color: var(--ivory); padding: 10px 14px; z-index: 10; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, .h1 { font-family: var(--display); font-weight: 400; font-size: var(--fs-h1); line-height: 1.04; letter-spacing: 0.01em; margin: 0; }
h2 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: var(--fs-h2); line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 var(--s3); }
h3 { font-family: var(--serif); font-weight: 500; font-size: var(--fs-h3); line-height: 1.25; margin: 0 0 var(--s1); }
p { margin: 0 0 1.1em; max-width: 64ch; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-top: var(--section); }
main > :last-child { padding-bottom: var(--section); }

/* Editorial label: small caps in burgundy, used for categories and locations only */
.label { font-family: var(--serif); font-size: var(--fs-label); font-variant-caps: all-small-caps; letter-spacing: 0.1em; color: var(--burgundy); margin: 0 0 var(--s1); }
.lead { font-size: clamp(1.08rem, 1.02rem + 0.25vw, 1.22rem); line-height: 1.55; max-width: 52ch; }
.muted { color: var(--brown); }

/* ---------- Header ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); height: var(--header-h); position: relative; }
.logo img { height: 46px; width: auto; }
.site-nav ul { list-style: none; display: flex; gap: clamp(18px, 2.6vw, 40px); margin: 0; padding: 0; }
.site-nav a { color: var(--espresso); text-decoration: none; font-size: 1.05rem; font-variant-caps: all-small-caps; letter-spacing: 0.12em; padding: 6px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--burgundy); border-bottom-color: var(--burgundy); }
.menu-btn { display: none; background: none; border: 0; padding: 12px 0 12px 12px; margin-right: -4px; cursor: pointer; color: var(--espresso); }
.menu-btn .bars { position: relative; display: block; width: 28px; height: 10px; }
.menu-btn .bars span { position: absolute; left: 0; width: 100%; height: 1.5px; background: currentColor; transition: transform .35s ease, top .35s ease; }
.menu-btn .bars span:first-child { top: 0; }
.menu-btn .bars span:last-child { top: 8.5px; }
.menu-btn[aria-expanded="true"] .bars span:first-child { top: 4.25px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars span:last-child { top: 4.25px; transform: rotate(-45deg); }
.menu-btn:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 2px; }
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; align-items: center; }
  .site-header { position: relative; }
  .logo img { height: 38px; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; height: calc(100dvh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain;
    background: var(--ivory); border-top: 1px solid var(--line); display: none; z-index: 5; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 12px var(--gutter) 40px; }
  .site-nav > ul > li { border-bottom: 1px solid var(--line); }
  .site-nav a { display: block; padding: 16px 0; font-size: 1.35rem; letter-spacing: 0.1em; border-bottom: 0 !important; }
  .site-nav a[aria-current="page"] { color: var(--burgundy); }
  .sub-nav { display: flex !important; position: static; border: 0 !important; background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; padding: 0 0 12px 20px !important; min-width: 0; }
  .sub-nav a { padding: 10px 0; font-size: 1.12rem; color: var(--brown); letter-spacing: 0.08em; }
  html.menu-open { overflow: hidden; }
  html.menu-open .header-bar { background: var(--ivory); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Photography ---------- */
figure { margin: 0; }
.ph img, .ph picture { width: 100%; height: 100%; }
.ph img { object-fit: cover; border-radius: var(--radius); }
.ph.bleed img { border-radius: 0; }
figcaption { font-size: var(--fs-small); color: var(--brown); margin-top: 10px; font-style: italic; }
.ar-wide { aspect-ratio: 3 / 2; }
.ar-tall { aspect-ratio: 4 / 5; }
.ar-pano { aspect-ratio: 2 / 1; }

/* ---------- Buttons & links ---------- */
.btn { display: inline-block; background: var(--burgundy); color: var(--ivory); text-decoration: none; font-family: var(--serif); font-size: 1.02rem; font-variant-caps: all-small-caps; letter-spacing: 0.12em; padding: 14px 28px; border: 1px solid var(--burgundy); }
.btn:hover { background: var(--espresso); border-color: var(--espresso); color: var(--ivory); }
.btn.ghost { background: transparent; color: var(--burgundy); }
.btn.ghost:hover { background: var(--burgundy); color: var(--ivory); }
.more { font-variant-caps: all-small-caps; letter-spacing: 0.1em; font-size: 1.05rem; }

/* ---------- Home: hero ---------- */
.hero { margin-top: calc(-1 * var(--header-h)); }
.hero-img { height: 100svh; min-height: 560px; max-height: 1080px; }
.hero-img .ph { height: 100%; }
.hero-copy { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s4) clamp(40px, 7vw, 120px); align-items: end; padding-top: clamp(40px, 6vw, 88px); }
.hero-copy .sub { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.2rem; color: var(--brown); margin: var(--s3) 0 0; }
.hero-copy .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: var(--s3); }
.loc { font-variant-caps: all-small-caps; letter-spacing: 0.12em; color: var(--burgundy); margin: 0 0 var(--s2); }

/* ---------- Home: philosophy (asymmetric) ---------- */
.phil { display: grid; grid-template-columns: 6fr 5fr; gap: var(--s5) clamp(40px, 8vw, 120px); align-items: center; }
.h-caps { font-family: var(--display); font-style: normal; text-transform: uppercase; letter-spacing: 0.06em; font-size: clamp(1.15rem, 1rem + 0.5vw, 1.45rem); line-height: 1.2; }

.pull { font-family: var(--serif); font-style: italic; font-size: var(--fs-quote); line-height: 1.25; color: var(--burgundy); max-width: 22ch; margin: 0 0 var(--s4); }

/* ---------- Home: selected work (editorial grid) ---------- */
.work-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(28px, 4vw, 56px) clamp(16px, 2.4vw, 32px); }
.work-grid .w7 { grid-column: span 7; }
.work-grid .w5 { grid-column: span 5; }
.work-grid .w5.drop { margin-top: clamp(0px, 10vw, 160px); }
.tile { text-decoration: none; color: var(--espresso); display: block; }
.tile h3 { margin-top: 16px; }
.tile:hover h3 { color: var(--burgundy); }
.tile:hover img { opacity: .92; }

/* ---------- Service list (rows, not cards) ---------- */
.svc-list { border-top: 1px solid var(--line); }
.svc-row { display: grid; grid-template-columns: 5fr 6fr 2fr; gap: 8px 40px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: baseline; text-decoration: none; color: var(--espresso); }
.svc-row h3 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem); margin: 0; }
.svc-row p { margin: 0; color: var(--brown); }
.svc-row .more { justify-self: end; color: var(--burgundy); }
.svc-row:hover h3 { color: var(--burgundy); }

/* ---------- About teaser ---------- */
.about-t { display: grid; grid-template-columns: 5fr 6fr; gap: var(--s5) clamp(40px, 8vw, 140px); align-items: center; }

/* ---------- Process ---------- */
.process { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 28px; counter-reset: s; }
.process li { counter-increment: s; border-top: 1px solid var(--espresso); padding-top: 18px; }
.process li::before { content: counter(s, decimal-leading-zero); display: block; font-family: var(--display); font-size: 1.6rem; color: var(--burgundy); margin-bottom: 10px; }
.process p { font-size: 0.98rem; }
.note { font-size: var(--fs-small); color: var(--brown); font-style: italic; margin-top: var(--s3); }

/* ---------- Closing ---------- */
.closing { text-align: center; }
.closing .pull { margin: 0 auto var(--s4); max-width: 20ch; }

/* ---------- Inner pages ---------- */
.page-head { padding-top: clamp(40px, 7vw, 104px); }
.page-head h1 { text-transform: uppercase; letter-spacing: 0.04em; font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.9rem); }
.page-head .lead { margin-top: var(--s3); }
.crumbs { font-size: var(--fs-small); color: var(--brown); margin-bottom: var(--s3); }
.crumbs a { color: var(--brown); }
.two-col { display: grid; grid-template-columns: 7fr 4fr; gap: var(--s5) clamp(40px, 7vw, 120px); align-items: start; }
.prose h2 { margin-top: var(--s5); font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem); }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.1em; margin: 0 0 1.2em; max-width: 62ch; }
.prose li { margin-bottom: 6px; }
.aside { border-top: 1px solid var(--espresso); padding-top: 18px; position: sticky; top: 24px; }
.aside ul { list-style: none; padding: 0; margin: 0 0 28px; }
.aside li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.aside a { text-decoration: none; }
.split { display: grid; grid-template-columns: 5fr 6fr; gap: var(--s5) clamp(40px, 7vw, 120px); align-items: start; }
.facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 6px 48px; margin: var(--s3) 0 0; }
.facts dt { font-variant-caps: all-small-caps; letter-spacing: 0.1em; color: var(--burgundy); font-size: var(--fs-label); }
.facts dd { margin: 0; }

/* Project list on Work page: one after another */
.project-list { display: flex; flex-direction: column; gap: clamp(64px, 8vw, 120px); }
.project-list .tile.portrait { max-width: 640px; }

/* Thumbnails + lightbox */
.thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: var(--s3); }
.thumbs.boards { grid-template-columns: repeat(4, 1fr); }
.thumb { padding: 0; border: 0; background: var(--stone); cursor: zoom-in; aspect-ratio: 1; overflow: hidden; border-radius: 0; }
.thumbs.boards .thumb { aspect-ratio: 16 / 10; background: var(--white); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumbs.boards .thumb img { object-fit: contain; }
.drawer { border-top: 1px solid var(--line); padding: 26px 0; }
.drawer:last-of-type { border-bottom: 1px solid var(--line); }
.drawer summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 24px; }
.drawer summary::-webkit-details-marker { display: none; }
.drawer-title { font-style: italic; font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.3rem); }
.drawer-count { color: var(--brown); font-size: var(--fs-small); white-space: nowrap; }
.drawer-count::after { content: "  +"; color: var(--burgundy); }
.drawer[open] .drawer-count::after { content: "  \2212"; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(41, 37, 33, 0.9); }
.lightbox img { max-width: 94vw; max-height: 84vh; margin: 0 auto; border-radius: 0; }
.lb-cap { color: var(--ivory); text-align: center; margin: 12px auto 0; font-style: italic; }
.lb-close { position: fixed; top: 14px; right: 18px; background: none; border: 0; color: var(--ivory); font-size: 2.4rem; cursor: pointer; line-height: 1; }

/* Gallery on project pages */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.4vw, 32px); }
.gallery .full { grid-column: 1 / -1; }

/* FAQ */
.faq { max-width: 860px; border-top: 1px solid var(--line); margin-top: var(--s4); }
.faq details { border-bottom: 1px solid var(--line); padding: 22px 0; }
.faq summary { font-style: italic; font-size: 1.35rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 24px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--burgundy); font-style: normal; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 14px 0 0; }

/* Form */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; margin-top: var(--s4); max-width: 860px; }
.form .full { grid-column: 1 / -1; }
.form label { display: block; font-variant-caps: all-small-caps; letter-spacing: 0.08em; font-size: 1.02rem; margin-bottom: 6px; }
.form .opt { color: var(--brown); }
.form input, .form select, .form textarea { width: 100%; font: inherit; color: var(--espresso); background: var(--white); border: 1px solid var(--taupe); border-radius: 0; padding: 12px 14px; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--burgundy); outline: 1px solid var(--burgundy); }
.form textarea { min-height: 170px; resize: vertical; }
.form .err { color: var(--burgundy); font-size: var(--fs-small); margin-top: 6px; display: none; }
.form .invalid .err { display: block; }
.form .invalid input, .form .invalid textarea { border-color: var(--burgundy); }
.hidden-field { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--stone); margin-top: 0; }
.footer-inner { display: grid; grid-template-columns: 4fr 2fr 2fr 3fr; gap: var(--s4); padding-top: var(--s5); padding-bottom: var(--s4); }
.footer-inner img { height: 40px; width: auto; margin-bottom: var(--s2); }
.footer-inner h2 { font-size: var(--fs-label); font-style: normal; font-variant-caps: all-small-caps; letter-spacing: 0.12em; color: var(--burgundy); margin: 0 0 10px; }
.footer-inner ul { list-style: none; padding: 0; margin: 0; }
.footer-inner li { margin-bottom: 6px; }
.footer-inner a { color: var(--espresso); text-decoration: none; }
.footer-inner a:hover { color: var(--burgundy); }
.footer-inner p { font-size: 0.98rem; color: var(--brown); }
.fine { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--taupe); padding-top: 18px; padding-bottom: 28px; font-size: var(--fs-small); color: var(--brown); }
.fine a { color: var(--brown); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-copy, .phil, .about-t, .two-col, .split { grid-template-columns: 1fr; }
  .phil .ph { margin-top: 0; }
  .work-grid .w7, .work-grid .w5 { grid-column: 1 / -1; }
  .work-grid .w5.drop { margin-top: 0; }
  .svc-row { grid-template-columns: 1fr; }
  .svc-row .more { justify-self: start; }
  .process { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .aside { position: static; }
  .thumbs { grid-template-columns: repeat(4, 1fr); }
  .thumbs.boards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .hero-img { height: 72svh; min-height: 420px; }
  .process, .form, .footer-inner, .gallery { grid-template-columns: 1fr; }
  .thumbs { grid-template-columns: repeat(3, 1fr); }
  .facts { grid-template-columns: 1fr; }
}
.portrait { width: 150px; height: auto; border-radius: 50%; aspect-ratio: 1; object-fit: cover; object-position: 50% 30%; margin-bottom: var(--s3); }

.headshot { margin: 0; align-self: start; position: sticky; top: var(--s4); }
.headshot img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 0; display: block; }
@media (max-width: 820px) { .headshot { position: static; max-width: 420px; } }

/* ---------- v3: uniform photo layouts ---------- */
.ar-port { aspect-ratio: 4 / 5; }
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 5vw, 72px) clamp(20px, 3vw, 40px); align-items: start; }
.tile .label { margin-top: 4px; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); margin-top: var(--s3); }
.gallery .thumb { aspect-ratio: 4 / 5; border-radius: var(--radius); background: var(--stone); }
.gallery .thumb picture, .gallery .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery.boards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery.boards .thumb { aspect-ratio: 16 / 10; background: var(--white); border: 1px solid var(--line); }
.gallery.boards .thumb img { object-fit: contain; padding: 10px; }
.thumb:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 3px; }

/* Work tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: var(--s4); }
.panel-intro { color: var(--brown); margin: 0 0 var(--s4); max-width: 60ch; }
.tab-panel[hidden] { display: none; }
.tab-panel + .tab-panel { margin-top: var(--section); }
.js .tab-panel + .tab-panel { margin-top: 0; }

/* Project pages */
.project-body { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s5) clamp(40px, 7vw, 110px); align-items: start; padding-top: var(--s5); }
.project-body .cover { position: sticky; top: var(--s4); }
.project-body .prose h2 { font-size: var(--fs-h3); font-style: normal; font-family: var(--display); text-transform: uppercase; letter-spacing: 0.06em; margin: var(--s4) 0 var(--s2); }
.project-body .prose h2:first-child { margin-top: 0; }
.services-line { margin-top: var(--s4); color: var(--brown); }
.project-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); border-top: 1px solid var(--line); padding-top: var(--s4); }
.project-next p { margin: 0; }

/* Work dropdown */
.site-nav .has-sub { position: relative; }
.sub-nav { list-style: none; margin: 0; padding: 10px 0; position: absolute; top: 100%; left: -18px; min-width: 180px; background: var(--ivory); border: 1px solid rgba(255,255,255,.6); border-radius: 0; display: none !important; flex-direction: column; gap: 0 !important; z-index: 10; }
.has-sub:hover .sub-nav, .has-sub:focus-within .sub-nav { display: flex !important; }
.sub-nav a { display: block; padding: 8px 18px; border: 0 !important; }
@media (max-width: 820px) {
  .sub-nav { display: flex !important; position: static; border: 0; background: none; padding: 0 0 6px 18px; min-width: 0; }
  .sub-nav a { padding: 8px 0; font-size: 1.05rem; }
}
@media (max-width: 960px) {
  .project-body { grid-template-columns: 1fr; }
  .project-body .cover { position: static; order: -1; max-width: 560px; }
}
@media (max-width: 700px) {
  .tile-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery.boards { grid-template-columns: 1fr; }
}

/* ---------- v4 ---------- */
html { scroll-padding-top: calc(var(--header-h) + 16px); }
@media (max-width: 820px) { :root { --header-h: 70px; } }

/* Liquid glass header, always visible */
.header-bar { position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(255,255,255,.62) 0%, rgba(245,241,235,.42) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(170%) brightness(1.04); backdrop-filter: blur(22px) saturate(170%) brightness(1.04);
  border-bottom: 1px solid rgba(255,255,255,.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -1px 0 rgba(41,37,33,.06), 0 10px 30px -12px rgba(41,37,33,.22); }
.header-bar::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.28) 48%, rgba(255,255,255,0) 66%); mix-blend-mode: soft-light; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .header-bar { background: rgba(245,241,235,.96); } }
.sub-nav { background: rgba(245,241,235,.78); -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); box-shadow: 0 14px 30px -14px rgba(41,37,33,.3); }

/* Home: philosophy text aligned to the photo's top and bottom edges */
.phil { align-items: stretch; }
.phil-text { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s4); }
.phil-text .pull { margin: 0; }
.phil-text p:last-child { margin-bottom: 0; }

/* Home: selected work, two equal, smaller tiles */
.tile-grid.compact { grid-template-columns: repeat(2, minmax(0, 380px)); }

/* Work pages: tab links */
.tabs a { padding: 12px 0; margin-right: 32px; margin-bottom: -1px; border-bottom: 2px solid transparent; text-decoration: none; font-size: 1.15rem; font-variant-caps: all-small-caps; letter-spacing: 0.12em; color: var(--brown); }
.tabs a[aria-current="page"] { color: var(--burgundy); border-bottom-color: var(--burgundy); }
.tabs a:hover { color: var(--espresso); }

/* Scroll reveal (homepage services) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }
@media (max-width: 700px) { .tile-grid.compact { grid-template-columns: 1fr; } }

@media (min-width: 961px) { .phil { grid-template-columns: 7fr 4fr; } }

/* ---------- v5: editorial project pages ---------- */
.work-intro { font-family: var(--serif); font-size: clamp(1.02rem, 0.98rem + 0.2vw, 1.14rem); line-height: 1.65; color: var(--brown); max-width: 58ch; margin: var(--s3) 0 0; }
.proj-title { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.04em; font-size: clamp(2rem, 1.4rem + 2.4vw, 3.6rem); line-height: 1.05; margin: var(--s2) 0 var(--s2); }
.proj-meta { font-variant-caps: all-small-caps; letter-spacing: 0.12em; color: var(--burgundy); margin: 0; font-size: 1rem; }
.proj-lead { font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.55rem); line-height: 1.4; color: var(--espresso); max-width: 34ch; margin: var(--s4) 0 0; }
.proj-intro { max-width: 56ch; margin: var(--s3) 0 0; }

.proj-open.wide { padding-top: clamp(40px, 6vw, 88px); }
.proj-open.wide .open-head { padding-bottom: clamp(28px, 4vw, 56px); }
.proj-open.wide .open-img .ed-fig { margin: 0; }
.proj-open.wide .open-img figcaption { max-width: var(--max); margin: 10px auto 0; padding: 0 var(--gutter); }
.proj-open.wide .open-intro { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s4) clamp(40px, 7vw, 110px); padding-top: clamp(40px, 6vw, 88px); }
.proj-open.wide .open-intro .proj-lead { margin-top: 0; }
.proj-open.wide .open-intro .proj-intro { margin-top: 6px; }

.proj-open.split { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s4) clamp(40px, 6vw, 100px); align-items: end; padding-top: clamp(40px, 6vw, 88px); }
.proj-open.split.img-right { grid-template-columns: 5fr 7fr; }
.proj-open.split.img-right .open-img { order: 2; }
.proj-open.split .open-img .ed-fig { margin: 0; max-width: 620px; }
.proj-open.split.img-right .open-img .ed-fig { margin-left: auto; }
.proj-open.split .open-text { padding-bottom: 40px; }

.ed-gallery { padding-top: clamp(64px, 8vw, 128px); padding-bottom: clamp(48px, 6vw, 96px); display: flex; flex-direction: column; gap: clamp(48px, 7vw, 112px); }
.ed-fig { margin: 0; }
.ed-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; aspect-ratio: auto; overflow: visible; }
.ed-btn picture, .ed-btn img { display: block; width: 100%; height: auto; }
.ed-fig figcaption { font-size: var(--fs-small); color: var(--brown); margin-top: 10px; font-style: italic; }
.ed-row { display: flex; gap: clamp(14px, 2vw, 28px); align-items: flex-start; }
.ed-asym { display: grid; grid-template-columns: 7fr 4fr; gap: clamp(20px, 4vw, 64px); align-items: start; }
.ed-asym > .ed-fig:last-child { margin-top: clamp(40px, 12vw, 200px); }
.ed-asym-r { display: grid; grid-template-columns: 4fr 7fr; gap: clamp(20px, 4vw, 64px); align-items: start; }
.ed-asym-r > .ed-fig:first-child { margin-top: clamp(40px, 12vw, 200px); }
.ed-single.single-r .ed-fig { margin-left: auto; }
.ed-single.single-l .ed-fig { margin-left: clamp(0px, 8vw, 120px); }
.ed-label { font-variant-caps: all-small-caps; letter-spacing: 0.14em; color: var(--burgundy); font-size: 1.05rem; margin: 0 0 calc(-1 * clamp(24px, 4vw, 72px)); border-top: 1px solid var(--line); padding-top: var(--s3); }
.ed-text { display: grid; grid-template-columns: 7fr 4fr; gap: var(--s4) clamp(40px, 7vw, 110px); padding: clamp(8px, 2vw, 24px) 0; }
.ed-text h2 { font-family: var(--serif); font-style: normal; font-variant-caps: all-small-caps; letter-spacing: 0.12em; font-size: 1.05rem; color: var(--burgundy); margin: var(--s4) 0 var(--s1); }
.ed-text h2:first-child { margin-top: 0; }
.ed-story p, .ed-story ul { max-width: 60ch; }
.ed-materials { border-left: 1px solid var(--line); padding-left: clamp(20px, 3vw, 40px); }
.ed-materials ul { list-style: none; padding: 0; margin: 0; }
.ed-materials li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.ed-gallery .services-line { margin: 0; }

.proj-foot { padding-top: 0; }
.proj-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: var(--s3); border-top: 1px solid var(--line); padding-top: var(--s4); }
.proj-nav .label { display: block; }
.proj-nav a { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--espresso); text-decoration: none; }
.proj-nav a:hover { color: var(--burgundy); }
.proj-nav .center a { font-style: normal; font-size: 1.05rem; }
.proj-nav .right { text-align: right; }
.invite { text-align: center; padding: clamp(80px, 10vw, 150px) var(--gutter); }
.invite-line { font-family: var(--serif); font-style: italic; font-size: var(--fs-quote); color: var(--burgundy); margin: 0 0 8px; }
.invite .muted { margin: 0 0 var(--s4); }

/* Interior Design / E-design: titles on hover */
.hover-grid { columns: 3; column-gap: clamp(14px, 2vw, 28px); }
.hover-grid.boards { columns: 2; }
.ht { display: block; width: 100%; break-inside: avoid; margin: 0 0 clamp(14px, 2vw, 28px); padding: 0; border: 0; background: none; cursor: zoom-in; aspect-ratio: auto; overflow: visible; text-align: left; }
.ht-img { position: relative; display: block; overflow: hidden; }
.ht-img picture, .ht-img img { display: block; width: 100%; height: auto; }
.hover-grid.boards .ht-img { background: var(--white); border: 1px solid var(--line); }
.ht-over { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: clamp(16px, 2vw, 24px);
  background: linear-gradient(to top, rgba(41,37,33,.62) 0%, rgba(41,37,33,.22) 55%, rgba(41,37,33,.08) 100%);
  opacity: 0; transition: opacity .45s ease; }
.ht-title { font-family: var(--serif); font-style: italic; font-size: clamp(1.15rem, 1rem + 0.5vw, 1.5rem); color: var(--ivory); line-height: 1.2; transform: translateY(6px); transition: transform .45s ease; }
.ht:hover .ht-over, .ht:focus-visible .ht-over { opacity: 1; }
.ht:hover .ht-title, .ht:focus-visible .ht-title { transform: none; }
.ht:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 3px; }
.ht-cap { display: none; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--espresso); margin-top: 8px; }
@media (hover: none) { .ht-over { display: none; } .ht-cap { display: block; } }
@media (prefers-reduced-motion: reduce) { .ht-over, .ht-title { transition: none; } }

/* E-design feature: One Room, Four Directions */
.fd-feature { display: grid; grid-template-columns: 7fr 4fr; gap: var(--s4) clamp(32px, 5vw, 80px); align-items: end; text-decoration: none; color: var(--espresso); margin-bottom: clamp(64px, 8vw, 120px); }
.fd-mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: var(--white); border: 1px solid var(--line); padding: 10px; }
.fd-cell picture, .fd-cell img { display: block; width: 100%; height: auto; }
.fd-text { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.fd-title { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.04em; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.5rem); line-height: 1.08; }
.fd-sub { color: var(--brown); max-width: 34ch; }
.fd-feature:hover .fd-title { color: var(--burgundy); }
.ed-more { margin-bottom: var(--s4); }
.fd-boards { display: flex; flex-direction: column; gap: clamp(64px, 9vw, 140px); padding-top: clamp(48px, 6vw, 96px); padding-bottom: clamp(48px, 6vw, 96px); }
.fd-dir { max-width: 1200px; }
.fd-dir:nth-child(even) { margin-left: auto; }
.fd-label { font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.2rem); margin: 0 0 var(--s2); }
.fd-dir .ed-btn { background: var(--white); border: 1px solid var(--line); padding: clamp(8px, 1.2vw, 16px); }

@media (max-width: 960px) {
  .proj-open.split, .proj-open.split.img-right, .proj-open.wide .open-intro, .ed-text, .fd-feature { grid-template-columns: 1fr; }
  .proj-open.split.img-right .open-img { order: 0; }
  .proj-open.split .open-text { padding-bottom: 0; }
  .ed-materials { border-left: 0; padding-left: 0; }
  .hover-grid { columns: 2; }
}
@media (max-width: 700px) {
  .ed-row, .ed-asym, .ed-asym-r { display: flex; flex-direction: column; gap: 28px; }
  .ed-row > .ed-fig { flex: none !important; width: 100%; }
  .ed-asym > .ed-fig:last-child, .ed-asym-r > .ed-fig:first-child { margin-top: 0; }
  .ed-single .ed-fig { width: 100% !important; margin-left: 0 !important; }
  .hover-grid, .hover-grid.boards { columns: 1; }
  .proj-nav { grid-template-columns: 1fr 1fr; }
  .proj-nav .center { grid-column: 1 / -1; order: 3; }
}

.ed-label { max-width: none; }
.invite p { margin-left: auto; margin-right: auto; }

.ed-row { margin-left: auto; margin-right: auto; width: 100%; }
.ed-row .ed-fig figcaption { min-height: 1.4em; }
@media (max-width: 700px) { .ed-row { max-width: none !important; } }

.invite .muted { margin: 0 auto var(--s4); }
@media (max-width: 700px) { .ht-over { display: none; } .ht-cap { display: block; } }
.tabs { flex-wrap: wrap; column-gap: 0; }
.tabs a { white-space: nowrap; }
@media (max-width: 700px) { .tabs a { margin-right: 20px; font-size: 1.05rem; } }
.fd-dir figcaption { display: none; }

/* ---------- v6: phones ---------- */
.m-only { display: none; }
h1, h2, h3, .proj-title { overflow-wrap: normal; word-break: normal; hyphens: none; }
@media (max-width: 960px) {
  .project-body .cover { order: 0; }   /* service pages: content first, then photo and other services */
}
@media (max-width: 700px) {
  :root { --section: clamp(56px, 14vw, 80px); }
  .m-only { display: revert; }
  li.m-only { display: list-item; }
  .d-only { display: none !important; }

  /* Homepage */
  .hero-copy .loc span { display: block; }
  .hero-copy .loc .sep { display: none; }
  .hero-copy .actions .btn { flex: 1 1 100%; text-align: center; }
  .phil { gap: var(--s4); }
  .phil-text { display: block; }
  .phil-text > div { margin-top: var(--s3); }
  .tile-grid, .tile-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  .tile h3 { font-size: 1.02rem; line-height: 1.3; margin-top: 10px; }
  .tile .label { font-size: 0.82rem; line-height: 1.4; }

  /* Project pages: pairs and asymmetric rows stay side by side */
  .ed-gallery { gap: 36px; padding-top: 48px; padding-bottom: 40px; }
  .ed-row, .ed-asym, .ed-asym-r { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px !important; }
  .ed-row > .ed-fig, .ed-asym > .ed-fig, .ed-asym-r > .ed-fig { flex: var(--r) 1 0 !important; width: auto !important; margin: 0 !important; min-width: 0; }
  .ed-fig figcaption { font-size: 0.78rem; line-height: 1.35; margin-top: 6px; }
  .ed-label { margin-bottom: -16px; }
  .proj-open.wide { padding-top: 32px; }
  .proj-open.split { padding-top: 32px; gap: 24px; }
  .proj-lead { margin-top: 20px; }
  .fd-boards { gap: 48px; }

  /* Footer: compact */
  .footer-inner { grid-template-columns: 1fr; gap: 20px; padding-top: 40px; padding-bottom: 20px; }
  .footer-inner h2 { display: none; }
  .f-studio ul { display: flex; flex-wrap: wrap; gap: 0 22px; }
  .f-studio li { margin: 0; }
  .f-area p { margin: 0 0 4px; }

  /* Type */
  .label, .proj-meta, .ed-label, .tabs a, .btn, .footer-inner h2, .hero-copy .loc, .fd-text .label { letter-spacing: 0.08em; }
  .page-head h1, .proj-title { font-size: clamp(1.75rem, 1.2rem + 3vw, 2.2rem); letter-spacing: 0.03em; }

  /* Tap targets */
  .footer-inner a, .more, .crumbs a, .proj-nav a, .fine a { display: inline-block; padding-top: 11px; padding-bottom: 11px; }
  .btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; }
  .form button[type="submit"], .form .btn { width: 100%; }
  .svc-row { padding-top: 22px; padding-bottom: 22px; }

  /* Work tabs on one line */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { margin-right: 18px; font-size: 0.98rem; padding: 14px 0; flex: none; }

  /* Previous / next */
  .proj-nav { grid-template-columns: 1fr 1fr; gap: 8px 16px; }
  .proj-nav .center { grid-column: 1 / -1; order: 3; text-align: center; }
  .proj-nav a { font-size: 1.08rem; }
}
.menu-btn { min-height: 44px; min-width: 44px; justify-content: flex-end; }
.logo { display: inline-block; padding: 4px 0; }
@media (max-width: 700px) {
  .ed-row:has(> .ed-fig:nth-child(3)) { flex-wrap: wrap !important; }
  .ed-row:has(> .ed-fig:nth-child(3)) > .ed-fig { flex: 1 1 calc(50% - 5px) !important; }
  .ed-fig figcaption { overflow-wrap: break-word; }
}
@media (max-width: 820px) {
  .site-nav .has-sub > a { padding-bottom: 6px; }
  .sub-nav { padding: 0 0 14px 20px !important; }
  .sub-nav a { padding: 9px 0; }
}
