/* ==========================================================================
   Aldern & Rowe — concept site by Ashvane
   Concrete greys and charcoal, warm oak as the single accent.
   A drawing-set feel: strict left-aligned grid, figure numbers,
   spec tables, hairlines. Archivo for everything; Newsreader italic
   only for pull-quotes.
   ========================================================================== */

:root {
  --paper: #EDECE9;
  --concrete: #DEDCD7;
  --charcoal: #1F2022;
  --graphite: #45474A;
  --grey: #5E6063;           /* secondary text, AA on paper */
  --oak: #B4874F;            /* rules, handle, active states */
  --oak-text: #7A5528;       /* oak for small text */
  --line: rgba(31, 32, 34, 0.16);
  --line-strong: rgba(31, 32, 34, 0.7);

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", Georgia, serif;

  --max: 1360px;
  --gut: clamp(20px, 4vw, 48px);
  --col-gap: clamp(16px, 2vw, 28px);
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--charcoal);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--oak-text); outline-offset: 2px; }
::selection { background: var(--oak); color: var(--charcoal); }

.shell { width: min(100% - 2 * var(--gut), var(--max)); margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
.grid > * { grid-column: 1 / -1; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: 8px; z-index: 60; padding: 8px 12px;
  background: var(--charcoal); color: var(--paper); transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Type ---------- */
.label {
  font-size: 0.72rem;
  font-weight: 500;
  font-stretch: 85%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
}
.num { font-weight: 500; font-stretch: 85%; color: var(--oak-text); letter-spacing: 0.04em; }
h1, .h1 {
  font-size: clamp(2.4rem, 5.6vw, 5.2rem);
  font-weight: 600;
  font-stretch: 90%;
  line-height: 0.98;
  letter-spacing: -0.025em;
}
h2, .h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 600;
  font-stretch: 92%;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h3, .h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.005em; line-height: 1.3; }
.intro { font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.45; color: var(--graphite); }
.muted { color: var(--grey); }
.quote {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.7rem, 3.2vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.quote + .label { margin-top: 18px; }

/* ---------- Links and buttons ---------- */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}
.arrow-link::after { content: "\2192"; transition: transform 0.35s var(--ease); }
.arrow-link:hover::after, .arrow-link:focus-visible::after { transform: translateX(4px); }
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  border: 0; border-radius: 0;
  background: var(--charcoal); color: var(--paper);
  font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color 0.3s var(--ease);
}
.btn::after { content: "\2192"; }
.btn:hover, .btn:focus-visible { background: var(--graphite); }

/* ---------- Concept bar ---------- */
.concept-bar {
  background: var(--charcoal);
  color: rgba(237, 236, 233, 0.78);
  font-size: 0.78rem;
  padding: 7px var(--gut);
}
.concept-bar a { color: var(--paper); }

/* ---------- Header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(237, 236, 233, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-head .shell { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.logo { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.logo strong { font-size: 1.15rem; font-weight: 600; font-stretch: 88%; letter-spacing: -0.01em; }
.logo span { font-size: 0.7rem; font-stretch: 85%; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey); }
.site-nav ul { display: flex; gap: clamp(20px, 3vw, 40px); }
.site-nav a {
  position: relative;
  display: block;
  padding: 20px 0;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--graphite);
}
.site-nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--oak);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.site-nav a:hover::after, .site-nav a:focus-visible::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--charcoal); }
.nav-toggle {
  display: none;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: none;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}
@media (max-width: 640px) {
  .logo span { display: none; }
  .js .nav-toggle { display: block; }
  .js .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--line); }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; gap: 0; padding: 0 var(--gut) 12px; }
  .js .site-nav a { padding: 14px 0; border-top: 1px solid var(--line); font-size: 1.1rem; }
  .js .site-nav a::after { display: none; }
  .js .site-nav a[aria-current="page"] { color: var(--oak-text); }
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section--concrete { background: var(--concrete); }
.section--dark { background: var(--charcoal); color: var(--paper); }
.section--dark .label, .section--dark .muted { color: rgba(237, 236, 233, 0.7); }
.section--dark .num { color: var(--oak); }
.rule-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-top: 14px; margin-bottom: clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--line-strong);
}
.section--dark .rule-head { border-top-color: rgba(237, 236, 233, 0.5); }

/* ---------- Home hero ---------- */
.hero { padding: clamp(40px, 6vw, 72px) 0 0; }
.hero .grid { row-gap: 32px; align-items: end; }
.hero__text h1 { margin-top: 20px; }
.hero__text .intro { margin-top: 28px; max-width: 34rem; }
.hero__text .links { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.hero__fig img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
@media (min-width: 900px) {
  .hero__text { grid-column: 1 / span 6; padding-bottom: clamp(24px, 4vw, 56px); }
  .hero__fig { grid-column: 7 / -1; }
}

/* Figure captions: "Fig. 01  Description" */
.fig figcaption {
  display: flex; gap: 14px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--grey);
}
.fig figcaption b { font-weight: 500; font-stretch: 85%; color: var(--oak-text); white-space: nowrap; }

