/* Arevix site styles. Colours and fonts come from AREVIX-LOGO-GUIDE.md. */
:root {
  --ink: #0B1512; --paper: #F7F5EF; --grey: #4E5753; --grey-light: #A3ABA7;
  --green: #10B981; --green-deep: #047857; --mint: #6EE7B7; --line: #24302B;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(20px, 4vw, 56px);
  --header: 69px;
  /* motion: one easing and three durations shared by every animation */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 160ms; --t-reveal: 600ms; --t-settle: 1400ms;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-snap-type: y mandatory; }
body { margin: 0; background: var(--ink); color: var(--paper); font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a, button { touch-action: manipulation; }
h1, h2, h3 { text-wrap: balance; }
html.page { scroll-snap-type: none; scroll-padding-top: var(--header); } /* project pages scroll freely */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; left: var(--pad); top: 12px; z-index: 30; padding: 13px 16px; background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; transform: translateY(-300%); }
.skip:focus { transform: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
img { max-width: 100%; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey-light); }
.label b { color: var(--mint); font-weight: 500; }

/* header */
header { position: fixed; inset: 0 0 auto 0; z-index: 20; height: var(--header); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 0 var(--pad); background: rgba(11, 21, 18, 0.88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; min-height: 44px; justify-self: start; }
.logo svg { display: block; height: 32px; width: auto; overflow: visible; }
nav { display: flex; gap: 28px; justify-self: end; }
nav a { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--grey-light); padding: 14px 0; position: relative; transition: color var(--t-fast) ease-out; }
nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 9px; height: 1px; background: var(--mint); transform: scaleX(0); transform-origin: left; transition: transform 240ms var(--ease-out); }
nav a:hover { color: var(--paper); }
nav a:hover::after, nav a:focus-visible::after { transform: scaleX(1); }

