/* Alpine Arch – public site */
:root {
  --bg: #ffffff;
  --fg: #141414;
  --muted: #6e6e6b;
  --line: #e3e2de;
  --soft: #f2f1ed;
  --header-bg: rgba(255, 255, 255, .94);
  color-scheme: light dark;
  --max: 1480px;
  --pad: clamp(16px, 4vw, 56px);
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --logo: currentColor;  /* header logo colour; optional --logo-hover / --logo-active */
}
/* Dark mode follows the visitor's browser / OS setting */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --fg: #ecebe7;
    --muted: #9b9a94;
    --line: #2c2b29;
    --soft: #1e1e1c;
    --header-bg: rgba(18, 18, 17, .94);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
figure { margin: 0; }
.muted { color: var(--muted); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.spacer { height: clamp(64px, 10vw, 160px); }
.underline { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 22px var(--pad);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.has-hero .site-header {
  position: absolute; left: 0; right: 0;
  background: transparent; color: #fff;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
/* header logo (inline SVG mark, colour = header text colour) */
.brand { display: block; align-self: center; transition: opacity .2s; }
.brand-mark { display: block; height: 34px; width: auto; overflow: visible; color: var(--logo); transition: color .2s; }
/* logo colours: set --logo / --logo-hover / --logo-active (e.g. in :root) to use custom colours;
   by default they follow the header text colour (white over the home photo, light/dark elsewhere) */
.brand:hover .brand-mark { color: var(--logo-hover, var(--logo)); }
.brand.active .brand-mark { color: var(--logo-active, var(--logo)); }
/* off the home page the logo is a normal link back home: dimmed like the nav, bright on hover */
.brand:not(.active) { opacity: .72; }
.brand:not(.active):hover { opacity: 1; }
.nav { display: flex; align-items: baseline; gap: 28px; font-size: 15px; }
.nav a { opacity: .72; transition: opacity .2s; }
.nav a:hover, .nav a.active { opacity: 1; }
.nav > a.active { text-decoration: underline; text-underline-offset: 7px; text-decoration-thickness: 1px; }
.langs { display: flex; gap: 12px; padding-left: 22px; border-left: 1px solid currentColor; font-size: 13px; letter-spacing: .04em; }
.langs a { opacity: .55; }
.langs a.active { opacity: 1; }
.nav-home { display: none; }  /* phone menu only; on desktop the name in the header goes home */
.menu-toggle { display: none; align-self: center; position: relative; z-index: 2; width: 44px; height: 44px; margin: -10px -10px -10px 0; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; }
.menu-toggle span { position: absolute; left: 11px; width: 22px; height: 1.5px; background: currentColor; border-radius: 1px; transition: transform .3s var(--ease), opacity .2s; }
.menu-toggle span:nth-child(1) { top: 15px; }
.menu-toggle span:nth-child(2) { top: 21px; }
.menu-toggle span:nth-child(3) { top: 27px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .brand-mark { height: 28px; }
  .nav {
    display: none; position: fixed; inset: 0; z-index: 1;
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 0;
    padding: var(--pad); background: var(--bg); color: var(--fg);
    font-size: 34px; letter-spacing: -.01em;
  }
  .nav.open { display: flex; }
  .nav > .nav-home { display: block; }
  /* page links: full-width rows (edge to edge of the menu) with a hover / tap highlight */
  .nav > a {
    align-self: stretch; margin: 0 calc(-1 * var(--pad)); padding: 7px var(--pad);
    transition: background-color .2s;
  }
  .nav > a:active { background: var(--line); }
  @media (hover: hover) { .nav > a:hover { background: var(--line); } }
  .nav > a { opacity: 1; }  /* page links full strength; languages keep their dim/active look */
  .langs a.active { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
  .nav > a.active { text-underline-offset: 9px; }
  .langs { border: 0; padding: 0; margin-top: 28px; font-size: 16px; gap: 18px; }
  body.menu-open { overflow: hidden; }
  /* backdrop-filter makes the header the containing block for the fixed .nav, so the open
     menu would be laid out inside the 70px header and spill above the screen -> drop it */
  body.menu-open .site-header { color: var(--fg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 520px; background: #2a2a28; color: #fff; overflow: hidden; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: heroIn 1.6s var(--ease) both; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.32), rgba(0,0,0,0) 28%, rgba(0,0,0,0) 55%, rgba(0,0,0,.42));
}
.hero-text { position: absolute; z-index: 1; left: var(--pad); right: var(--pad); bottom: clamp(32px, 6vw, 80px); }
.hero h1 { margin: 0; font-size: clamp(44px, 8vw, 128px); line-height: .95; font-weight: 500; letter-spacing: -.03em; }
.hero p { margin: .7em 0 0; font-size: clamp(17px, 1.6vw, 22px); opacity: .92; }
.hero.plain { height: auto; min-height: 0; background: none; color: var(--fg); }
.hero.plain::after { display: none; }
.hero.plain .hero-text { position: static; max-width: var(--max); margin: 0 auto; padding: clamp(72px, 14vw, 200px) var(--pad) 0; }
@keyframes heroIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }

/* ---------- Home ---------- */
.intro { max-width: 30em; padding: clamp(56px, 9vw, 150px) 0; font-size: clamp(22px, 2.5vw, 36px); line-height: 1.28; letter-spacing: -.012em; }
.intro p { margin: 0 0 .6em; }
.intro p:last-child { margin: 0; }
.intro-small { font-size: clamp(18px, 1.6vw, 22px); }
.block { margin-bottom: clamp(72px, 10vw, 160px); }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  border-top: 1px solid var(--fg); padding-top: 14px; margin-bottom: clamp(24px, 3vw, 40px); font-size: 15px;
}
.section-head h2 { margin: 0; font-size: 15px; font-weight: 500; }
.section-head a { color: var(--muted); transition: color .2s; }
.section-head a:hover { color: var(--fg); }
.empty { color: var(--muted); padding: 8px 0 40px; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(36px, 5vw, 72px) clamp(16px, 2.5vw, 36px); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid, .grid-3 { grid-template-columns: 1fr; } }

.card { display: block; }
.ph { aspect-ratio: 4 / 3; background: var(--soft); overflow: hidden; }
.ph-wide { aspect-ratio: 3 / 2; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.card:hover .ph img { transform: scale(1.03); }
.card .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 14px; font-size: 15px; }
.card .title { font-weight: 500; }
.card .sub { color: var(--muted); text-align: right; }
.post-card time { display: block; margin-top: 14px; font-size: 14px; color: var(--muted); }
.post-card h3 { margin: 4px 0 6px; font-size: 19px; font-weight: 500; letter-spacing: -.005em; line-height: 1.3; }
.post-card p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Page titles & text ---------- */
.page-title { margin: clamp(48px, 9vw, 130px) 0 clamp(32px, 5vw, 64px); max-width: 16em; font-size: clamp(36px, 5.5vw, 80px); line-height: 1.02; font-weight: 500; letter-spacing: -.025em; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--pad); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.prose { max-width: 38em; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.6; }
.prose p { margin: 0 0 1.1em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.lead { font-size: clamp(21px, 2vw, 29px); line-height: 1.32; letter-spacing: -.01em; }

.facts { margin: 0; font-size: 15px; }
.facts > div { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* ---------- Project / post detail ---------- */
.project-cover { margin: 0 0 clamp(36px, 6vw, 88px); }
.project-cover img { width: 100%; max-height: 92vh; object-fit: cover; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2vw, 28px); margin: clamp(56px, 8vw, 128px) 0; }
.gallery .wide { grid-column: 1 / -1; }
.gallery img { width: 100%; }
@media (max-width: 700px) { .gallery { grid-template-columns: 1fr; } }
.pager { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-top: 1px solid var(--fg); padding: 16px 0 clamp(64px, 10vw, 160px); margin-top: clamp(48px, 6vw, 96px); font-size: 15px; }
.pager a:hover { text-decoration: underline; text-underline-offset: 5px; }
.post-head time { display: block; margin-top: clamp(48px, 9vw, 130px); color: var(--muted); font-size: 15px; }
.post-head .page-title { margin-top: 10px; }
.draft-banner { background: var(--fg); color: var(--bg); text-align: center; font-size: 13px; padding: 7px var(--pad); }

/* ---------- Journal list ---------- */
.post-list { border-top: 1px solid var(--fg); }
.post-row { display: grid; grid-template-columns: 11em minmax(0, 1fr) 260px; gap: var(--pad); align-items: start; padding: 26px 0; border-bottom: 1px solid var(--line); }
.post-row time { color: var(--muted); font-size: 15px; padding-top: 4px; }
.post-row h2 { margin: 0 0 .35em; font-size: clamp(21px, 2vw, 29px); line-height: 1.2; font-weight: 500; letter-spacing: -.012em; }
.post-row p { margin: 0; color: var(--muted); max-width: 36em; }
.post-row .ph img { transition: transform 1s var(--ease); }
.post-row:hover .ph img { transform: scale(1.03); }
.post-row:hover h2 { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
@media (max-width: 760px) {
  .post-row { grid-template-columns: 1fr; gap: 12px; }
  .post-row .ph { order: -1; }
}

/* ---------- Studio & contact ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--pad); align-items: start; }
.studio.no-image { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.studio.no-image .prose { grid-column: 2; }
@media (max-width: 760px) { .studio, .studio.no-image { grid-template-columns: 1fr; } .studio.no-image .prose { grid-column: auto; } }
.contact-big { display: block; width: fit-content; max-width: 100%; overflow-wrap: anywhere; font-size: clamp(24px, 3vw, 44px); letter-spacing: -.02em; line-height: 1.2; margin-bottom: .25em; }
.contact-big:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.contact .facts { margin-top: 36px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 44px 0 28px; font-size: 14px; line-height: 1.6; }
.footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.footer-links { display: flex; flex-direction: column; align-items: flex-start; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { margin-top: 40px; font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) {
  .footer-grid { grid-template-columns: 1fr; gap: 16px; }
  .site-footer { padding: 32px 0 24px; }
  .footer-bottom { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