/* ---------- Facts strip ---------- */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.facts div { padding: 18px 16px 18px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 600; font-stretch: 88%; letter-spacing: -0.02em; line-height: 1; }
.facts dd { margin-top: 8px; font-size: 0.85rem; color: var(--grey); }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Project rows (home) ---------- */
.project-row {
  display: grid;
  gap: 20px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.project-row:last-child { border-bottom: 1px solid var(--line); }
.project-row img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: filter 0.4s var(--ease); }
.project-row h3 { font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 600; font-stretch: 90%; letter-spacing: -0.02em; line-height: 1.05; }
.project-row p { margin-top: 12px; color: var(--graphite); max-width: 34rem; }
.project-row .meta { margin-top: 16px; }
.project-row:hover h3, .project-row:focus-visible h3 { text-decoration: underline; text-decoration-color: var(--oak); text-decoration-thickness: 2px; text-underline-offset: 6px; }
@media (min-width: 860px) {
  .project-row { grid-template-columns: 4rem 5fr 6fr; gap: var(--col-gap); align-items: start; }
}

@media (min-width: 900px) {
  .studio-fig { grid-column: 1 / span 6; }
  .studio-teaser { grid-column: 8 / -1; }
}
address { font-style: normal; }

/* ---------- Projects index ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px 0;
  border: 1px solid var(--line-strong);
  width: fit-content;
  max-width: 100%;
  margin-bottom: 16px;
}
.filter-bar button {
  display: flex; align-items: baseline; gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: transparent;
  font-size: 0.9rem; font-weight: 500;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.filter-bar button:last-child { border-right: 0; }
.filter-bar button sup { font-size: 0.7rem; color: var(--grey); top: 0; }
.filter-bar button:hover { background: var(--concrete); }
.filter-bar button[aria-pressed="true"] { background: var(--charcoal); color: var(--paper); }
.filter-bar button[aria-pressed="true"] sup { color: var(--oak); }
@media (max-width: 560px) {
  .filter-bar { width: 100%; display: grid; grid-template-columns: 1fr 1fr; border-right: 0; }
  .filter-bar button { border-bottom: 1px solid var(--line-strong); }
  .filter-bar button:nth-child(2n) { border-right: 1px solid var(--line-strong); }
}
.filter-note { font-size: 0.85rem; color: var(--grey); margin-bottom: 40px; }

.index { display: grid; gap: 48px var(--col-gap); grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 640px) { .index { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .index { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.index li[hidden] { display: none; }
.card { display: block; text-decoration: none; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--concrete); }
.card .top { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0 8px; border-bottom: 1px solid var(--line); }
.card h2 { margin-top: 12px; font-size: 1.35rem; font-stretch: 92%; letter-spacing: -0.015em; }
.card p { margin-top: 6px; font-size: 0.95rem; color: var(--graphite); }
.card .more { display: inline-block; margin-top: 12px; font-size: 0.85rem; font-weight: 500; }
a.card:hover h2, a.card:focus-visible h2 { text-decoration: underline; text-decoration-color: var(--oak); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.card .no-page { color: var(--grey); font-weight: 400; }

/* ---------- Case study ---------- */
.case-head { padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 4vw, 48px); }
.case-head .grid { row-gap: 32px; }
.case-head h1 { margin-top: 16px; }
.case-head .intro { margin-top: 24px; }
@media (min-width: 960px) {
  .case-head__title { grid-column: 1 / span 7; }
  .case-head__spec { grid-column: 9 / -1; align-self: end; }
}
.spec { border-top: 1px solid var(--line-strong); }
.spec div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.spec dt { color: var(--grey); }

.lead-fig img { width: 100%; max-height: 82vh; object-fit: cover; }

