/* ============ Fonts ============ */
/* Fraunces (headings, variable: optical size + weight, roman and italic) and Hanken Grotesk
   (text, variable weight). Both SIL Open Font License, see fonts/OFL-*.txt. Latin subsets.
   The "Fallback" faces are Georgia and Arial resized to the webfonts' proportions,
   so text does not move when the webfonts arrive. */
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-roman.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("fonts/hanken-grotesk.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces Fallback"; src: local("Georgia"); font-style: normal; size-adjust: 96%; ascent-override: 101.9%; descent-override: 26.6%; line-gap-override: 0%; }
@font-face { font-family: "Fraunces Fallback"; src: local("Georgia Italic"), local("Georgia-Italic"); font-style: italic; size-adjust: 89%; ascent-override: 109.9%; descent-override: 28.7%; line-gap-override: 0%; }
@font-face { font-family: "Hanken Fallback"; src: local("Arial"), local("ArialMT"); size-adjust: 100.7%; ascent-override: 99.3%; descent-override: 30.1%; line-gap-override: 0%; }

/* ============ Colours & base ============ */
:root {
  --font-display: "Fraunces", "Fraunces Fallback", Georgia, "Times New Roman", serif;
  --font-text: "Hanken Grotesk", "Hanken Fallback", Arial, Helvetica, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --background: #f8f5f0;
  --foreground: #482526;
  --border: #d4c9bd;
  --muted: #6f615a;
  --sand: #e9e2d9;
  --dark: #382b28;

  /* Page colour stops (see "Scroll colour" below and script.js) */
  --c-ivory: #f8f5f0;
  --c-sand: #ebe3d8;
  --c-latte: #d9c8b4;
  --c-tan: #bfa48a;
  --c-caramel: #98775f;
  --c-mocha: #6e5243;
  --c-brown: #3a2b27;

  /* Colours the scroll effect updates while you scroll (these are the starting values) */
  --page-bg: var(--c-ivory);
  --page-fg: #482526;
  --page-muted: #6a5b54;
  --page-line: #a08c85;
  --page-rule: #d8cec4;
}