/* full-screen carousel panels (home page) */
.panel { position: relative; height: 100vh; height: 100svh; min-height: 480px; display: flex; flex-direction: column; padding-top: var(--header); border-bottom: 1px solid var(--line); scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.panel-bar { position: absolute; top: calc(var(--header) + 16px); left: var(--pad); right: var(--pad); z-index: 3; display: flex; justify-content: space-between; gap: 16px; }
.panel-bar .label { color: var(--paper); }
.track { flex: 1; min-height: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.track::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; min-width: 0; scroll-snap-align: start; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; background: var(--ink); }
.slide.single { grid-template-columns: minmax(0, 1fr); }
.half { position: relative; min-height: 0; overflow: hidden; }
.half img { width: 100%; height: 100%; object-fit: cover; display: block; }
.half.empty { display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(135deg, #0E1A16 0 14px, #13231D 14px 28px); }
.slide::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(11,21,18,0.5) 0%, rgba(11,21,18,0) 22%, rgba(11,21,18,0) 45%, rgba(11,21,18,0.9) 92%); }
.caption { position: absolute; left: var(--pad); right: calc(var(--pad) + 250px); bottom: 76px; z-index: 2; }
.cap-title { display: inline-block; margin: 0; padding: 8px 0 6px; border-top: 1px solid var(--paper); border-bottom: 1px solid var(--paper); font-family: var(--display); font-weight: 500; font-size: clamp(26px, 4.6vw, 68px); line-height: 1; letter-spacing: -0.01em; text-transform: uppercase; }
.caption p { margin: 14px 0 0; max-width: 54ch; font-size: clamp(15px, 1.3vw, 18px); }
.controls { position: absolute; right: var(--pad); bottom: 68px; z-index: 3; display: flex; align-items: center; gap: 8px; }
/* the link to a project's own page: quiet text that wakes up when pointed at */
.more { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--paper); opacity: 0.45; transition: opacity 320ms ease-out, color 320ms ease-out; }
.more::after { content: ""; position: absolute; left: 0; right: 0; bottom: 10px; height: 1px; background: var(--mint); transform: scaleX(0); transform-origin: left; transition: transform 420ms var(--ease-out); }
.more span { display: inline-block; transition: transform 420ms var(--ease-out); }
.more:hover, .more:focus-visible { opacity: 1; color: var(--mint); }
.more:hover::after, .more:focus-visible::after { transform: scaleX(1); }
.more:hover span, .more:focus-visible span { transform: translateX(6px); }
@media (hover: none) { .more { opacity: 1; } } /* no hover on touch screens, so it is never left faded there */
.btn:active { transform: scale(0.97); }
.track { cursor: grab; }
.track.dragging { cursor: grabbing; user-select: none; }
.half img { -webkit-user-drag: none; user-select: none; }
.panel.contact { justify-content: flex-end; justify-content: safe flex-end; padding: calc(var(--header) + 24px) var(--pad) clamp(64px, 10svh, 96px); background: repeating-linear-gradient(135deg, #0C1713 0 14px, #0E1A16 14px 28px); }
.panel.contact h2 { margin: 14px 0 0; max-width: 21ch; font-family: var(--display); font-weight: 700; font-size: clamp(30px, min(6.4vw, 9svh), 104px); line-height: 0.96; letter-spacing: -0.02em; text-transform: uppercase; }
.panel.contact .lede { margin: clamp(10px, 2svh, 18px) 0 0; max-width: 52ch; font-size: clamp(16px, 1.5vw, 20px); }
.cta { font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--mint); padding: 14px 0; transition: color var(--t-fast) ease-out; }
.cta:hover { color: var(--paper); }

/* clear labelled sections inside a panel or page */
.specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin-top: 36px; border-top: 1px solid var(--paper); }
.specs > div { padding: 14px 0 0; }
.specs p { margin: 6px 0 0; max-width: 34ch; font-size: 15px; color: var(--paper); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: clamp(16px, 3svh, 30px); }
.tag { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 10px; border: 1px solid var(--green); color: var(--mint); }
.btn { display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; padding: 15px 18px; background: var(--paper); color: var(--ink); border: 0; transition: background-color var(--t-fast) ease-out, transform var(--t-fast) ease-out; }
.btn:hover { background: var(--mint); }
.contact-link { display: inline-block; margin-top: 18px; font-family: var(--display); font-weight: 700; font-size: clamp(22px, min(4.4vw, 7svh), 60px); line-height: 1.1; margin-top: clamp(4px, 1.4svh, 18px); padding: 10px 0 8px; text-decoration: none; overflow-wrap: anywhere; border-bottom: 3px solid var(--green); transition: color var(--t-fast) ease-out, border-color var(--t-fast) ease-out; }
.contact-link:hover { color: var(--mint); border-color: var(--mint); }

/* auto-advance bar (bottom edge) */
.auto { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; align-items: center; gap: 16px; padding: 0 var(--pad) 0 0; background: rgba(11, 21, 18, 0.88); border-top: 1px solid var(--line); }
.auto button { min-width: 96px; height: 44px; padding: 0 16px; background: none; border: 0; border-right: 1px solid var(--line); color: var(--paper); font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; transition: color var(--t-fast) ease-out; }
.auto button:hover { color: var(--mint); }

.auto .bar { height: 100%; width: 100%; background: var(--mint); transform-origin: left; transform: scaleX(0); }