.case-body { row-gap: clamp(40px, 6vw, 72px); }
.case-block { display: grid; gap: 12px; }
.case-block h2 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.case-block p { color: var(--graphite); max-width: 40rem; }
.case-block h2 + p { margin-top: 14px; }
.case-block p + p { margin-top: 12px; }
@media (min-width: 960px) {
  .case-block { grid-column: 1 / -1; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .case-block > .label { grid-column: 1 / span 2; padding-top: 8px; }
  .case-block > div { grid-column: 4 / span 7; }
}

.pair { display: grid; gap: var(--col-gap); }
.pair img { width: 100%; object-fit: cover; }
@media (min-width: 760px) {
  .pair { grid-template-columns: 5fr 7fr; align-items: end; }
  .pair--even { grid-template-columns: 1fr 1fr; }
}

.pullquote { padding: clamp(48px, 7vw, 96px) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pullquote blockquote { margin: 0; max-width: 46rem; }

.next-wrap { padding: 48px 0 96px; }
.next-project {
  display: flex; justify-content: space-between; align-items: end; gap: 24px;
  padding: 32px 0; border-top: 1px solid var(--line-strong); text-decoration: none;
}
.next-project strong { display: block; margin-top: 6px; font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 600; font-stretch: 90%; letter-spacing: -0.02em; line-height: 1.05; }
.next-project:hover strong, .next-project:focus-visible strong { text-decoration: underline; text-decoration-color: var(--oak); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---------- Before / after slider ----------
   A drawing-office treatment: a hard charcoal cut line with an oak
   tab carrying a live percentage. The range input on top does the
   work, so keyboard and screen reader users get the native control. */
.compare { --pos: 50%; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--concrete); user-select: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare .cut {
  position: absolute; top: 0; bottom: 0; left: var(--pos);
  width: 2px; margin-left: -1px;
  background: var(--charcoal);
  pointer-events: none;
}
.compare .tab {
  position: absolute; top: 50%; left: 50%;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px;
  background: var(--oak); color: var(--charcoal);
  font-size: 0.78rem; font-weight: 600; font-stretch: 85%;
  letter-spacing: 0.04em;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.compare .tab::before, .compare .tab::after { content: ""; border: 5px solid transparent; }
.compare .tab::before { border-right-color: var(--charcoal); border-left-width: 0; }
.compare .tab::after { border-left-color: var(--charcoal); border-right-width: 0; }
.compare .tag {
  position: absolute; top: 12px;
  padding: 4px 8px;
  background: rgba(31, 32, 34, 0.82); color: var(--paper);
  font-size: 0.72rem; font-weight: 500; font-stretch: 85%;
  letter-spacing: 0.1em; text-transform: uppercase;
  pointer-events: none;
}
.compare .tag--before { left: 12px; }
.compare .tag--after { right: 12px; }
.compare input[type="range"] {
  position: absolute; inset: 0;
  width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize;
}
.compare:has(input:focus-visible) { outline: 2px solid var(--oak-text); outline-offset: 3px; }
.compare:has(input:focus-visible) .tab { box-shadow: 0 0 0 2px var(--charcoal); }
.compare.is-gliding .before { transition: clip-path 0.9s var(--ease); }
.compare.is-gliding .cut { transition: left 0.9s var(--ease); }
.compare-note { margin-top: 10px; font-size: 0.85rem; color: var(--grey); }

/* ---------- Studio ---------- */
.stages { counter-reset: stage; border-top: 1px solid var(--line-strong); }
.stages li { display: grid; gap: 6px 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.stages h3 { font-size: 1.25rem; }
.stages p { color: var(--graphite); }
@media (min-width: 860px) {
  .stages li { grid-template-columns: 4rem 3fr 6fr 2fr; align-items: baseline; }
  .stages .dur { text-align: right; }
}
.people { display: grid; gap: 0 var(--col-gap); grid-template-columns: repeat(1, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.people li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.people strong { display: block; font-weight: 600; }
.people span { font-size: 0.9rem; color: var(--grey); }
@media (min-width: 640px) { .people { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .people { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Contact ---------- */
.contact .grid { row-gap: 48px; }
@media (min-width: 960px) {
  .contact__details { grid-column: 1 / span 4; }
  .contact__form { grid-column: 6 / -1; }
}
.details dt { margin-top: 24px; }
.details dt:first-child { margin-top: 0; }
.details dd { margin-top: 4px; font-size: 1.1rem; }
.details a { text-decoration-color: var(--oak); text-underline-offset: 4px; }
.form { display: grid; gap: 22px; }
.form .two { display: grid; gap: 22px; }
@media (min-width: 640px) { .form .two { grid-template-columns: 1fr 1fr; } }
.form label { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 500; }
.form .opt { font-weight: 400; color: var(--grey); }
.form input, .form select, .form textarea {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #F6F5F3;
  font-size: 1rem;
}
.form select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--charcoal) 50%), linear-gradient(135deg, var(--charcoal) 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.form textarea { min-height: 140px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--oak); outline-offset: -1px; border-color: var(--charcoal); }
.form-done { padding: 20px; border-left: 3px solid var(--oak); background: var(--concrete); }
.form-done[hidden] { display: none; }

/* ---------- Footer ---------- */
.site-foot { background: var(--charcoal); color: rgba(237, 236, 233, 0.72); padding: 56px 0 28px; font-size: 0.9rem; }
.site-foot a { color: var(--paper); text-decoration: none; }
.site-foot a:hover, .site-foot a:focus-visible { text-decoration: underline; text-decoration-color: var(--oak); text-underline-offset: 4px; }
.site-foot :focus-visible { outline-color: var(--oak); }
.site-foot .grid { row-gap: 32px; }
.site-foot .label { color: rgba(237, 236, 233, 0.6); margin-bottom: 10px; display: block; }
.site-foot .big { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; font-stretch: 88%; letter-spacing: -0.02em; color: var(--paper); line-height: 1.05; }
@media (min-width: 860px) {
  .site-foot .f1 { grid-column: 1 / span 5; }
  .site-foot .f2 { grid-column: 7 / span 3; }
  .site-foot .f3 { grid-column: 10 / -1; }
}
.foot-base { margin-top: 48px; padding-top: 18px; border-top: 1px solid rgba(237, 236, 233, 0.18); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 0.8rem; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .rise { opacity: 0; transform: translateY(12px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
  .js .rise.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