/* ============ Scroll colour ============ */
/* Registered so text eases over when it flips from dark to light in the middle of the ramp. */
@property --page-fg { syntax: "<color>"; inherits: true; initial-value: #482526; }
@property --page-muted { syntax: "<color>"; inherits: true; initial-value: #6a5b54; }
@property --page-line { syntax: "<color>"; inherits: true; initial-value: #a08c85; }
@property --page-rule { syntax: "<color>"; inherits: true; initial-value: #d8cec4; }
html.bg-scroll { transition: --page-fg .45s ease, --page-muted .45s ease, --page-line .45s ease, --page-rule .45s ease; }

/* Every section is tagged data-tone="ivory|sand|sage|brown".
   Default (no JavaScript, or "reduce motion"): each section paints its own fixed colour.
   With .bg-scroll on <html>: sections are transparent and the whole page shares one
   background that script.js blends between the section colours as you scroll.
   Text colours (--fg, --fg-muted, --line, --rule) follow the background so they stay readable. */
[data-tone] { --bg-now: var(--sec-bg); background: var(--sec-bg); color: var(--fg); }
[data-tone="ivory"] { --sec-bg: var(--c-ivory); }
[data-tone="sand"]  { --sec-bg: var(--c-sand); }
[data-tone="latte"] { --sec-bg: var(--c-latte); }
[data-tone="tan"] { --sec-bg: var(--c-tan); }
[data-tone="caramel"] { --sec-bg: var(--c-caramel); }
[data-tone="mocha"] { --sec-bg: var(--c-mocha); }
[data-tone="brown"] { --sec-bg: var(--c-brown); }
[data-tone="ivory"], [data-tone="sand"] {
  --fg: #482526; --fg-muted: #6a5b54; --line: #a08c85; --rule: #d3c8bd;
}
[data-tone="latte"], [data-tone="tan"] {
  --fg: #2f1718; --fg-muted: #44302b; --line: #7d6a5e; --rule: #a8927f;
}
[data-tone="caramel"] {
  --fg: #0c0606; --fg-muted: #0c0606; --line: #3d2d25; --rule: #6d5444;
}
[data-tone="mocha"] {
  --fg: #fff; --fg-muted: #f1e7de; --line: #c3b1a5; --rule: #8d7263;
}
[data-tone="brown"] {
  --fg: #f6f0e8; --fg-muted: #d6c8be; --line: #8f7c75; --rule: #5a4843;
}
html.bg-scroll, html.bg-scroll body { background: var(--page-bg); }
html.bg-scroll [data-tone] {
  --bg-now: var(--page-bg);
  --fg: var(--page-fg); --fg-muted: var(--page-muted); --line: var(--page-line); --rule: var(--page-rule);
  background: transparent;
}

/* Language switching: show only the text for the current language */
html[lang="pt"] .en,
html[lang="en"] .pt { display: none !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  background: var(--background);
  color: var(--foreground);
  margin: 0;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { object-fit: cover; width: 100%; display: block; }
svg { flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 {
  letter-spacing: -.02em;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 370;
  line-height: 1.08;
}
em { font-weight: inherit; }
:focus-visible { outline: 2px solid #ad724e; outline-offset: 5px; }

/* Section headings share one scale */
main section h2 { font-size: clamp(38px, 5vw, 76px); line-height: 1.04; }

.eyebrow { letter-spacing: 1.8px; text-transform: uppercase; font-size: 12px; line-height: 1.7; }

/* ============ Header ============ */
header {
  border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 24px 4.5%;
}
.wordmark { letter-spacing: -1.6px; font-family: var(--font-display); font-size: 30px; line-height: 1; }
.wordmark span {
  display: block; margin-top: 9px;
  letter-spacing: 5px; text-align: center;
  font-family: var(--font-text); font-size: 10px;
}
nav { display: flex; gap: 38px; font-size: 14px; }
nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.header-end { display: flex; align-items: center; gap: 16px; }
.languages { display: flex; gap: 9px; font-size: 13px; }
.languages button { color: inherit; opacity: .5; background: none; border: 0; padding: 4px; }
.languages button[aria-pressed="true"] { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }
.mobile-menu { display: none; color: inherit; background: none; border: 0; }
.skip { position: fixed; top: -100px; left: 15px; z-index: 100; background: #fff; padding: 12px; }
.skip:focus { top: 15px; }

/* ============ Hero ============ */
/* Image-led: compact text row above one large photograph (about two thirds of the first screen). */
.hero { padding: 36px 0 0; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px 48px; margin-bottom: 36px; padding: 0 4.5%; }
.hero-heading .eyebrow { margin-bottom: 14px; }
.hero h1 { font-size: clamp(44px, 6vw, 96px); line-height: 1.03; max-width: 14ch; text-wrap: balance; }
.hero-side { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; max-width: 440px; padding-bottom: 4px; }
.hero-text { color: var(--fg-muted); font-size: 17px; }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.hero-ctas .hero-secondary { margin-top: 0; }
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 13px 20px; font-size: 14px;
  border: 1px solid var(--fg);
  transition: background .25s, color .25s;
}
.btn-primary { color: var(--bg-now); background: var(--fg); }
.btn-primary:hover { background: color-mix(in srgb, var(--fg) 86%, var(--bg-now)); }

.hero-media { margin: 0; }
.hero-frame { position: relative; height: clamp(520px, 78vh, 900px); overflow: hidden; background: #e8e2d9; }
.hero-slides { position: absolute; inset: 0; }
.hero-slide { position: absolute; inset: 0; display: block; opacity: 0; transition: opacity 1.6s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 45%; }
.hero-media figcaption { display: flex; justify-content: flex-end; margin-top: 12px; padding: 0 4.5%; }
.hero-caption-text { transition: opacity .6s ease; }
.hero-caption.is-changing .hero-caption-text { opacity: 0; }
/* Each photo drifts slowly while it is on screen (slideshow only, see script.js) */
.hero-slide.is-drifting img { animation: hero-drift 9.2s linear both; }
.hero.is-paused .hero-slide img { animation-play-state: paused; }
@keyframes hero-drift { from { transform: scale(1); } to { transform: scale(1.04); } }
.hero-caption {
  display: inline-flex; align-items: center; gap: 8px; padding: 0;
  color: var(--fg-muted); background: none; border: 0;
  font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase;
}
.hero-caption:hover { color: var(--fg); }

/* ============ Intro ============ */
.intro { text-align: center; padding: 110px 10%; }
.intro h2 { margin: 25px 0; }
.intro > p:not(.eyebrow) { color: var(--fg-muted); }
.text-link {
  display: inline-block; margin-top: 28px; padding-bottom: 3px;
  border-bottom: 1px solid var(--line); font-size: 14px;
}

/* ============ Projects ============ */
.projects { padding: 20px 4.5% 100px; }
.section-heading {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--rule); padding: 32px 0;
}

.section-heading > span { letter-spacing: 2px; font-size: 12px; }
/* Desktop: 12 columns. Row 1: project 1 wide (3:2) + project 2 narrow (4:5, bottom-aligned).
   Row 2 mirrors it: project 3 narrow + project 4 wide. */
.project-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 28px; row-gap: 110px; }
.project-grid article:nth-child(1) { grid-column: 1 / 9; }
.project-grid article:nth-child(2) { grid-column: 9 / 13; align-self: end; }
.project-grid article:nth-child(3) { grid-column: 1 / 5; align-self: end; }
.project-grid article:nth-child(4) { grid-column: 5 / 13; }
.project-open { display: block; width: 100%; padding: 0; text-align: left; color: inherit; background: none; border: 0; }

.project-card { display: flex; flex-direction: column; gap: 16px; }
.project-card-top, .project-card-bottom { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.project-card-top .eyebrow { color: var(--fg-muted); }
.project-count { color: var(--fg-muted); font-size: 12px; letter-spacing: 2px; white-space: nowrap; }
.project-photo { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: #e8e2d9; }
.project-grid article:nth-child(2) .project-photo,
.project-grid article:nth-child(3) .project-photo { aspect-ratio: 4 / 5; }
.project-photo img { height: 100%; transition: transform .6s; }
/* Crops that keep each subject in frame (the narrow 4:5 crops matter most) */
.project-grid article:nth-child(1) .project-photo img { object-position: 45% 55%; }
.project-grid article:nth-child(2) .project-photo img { object-position: 30% 50%; }
.project-grid article:nth-child(3) .project-photo img { object-position: 50% 50%; }
.project-grid article:nth-child(4) .project-photo img { object-position: 50% 55%; }
.project-card-bottom { margin-top: 4px; }
.project-card-bottom h3 { font-size: clamp(30px, 2.6vw, 38px); }
.project-visit {
  display: inline-flex; align-items: center; gap: 8px;
  padding-bottom: 3px; border-bottom: 1px solid var(--line);
  font-size: 13px; white-space: nowrap;
}
.project-card:hover .project-photo img { transform: scale(1.035); }

/* ============ Services ============ */
.services { padding: 85px 4.5%; }
.services-intro h2 { margin-top: 25px; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 65px; }
.service-grid article { border-top: 1px solid var(--line); padding-top: 22px; }
.service-grid h3 { margin: 22px 0 18px; font-size: 31px; }
.service-grid article > p:not(.eyebrow) { color: var(--fg-muted); max-width: 370px; }
.service-grid a { display: flex; align-items: center; gap: 15px; margin-top: 28px; font-size: 14px; }

/* ============ Story: behind the work ============ */
/* Asymmetric editorial layout on a 12-column grid: intro top-left, one large photo on the
   right, two small close-ups and a wide studio frame stepping down the page. */
.story { padding: 110px 5.5% 120px; }
.story-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 28px; max-width: 1400px; margin: 0 auto; }
.story-intro { grid-column: 1 / 6; grid-row: 1; align-self: start; padding-top: 30px; }
.story-intro h2 { margin: 25px 0 26px; }
.story-intro > p:not(.eyebrow) { color: var(--fg-muted); max-width: 440px; }
.story-fig { margin: 0; align-self: start; } /* reset figure margins first; the placements below add their own */
.story-large   { grid-column: 7 / 13; grid-row: 1 / 3; }
.story-small-a { grid-column: 2 / 5; grid-row: 2; align-self: end; margin-top: 70px; }
.story-small-b { grid-column: 1 / 4; grid-row: 3; margin-top: 110px; }
.story-studio  { grid-column: 6 / 12; grid-row: 3; margin-top: 190px; }

/* Each photo sits in the same light frame as the project cards, caption included.
   The frame keeps its own colours, so it reads the same while the page colour shifts. */
.story-fig { padding: 18px 18px 20px; color: var(--foreground); background: #fcfaf6; border: 1px solid #e0d6cb; }
.story-img { overflow: hidden; background: #ece6dd; }
.story-img img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.story-fig figcaption { margin-top: 16px; max-width: 460px; color: #6a5b54; font-size: 14px; line-height: 1.6; }
.story-where { display: block; margin-bottom: 4px; color: var(--foreground); font-size: 11px; letter-spacing: 1.8px; text-transform: uppercase; }
.link-arrow {
  display: inline-block;
  width: 0.72em;
  height: 0.72em;
  margin-left: 0.15em;
  vertical-align: -0.02em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.story-fig .story-link { border-bottom-color: #b3a39b; }
.story-link { margin-top: 30px; }

.story-img--wide img { aspect-ratio: 3 / 2; }

/* Subtle entrance: a short fade-up as each part scrolls into view (only with .anim, so
   reduced-motion visitors and visitors without JavaScript see everything straight away) */
.anim .story-reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s cubic-bezier(.22, 1, .36, 1); }
.anim .story-reveal.is-visible { opacity: 1; transform: none; }

/* ============ Motion ============ */
/* Everything here only runs with .anim on <html> (set in <head>, never under reduced motion),
   so without JavaScript or with reduced motion every photo and heading is simply visible. */

/* Photos open like a curtain: the frame unclips from 12% while the photo settles from 108%.
   script.js adds .is-shown once ~15% is in view (--d staggers photos that arrive together). */
.anim .curtain {
  clip-path: inset(12%);
  transition: clip-path 1.1s var(--ease) var(--d, 0s);
}
.anim .curtain > img, .anim .curtain > .hero-slides, .anim .curtain--block img {
  transform: scale(1.08);
  transition: transform 1.1s var(--ease) var(--d, 0s);
}
.anim .curtain.is-shown { clip-path: inset(0); }
.anim .curtain.is-shown > img, .anim .curtain.is-shown > .hero-slides, .anim .curtain--block.is-shown img { transform: none; }
/* After the reveal, the project photos go back to their quick hover zoom */
.anim .curtain.is-done > img { transition: transform .6s; }
.anim .project-card:hover .curtain.is-done > img { transform: scale(1.035); }

/* Headings rise line by line. Each line sits in a mask (.line); the padding gives accents,
   descenders and italic overhang room, the negative margin takes that room back. */
/* (A flex column keeps the masks' negative margins from collapsing into each other.) */
main h1 > span, main h2[data-rise] > span { display: flex; flex-direction: column; }
.line { display: block; overflow: hidden; padding: .14em .1em .14em .05em; margin: -.14em -.1em -.14em -.05em; }
.line-in { display: block; text-wrap: balance; }
.anim .line-in { transform: translateY(calc(100% + .32em)); transition: transform .9s var(--ease); }
.anim .line + .line .line-in { transition-delay: 80ms; }
.anim .line + .line + .line .line-in { transition-delay: 160ms; }
.anim .is-risen .line-in, .anim .hero.is-in h1 .line-in { transform: none; }

/* Project gallery shown as an even grid: two photos per row, at every screen size */
.modal-gallery.modal-gallery--grid { grid-template-columns: 1fr 1fr; }
.modal-gallery.modal-gallery--grid img:nth-child(n) { grid-column: auto; height: auto; max-height: none; aspect-ratio: 4 / 5; object-fit: cover; background: none; }

/* ============ Details ============ */
/* Uses the brand carousel's track and controls; only the light card is its own. */
.details { padding: 80px 0 85px; overflow: hidden; }
.details-intro { padding: 0 7%; max-width: 1040px; }
.details h2 { margin: 15px 0; }
.details-intro > p:last-child { color: var(--fg-muted); max-width: 470px; }
.details-card {
  flex: 0 0 clamp(260px, 26vw, 400px); margin: 0; scroll-snap-align: start;
}
.details-photo { aspect-ratio: 4 / 5; overflow: hidden; background: #ece6dd; }
.details-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ============ Brands ============ */
.brands { padding: 120px 0; }
.brands-intro { text-align: center; padding: 0 7%; }
.brands h2 { margin: 15px 0; }
.brands-intro > p:last-child { color: var(--fg-muted); max-width: 510px; margin: auto; }

/* Carousel: one row of framed cards that scrolls sideways and runs off the screen edge */
.brand-carousel { --edge: 7vw; margin-top: 55px; }
.brand-track {
  display: flex; gap: 24px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--edge);
  padding: 4px var(--edge) 8px;
  scrollbar-width: none;
  cursor: grab;
}
.brand-track::-webkit-scrollbar { display: none; }
.brand-track.dragging { cursor: grabbing; scroll-snap-type: none; }
.brand-track.dragging a { pointer-events: none; }
.brand-track:focus-visible { outline-offset: -2px; }
.brand-track img { -webkit-user-drag: none; user-select: none; }

/* Partner logos: one row, one colour (the files are already ivory), same optical size.
   Wordmarks in solid capitals are set smaller than the stacked marks so they read the same. */
.brand-logos {
  display: flex; flex-wrap: wrap; justify-content: space-evenly; align-items: center;
  gap: 32px 48px; max-width: 1180px; margin: 64px auto 0; padding: 0 7%; list-style: none;
}
.brand-logos a { display: block; padding: 10px; opacity: .7; transition: opacity .3s ease; }
.brand-logos a:hover, .brand-logos a:focus-visible { opacity: 1; }
.brand-logos img { width: auto; height: 30px; object-fit: contain; }
.brand-logos .brand-logo--audo { height: 46px; }
.brand-logos .brand-logo--bolia { height: 21px; }
.brand-logos .brand-logo--ferm-living { height: 46px; }
.brand-logos .brand-logo--norr11 { height: 19px; }
.brand-logos .brand-logo--muuto { height: 18px; }

/* Progress line + arrows */
.brand-controls { display: flex; align-items: center; gap: 28px; margin-top: 34px; padding: 0 var(--edge); }
.brand-controls[hidden] { display: none; }
.brand-progress { position: relative; flex: 1; height: 1px; background: var(--rule); }
.brand-progress span { position: absolute; top: -1px; left: 0; height: 3px; width: 25%; background: var(--fg); transition: left .15s linear, width .15s linear; }
.brand-arrows { display: flex; gap: 10px; }
.brand-arrows button {
  display: grid; place-items: center; width: 46px; height: 46px; padding: 0;
  color: var(--fg); background: none; border: 1px solid var(--line); border-radius: 50%;
  transition: background .25s, opacity .25s;
}
.brand-arrows button:hover:not(:disabled) { background: color-mix(in srgb, var(--fg) 9%, transparent); }
.brand-arrows button:disabled { opacity: .3; cursor: default; }

/* ============ Contact & form ============ */
.contact {
  display: grid; grid-template-columns: 1fr 1fr; gap: 9%;
  padding: 95px 7%;
}
.contact h2 { margin: 25px 0 32px; }
.contact-intro > p:not(.eyebrow) { color: var(--fg-muted); max-width: 390px; margin-bottom: 32px; }
.contact-alternative { margin-top: 20px; font-size: 14px; }
.contact-alternative a { text-decoration: underline; text-underline-offset: 4px; }

.button {
  display: inline-flex; justify-content: space-between; align-items: center; gap: 15px;
  padding: 15px 23px; font-size: 14px;
  color: inherit; background: none; border: 1px solid;
}
.button:hover { background: color-mix(in srgb, currentColor 9%, transparent); }

form h3 { letter-spacing: -1px; margin-bottom: 24px; font-size: 30px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
form label { display: block; margin: 0 0 24px; letter-spacing: .1px; font-size: 13px; }
form input, form textarea, form select {
  display: block; width: 100%; min-height: 40px;
  margin-top: 4px; padding: 8px 0;
  color: var(--fg); background: none;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  font-size: 16px;
}
form select {
  appearance: none; -webkit-appearance: none;
  /* chevron drawn in the text colour, so it follows the page colour */
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
  padding-right: 26px;
}
form select option { color: var(--foreground); background: var(--background); }
form textarea { resize: vertical; }
form textarea::placeholder { color: var(--fg-muted); opacity: .85; font-size: 14px; }
form input:focus-visible, form textarea:focus-visible, form select:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
form .form-privacy { color: var(--fg-muted); margin-bottom: 22px; font-size: 12px; line-height: 1.6; }
form .form-privacy button { color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.submit { color: var(--foreground); background: var(--background); border-color: var(--background); }
.submit:hover { background: #e8d7ca; }
.submit .sending-label { display: none; }
.is-sending .submit > .en, .is-sending .submit > .pt { display: none !important; }
.is-sending .submit .sending-label { display: inline; }
.submit:disabled { opacity: .7; cursor: wait; }
.form-status { display: flex; gap: 10px; margin-top: 20px; font-size: 14px; }
.form-status[hidden] { display: none; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ============ Footer ============ */
footer { padding: 60px 5% 25px; }
.footer-top { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr .6fr; gap: 25px; font-size: 14px; }
.footer-top .eyebrow { margin-bottom: 14px; }
.footer-top .wordmark { align-self: start; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 20px;
  margin-top: 60px; padding-top: 20px;
  border-top: 1px solid var(--rule); color: var(--fg-muted); font-size: 12px;
}
.footer-bottom button { color: inherit; background: none; border: 0; padding: 0; font-size: inherit; }

/* Larger tap areas (at least 44px tall) for small links, without moving anything.
   The footer links sit closer than 44px apart, so their areas go in a layer under the text:
   a tap on a link's own text always reaches that link. */
.languages button, .footer-top a, .footer-bottom button { position: relative; }
.languages button::after, .footer-top a::after, .footer-bottom button::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
}
.footer-top { position: relative; z-index: 0; }
.footer-top a::after { z-index: -1; }

.whatsapp {
  position: fixed; right: 24px; bottom: 24px; z-index: 30;
  display: flex; align-items: center; gap: 9px;
  padding: 13px 20px; font-size: 14px;
  color: var(--foreground); background: var(--background);
  border: 1px solid #d9cbc0; border-radius: 40px;
  box-shadow: 0 5px 25px #24171218;
}

/* ============ Pop-up windows ============ */
dialog {
  position: fixed; inset: 0; margin: auto;
  max-height: 90dvh; overflow-y: auto;
  color: var(--foreground); background: var(--background);
  border: 1px solid var(--border); border-radius: 0;
  box-shadow: 0 20px 60px #1c110d40;
}
dialog::backdrop { background: #1c110d99; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
body:has(dialog[open]) { overflow: hidden; }
.modal-close {
  position: absolute; top: 15px; right: 15px; z-index: 2;
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  color: inherit; background: var(--background); border: 1px solid var(--border);
}
.project-dialog { width: calc(100% - 40px); max-width: 1100px; padding: 40px; }
.project-dialog .eyebrow { margin-bottom: 8px; }
.modal-title { letter-spacing: -.02em; font-family: var(--font-display); font-size: 44px; line-height: 1.1; padding-right: 40px; }
.modal-description { max-width: 700px; margin-top: 10px; line-height: 1.65; font-size: 16px; color: var(--muted); }
.modal-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.modal-gallery img { height: 450px; }
.modal-gallery img:first-child { grid-column: 1 / -1; height: auto; max-height: 650px; object-fit: contain; background: #e8e2d9; }
/* Exactly two photos: show them side by side at the same size instead of one wide + one alone */
.modal-gallery:has(> img:nth-child(2):last-child) img { grid-column: auto; height: auto; max-height: none; aspect-ratio: 4 / 5; object-fit: cover; background: none; }
.menu-dialog, .privacy-dialog { width: calc(100% - 40px); max-width: 560px; padding: 35px; }
.menu-dialog h2 { font-size: 30px; padding-right: 40px; }
.menu-dialog nav { flex-direction: column; gap: 22px; padding-top: 20px; font-family: var(--font-display); font-size: 24px; }
.privacy-dialog h2 { padding-right: 25px; font-size: 30px; margin-bottom: 14px; }
.privacy-dialog p { font-size: 16px; line-height: 1.65; margin-top: 10px; }

/* ============ Responsive ============ */
@media (min-width: 1600px) { main { max-width: 1920px; margin: auto; } }

@media (max-width: 1050px) {
  nav { gap: 20px; }
  .service-grid { gap: 24px; }
  .contact { gap: 6%; padding: 75px 6%; }
  .story-grid { column-gap: 20px; }
  .story-studio { grid-column: 5 / 13; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  /* The larger hero heading gets the full width: text and buttons go below it */
  .hero-top { grid-template-columns: 1fr; gap: 22px; }
  .hero h1 { max-width: 16ch; }
  /* Tablet: two equal columns, every photo 4:5 */
  .project-grid { grid-template-columns: 1fr 1fr; row-gap: 80px; }
  .project-grid article:nth-child(n) { grid-column: auto; align-self: start; }
  .project-grid article:nth-child(n) .project-photo { aspect-ratio: 4 / 5; }
}

@media (max-width: 700px) {
  header { gap: 12px; padding: 20px 6%; }
  .wordmark { font-size: 24px; }
  header nav { display: none; }
  .mobile-menu { display: block; }
  .hero { padding: 22px 0 0; }
  .hero-top { grid-template-columns: 1fr; gap: 14px; margin-bottom: 24px; padding: 0 6%; }
  .hero-heading .eyebrow { margin-bottom: 10px; font-size: 11px; letter-spacing: 1px; }
  .hero h1 { font-size: 42px; }
  .hero-side { gap: 14px; max-width: none; }
  .hero-text { font-size: 16px; }
  .hero-ctas { gap: 12px 20px; }
  .btn { padding: 12px 18px; }
  .hero-frame { height: 70vh; height: 70svh; }
  .hero-media figcaption { padding: 0 6%; }
  .hero-media img { object-position: 50% 60%; }
  .intro { padding: 65px 6%; }
  .projects { padding: 0 6% 65px; }
  .project-grid { grid-template-columns: 1fr; row-gap: 64px; }
  .project-card { gap: 12px; }
  .project-card-bottom { flex-wrap: wrap; gap: 10px 16px; }
  .project-card-bottom h3 { font-size: 30px; }
  .project-visit { font-size: 12px; gap: 6px; }
  .services { padding: 60px 6%; }
  .service-grid { grid-template-columns: 1fr; gap: 35px; margin-top: 40px; }
  .service-grid h3 { margin: 17px 0 14px; }
  /* Story on phones: a paced vertical sequence with varied widths */
  .story { padding: 70px 6% 80px; }
  .story-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 14px; }
  .story-intro { grid-column: 1 / -1; grid-row: auto; padding-top: 0; }
  .story-large { grid-column: 1 / -1; grid-row: auto; margin-top: 40px; }
  .story-small-a { grid-column: 3 / -1; grid-row: auto; margin-top: 56px; }
  .story-small-b { grid-column: 1 / 5; grid-row: auto; margin-top: 56px; }
  .story-studio { grid-column: 1 / -1; grid-row: auto; margin-top: 56px; }
  .story-fig { padding: 12px 12px 14px; }
  .story-fig figcaption { font-size: 13px; margin-top: 12px; }
  .brands { padding: 90px 0; }
  .brands-intro { padding: 0 6%; }
  /* 3 + 2 */
  .brand-logos { gap: 28px 0; margin-top: 44px; padding: 0 4%; }
  .brand-logos li { flex: 0 0 33.333%; display: flex; justify-content: center; }
  .brand-logos li:nth-child(n + 4) { flex-basis: 50%; }
  .brand-carousel { --edge: 6vw; margin-top: 40px; }
  .details { padding: 60px 0 65px; }
  .details-intro { padding: 0 6%; }

  .details-card { flex-basis: 76vw; }
  .brand-track { gap: 14px; }
  .brand-controls { gap: 18px; margin-top: 26px; }
  .brand-arrows button { width: 40px; height: 40px; }
  .contact { grid-template-columns: 1fr; gap: 50px; padding: 60px 6%; }
  .contact-intro > p:not(.eyebrow) { max-width: 100%; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  footer { padding: 45px 6% 85px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 35px 20px; }
  .footer-top > .wordmark { grid-column: 1 / -1; }
  .footer-bottom { flex-wrap: wrap; gap: 12px; margin-top: 35px; }
  .footer-bottom > span:nth-child(2) { display: none; }
  .whatsapp { padding: 12px; right: 16px; bottom: 16px; }
  .whatsapp > span { display: none; }
  .project-dialog { width: calc(100% - 20px); max-height: 94dvh; padding: 30px 20px; }
  .modal-title { font-size: 33px; }
  .modal-gallery { grid-template-columns: 1fr; }
  .modal-gallery img { height: auto; max-height: 600px; }
  .modal-gallery img:first-child { max-height: 550px; }
  .project-dialog > .button { gap: 12px; }
  .privacy-dialog { padding: 30px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  /* If motion is switched off after the page loaded: show everything as it is */
  .anim .curtain { clip-path: none; }
  .anim .curtain > img, .anim .curtain > .hero-slides, .anim .curtain--block img, .anim .line-in { transform: none; }
  .hero-slide.is-drifting img { animation: none; }
}

/* ============ Logos ============ */
/* Stacked double-outline logo (footer). */
.logo-outline { display: block; flex: none; }
.logo-outline svg { display: block; width: 100%; height: auto; overflow: visible; }
.logo-outline .li { stroke: var(--fg); }
.logo-outline .lp { stroke: var(--bg-now); }
.logo-outline [data-f="p"] { fill: var(--bg-now); }
.logo-outline [data-f="i"] { fill: var(--fg); }
.logo-outline--stack { width: min(100%, 300px); align-self: start; }
/* Solid one-line logo (nav). */
.logo-outline--nav { width: 280px; }
.logo-outline--nav path { fill: var(--fg); }
@media (max-width: 1100px) { .logo-outline--nav { width: 210px; } }
@media (max-width: 900px) { .logo-outline--nav { width: 160px; } }
@media (max-width: 700px) {
  .logo-outline--nav { width: min(190px, 50vw); }
  .footer-top > .logo-outline--stack { grid-column: 1 / -1; width: min(100%, 260px); }
}

/* ============ Loading screen ============ */
.site-loader { display: none; }
html.is-loading, html.is-loading body { overflow: hidden; }
html.is-loading .site-loader { display: block; position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
html.is-loading .logo-outline--nav { visibility: hidden; }
.site-loader-bg { position: absolute; inset: 0; background: var(--c-ivory); }
.site-loader-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: loader-in .7s ease both; }
.lg { transform-box: view-box; transform-origin: 0 0; }
.lg-s { opacity: 0; }
html.loader-out .site-loader { opacity: 0; transition: opacity .6s ease; }
@keyframes loader-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .site-loader-svg { animation: none; }
  html.loader-out .site-loader { transition: none; }
}