/* project detail pages */
.page-hero { position: relative; min-height: 78vh; display: flex; flex-direction: column; justify-content: flex-end; padding: calc(var(--header) + 40px) var(--pad) 48px; border-bottom: 1px solid var(--paper); overflow: hidden; }
.page-hero .bg { position: absolute; inset: 0; }
.page-hero .bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-hero .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,21,18,0.5), rgba(11,21,18,0.9)); }
.page-hero .bg.empty { background: repeating-linear-gradient(135deg, #0E1A16 0 14px, #111F1A 14px 28px); display: flex; align-items: center; justify-content: center; }
.page-hero .inner { position: relative; }
.page-hero h1 { margin: 14px 0 0; max-width: 18ch; font-family: var(--display); font-weight: 700; font-size: clamp(36px, 7vw, 104px); line-height: 0.96; letter-spacing: -0.02em; text-transform: uppercase; }
.block { display: grid; grid-template-columns: minmax(200px, 26%) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.block > * { min-width: 0; }
.block .head { padding: 40px var(--pad); border-right: 1px solid var(--line); }
.block .head .num { font-family: var(--mono); font-size: 13px; color: var(--green); }
.block .head h2 { margin: 8px 0 0; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.4vw, 34px); line-height: 1.05; text-transform: uppercase; }
.block .body { padding: 40px var(--pad); }
.block .body p { margin: 0 0 16px; max-width: 62ch; font-size: 18px; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.gallery figure { margin: 0; background: var(--ink); }
.gallery .shot { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(135deg, #111D19 0 10px, #14221D 10px 20px); }
.gallery .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery figcaption { padding: 12px 16px 18px; }
.page-next { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 48px var(--pad); border-bottom: 1px solid var(--line); }
footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px var(--pad) 84px; }
footer img { display: block; height: 22px; width: auto; }


/* motion. Everything here is transform, opacity or clip-path only, and every hidden
   starting state is switched on by slides.js, so the page reads normally without it. */
.track.ready .cap-title { clip-path: inset(0 100% 0 0); }
.track.ready .ch { opacity: 0; }
.track.ready .half img { transform: scale(1.05); }
.in-view .track.ready .is-active .cap-title { clip-path: inset(0 0 0 0); transition: clip-path 520ms var(--ease-out) 80ms; }
/* typed-out captions: each letter carries its own delay, set in slides.js */
.in-view .track.ready .is-active .ch { opacity: 1; transition-property: opacity; transition-duration: 50ms; transition-timing-function: linear; }
.in-view .track.ready .is-active .half img { transform: none; transition: transform var(--t-settle) var(--ease-out); }
/* logo hover: the A is redrawn in its own draw order, then the letters settle. Colours,
   shapes and the fade are untouched; it always ends on the exact resting logo. */
@keyframes logo-up { from { clip-path: inset(100% 0 0 0) fill-box; } to { clip-path: inset(0 0 0 0) fill-box; } }
@keyframes logo-down { from { clip-path: inset(0 0 100% 0) fill-box; } to { clip-path: inset(0 0 0 0) fill-box; } }
@keyframes logo-bar { from { transform: scaleX(0); } }
@keyframes logo-fade { from { opacity: 0; } }
@keyframes logo-letters { from { opacity: 0.35; transform: translateX(-10px); } }
.logo .a-bar { transform-box: fill-box; transform-origin: left center; }
.logo:hover .a-left, .logo:focus-visible .a-left { animation: logo-up 420ms var(--ease-out) both; }
.logo:hover .a-right, .logo:focus-visible .a-right { animation: logo-down 420ms var(--ease-out) 110ms both; }
.logo:hover .a-fold, .logo:focus-visible .a-fold { animation: logo-fade 200ms ease-out 330ms both; }
.logo:hover .a-bar, .logo:focus-visible .a-bar { animation: logo-bar 360ms var(--ease-out) 400ms both; }
.logo:hover .revix-g, .logo:focus-visible .revix-g { animation: logo-letters 520ms var(--ease-out) 160ms both; }
/* landing panel: stacked capital lines with a thin rule under each */
.panel.landing { align-items: center; justify-content: center; padding-bottom: 45px; }
.landing-block { --size: clamp(26px, min(5vw, 7svh), 68px); padding: 0 var(--pad); }
.stack { display: grid; margin: 0; font-family: var(--display); font-weight: 500; font-size: var(--size); line-height: 1.12; letter-spacing: -0.01em; text-transform: uppercase; }
.stack > span { display: block; padding-right: 1.6em; border-bottom: 1px solid var(--paper); }
.stack-foot { display: flex; align-items: flex-end; gap: 0.5em 18px; flex-wrap: wrap; margin-top: calc(var(--size) * 0.9); }
.stack-big > span { display: block; }
.stack-big { margin: 0; font-family: var(--display); font-weight: 500; font-size: var(--size); line-height: 1.02; letter-spacing: -0.01em; text-transform: uppercase; }
.stack-foot .label { margin: 0 0 0.5em; line-height: 1.35; }
.landing.ready .stack > span { clip-path: inset(0 100% 0 0); }
.landing.ready .stack-foot .label { opacity: 0; }
/* each line's rule is drawn as its letters start; the delay per line is set in slides.js */
.landing.ready.in-view .stack > span { clip-path: inset(0 0 0 0); transition-property: clip-path; transition-duration: 520ms; transition-timing-function: var(--ease-out); }
.landing.ready.in-view .stack-foot .label { opacity: 1; transition: opacity 400ms ease-out 1900ms; }
/* typed text outside the carousels (landing and contact panels) */
.panel.ready .ch { opacity: 0; }
.panel.ready.in-view .ch { opacity: 1; transition-property: opacity; transition-duration: 50ms; transition-timing-function: linear; }

/* opening the site: the logo draws itself in once per visit, and "Work with us" flips in
   letter by letter like a split-flap board. slides.js removes the intro class afterwards. */
@keyframes intro-up { from { clip-path: inset(100% 0 0 0) fill-box; } to { clip-path: inset(0 0 0 0) fill-box; } }
@keyframes intro-down { from { clip-path: inset(0 0 100% 0) fill-box; } to { clip-path: inset(0 0 0 0) fill-box; } }
@keyframes intro-bar { from { transform: scaleX(0); } }
@keyframes intro-fade { from { opacity: 0; } }
@keyframes intro-letters { from { clip-path: inset(0 100% 0 0) fill-box; } to { clip-path: inset(0 0 0 0) fill-box; } }
.intro .logo .a-left { animation: intro-up 760ms var(--ease-out) 150ms both; }
.intro .logo .a-right { animation: intro-down 760ms var(--ease-out) 330ms both; }
.intro .logo .a-fold { animation: intro-fade 280ms ease-out 760ms both; }
.intro .logo .a-bar { animation: intro-bar 520ms var(--ease-out) 900ms both; }
.intro .logo .revix-g { animation: intro-letters 900ms var(--ease-out) 700ms both; }
@keyframes flap { 0% { transform: rotateX(-90deg); opacity: 0; } 35% { opacity: 1; } 70% { transform: rotateX(18deg); } 100% { transform: none; } }
.cta .ch { display: inline-block; transform-origin: 50% 0; backface-visibility: hidden; }
.intro .cta { perspective: 300px; }
.intro .cta .ch { animation: flap 380ms steps(5, end) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes settle { from { transform: scale(1.05); } }
.page-hero .inner > * { animation: rise var(--t-reveal) var(--ease-out) both; }
.page-hero .inner > :nth-child(2) { animation-delay: 80ms; }
.page-hero .inner > :nth-child(3) { animation-delay: 160ms; }
.page-hero .bg img { animation: settle var(--t-settle) var(--ease-out) both; }
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.shown { opacity: 1; transform: none; transition: opacity var(--t-reveal) ease-out, transform var(--t-reveal) var(--ease-out); }
.gallery figure.reveal:nth-child(even) { transition-delay: 60ms; }


@media (max-width: 760px) {
  header { grid-template-columns: auto 1fr; gap: 12px; }
  .logo svg { height: 26px; }
  .logo .revix { fill: #F7F5EF; } /* under 32px tall the logo guide asks for the flat letters */
  nav { gap: 14px; }
  nav a { font-size: 11px; }
  .slide { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .slide.single { grid-template-rows: minmax(0, 1fr); }
  .caption { right: var(--pad); bottom: 146px; }
  .controls { left: var(--pad); right: auto; }
  header .cta { display: none; }
  .specs { grid-template-columns: minmax(0, 1fr); border-top: 0; margin-top: 24px; }
  .specs > div { border-top: 1px solid var(--line); padding: 12px 0; }
  .block { grid-template-columns: minmax(0, 1fr); }
  .block .head { border-right: 0; padding-bottom: 0; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .track.ready .cap-title { clip-path: none; }
  .landing.ready .stack > span { clip-path: none; }
  .landing.ready .stack-foot .label, .ch, .track.ready .ch, .panel.ready .ch, .track.ready .half img, .reveal { opacity: 1; transform: none; }
}
.auto .line { flex: 1; height: 2px; background: var(--line); overflow: hidden; }
