/* HEC Design — shared styles. Pages are generated by tools/build.py. */

:root {
  --paper: #ffffff;
  --paper-2: #f0f0f0;
  --ink: #000000;
  --ink-soft: #5c5c5c;
  --line: rgba(0, 0, 0, 0.14);
  --night: #000000;
  --black: #000;
  --accent: #ff6a00;
  --on-dark: #ffffff;
  --gutter: clamp(16px, 2.2vw, 32px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip {
  position: fixed; left: var(--gutter); top: 12px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--paper);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.display {
  margin: 0;
  font-weight: 200;
  font-size: clamp(42px, 7vw, 116px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--gutter);
  color: var(--ink);
  transition: color .35s var(--ease), background-color .35s var(--ease);
}
.site-header.on-dark { color: var(--on-dark); }
.site-header.solid:not(.on-dark) { background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.wordmark { font-size: 17px; letter-spacing: 0.01em; font-weight: 300; }
.wordmark b { letter-spacing: 0.04em; }
.wordmark b { font-weight: 600; }
.wordmark .dot { color: var(--accent); font-weight: 600; }
.site-nav { display: flex; align-items: center; gap: clamp(16px, 2vw, 30px); font-size: 16px; }
.site-nav a { position: relative; padding: 10px 0; }
.site-nav a::after, .site-footer nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.lang { display: inline-flex; gap: 10px; margin-left: 6px; }
.lang a { opacity: .55; }
.lang a[aria-current="true"] { opacity: 1; }
.lang a::after { display: none; }

.menu-toggle {
  display: none; min-height: 44px; padding: 0 2px;
  background: none; border: 0; cursor: pointer; font-size: 16px;
}
.menu-sheet {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 32px;
  padding: 96px var(--gutter) 40px;
  background: var(--night); color: var(--on-dark);
}
.menu-sheet[hidden] { display: none; }
.menu-sheet nav { display: flex; flex-direction: column; }
.menu-sheet nav a { font-size: clamp(40px, 12vw, 64px); line-height: 1.15; font-weight: 200; letter-spacing: -0.03em; }
.menu-sheet .lang { font-size: 18px; margin: 0; }
.menu-sheet .lang a { padding: 10px 4px; }
body.menu-open { overflow: hidden; }
body.menu-open .site-header { color: var(--on-dark); background: none; backdrop-filter: none; }

@media (max-width: 760px) {
  .site-nav { display: none; }
  .menu-toggle { display: block; }
}

/* ---------------------------------------------------------------- full-screen panels */

.stack { position: relative; }
.panel {
  position: relative; display: grid; place-items: center;
  height: 100vh; height: 100svh; min-height: 520px;
  overflow: hidden; color: var(--on-dark); background: var(--night);
}
.stack .panel { position: sticky; top: 0; }
.panel > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.04); transition: transform 1.6s var(--ease);
}
.panel.is-in > img { transform: scale(1); }
a.panel:hover > img { transform: scale(1.015); }
.panel-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.12) 40%, rgba(0,0,0,.36)); }
.panel-title {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 0 var(--gutter); text-align: center; text-wrap: balance;
}
.panel-name { font-size: clamp(40px, 6.4vw, 104px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 200; }
.panel-meta { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.panel-intro .display { text-shadow: 0 1px 30px rgba(0,0,0,.18); }
.hero-sub { max-width: 34ch; margin: 10px 0 0; font-size: 17px; opacity: .92; }

.js .panel-title > * { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .panel.is-in .panel-title > * { opacity: 1; transform: none; }
.js .panel.is-in .panel-title > *:nth-child(2) { transition-delay: .12s; }

.corner {
  position: fixed; bottom: 18px; z-index: 30; margin: 0;
  font-size: 13px; line-height: 1.45; color: var(--on-dark);
  transition: opacity .4s var(--ease);
}
.corner-left { left: var(--gutter); display: flex; flex-direction: column; }
.corner-left a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.corner-right { right: var(--gutter); display: flex; align-items: center; gap: 10px; }
.mouse { width: 14px; height: 22px; border: 1px solid currentColor; border-radius: 8px; position: relative; }
.mouse::after { content: ""; position: absolute; left: 50%; top: 5px; width: 2px; height: 4px; margin-left: -1px; background: currentColor; border-radius: 1px; animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(-2px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(6px); } }
.corner.is-hidden { opacity: 0; pointer-events: none; }

.home-end {
  position: relative; z-index: 2; background: var(--paper);
  display: flex; flex-direction: column; align-items: flex-start; gap: 36px;
  padding: clamp(96px, 16vw, 200px) var(--gutter) clamp(72px, 10vw, 140px);
}

.pill {
  display: inline-flex; align-items: center; gap: 12px; min-height: 48px;
  padding: 0 24px; border: 1px solid currentColor; border-radius: 999px;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.pill:hover { background: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------- inner pages */

.page-intro { padding: clamp(120px, 16vw, 200px) var(--gutter) clamp(32px, 5vw, 64px); }
.lede { max-width: 46ch; margin: 22px 0 0; font-size: 18px; color: var(--ink-soft); }
.page-intro .lede { font-size: clamp(18px, 1.6vw, 21px); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.filters button {
  min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; cursor: pointer; font-size: 15px;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.filters button sup { font-size: 10px; margin-left: 2px; }
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.grid {
  list-style: none; margin: 0; padding: 0 var(--gutter) clamp(80px, 10vw, 140px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 3vw, 44px) clamp(12px, 1.4vw, 20px);
}
.card[hidden] { display: none; }
.card a { display: block; }
.card-photo { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--paper-2); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.card a:hover .card-photo img { transform: scale(1.035); }
.card-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 12px; }
.card-name { font-size: 18px; }
.card-cat { font-size: 13px; color: var(--ink-soft); }
.js .card { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .card.is-in { opacity: 1; transform: none; }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } .card-photo { aspect-ratio: 4 / 3.4; } }

/* project page */
.project-info {
  display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 40px clamp(24px, 5vw, 80px);
  padding: clamp(64px, 9vw, 130px) var(--gutter);
}
.meta { margin: 0; display: grid; gap: 18px; align-content: start; }
.meta div { border-top: 1px solid var(--line); padding-top: 10px; }
.meta dt { font-size: 13px; color: var(--ink-soft); }
.meta dd { margin: 2px 0 0; }
.statement { margin: 0; font-size: clamp(24px, 2.6vw, 40px); line-height: 1.25; letter-spacing: -0.025em; font-weight: 200; max-width: 30ch; text-wrap: pretty; }
.statement-xl { font-size: clamp(30px, 4.2vw, 64px); max-width: 24ch; line-height: 1.12; }
@media (max-width: 760px) { .project-info { grid-template-columns: 1fr; } .meta { order: 2; } }

.block { padding: 0 var(--gutter) clamp(64px, 8vw, 120px); display: grid; gap: clamp(12px, 1.4vw, 20px); }
.block-title { margin: 0 0 4px; font-size: 13px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.block .lede { margin: 0 0 18px; }

.gallery-row { display: grid; gap: clamp(12px, 1.4vw, 20px); }
.gallery-row.row-2 { grid-template-columns: 1fr 1fr; }
.gallery-row figure, .compare-figure, .plan, .studio-image { margin: 0; }
.gallery-row img { width: 100%; background: var(--paper-2); }
.gallery-row.row-1 img { max-height: 92vh; object-fit: cover; }
.gallery-row.row-2 img { aspect-ratio: 3 / 2; object-fit: cover; }
figcaption { display: flex; justify-content: space-between; gap: 16px; padding-top: 10px; font-size: 13px; color: var(--ink-soft); }
@media (max-width: 640px) { .gallery-row.row-2 { grid-template-columns: 1fr; } }
.js .gallery-row, .js .compare-figure, .js .plan { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .is-in.gallery-row, .js .is-in.compare-figure, .js .is-in.plan { opacity: 1; transform: none; }

.compare { position: relative; overflow: hidden; background: var(--paper-2); aspect-ratio: 3 / 2; max-height: 92vh; width: 100%; touch-action: pan-y; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-after { clip-path: inset(0 0 0 var(--split)); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--split); width: 1px; background: var(--on-dark); pointer-events: none; }
.compare-handle::after {
  content: "↔"; position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--on-dark); color: var(--ink); font-size: 18px;
}
.compare-tag { position: absolute; top: 16px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--ink); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
.compare-tag.is-before { left: 16px; }
.compare-tag.is-after { right: 16px; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare input:focus-visible + .compare-handle, .compare:focus-within .compare-handle::after { outline: 2px solid var(--ink); }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(12px, 1.4vw, 20px); }
.plan img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--paper); padding: 16px; border: 1px solid var(--line); }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li { border-bottom: 1px solid var(--line); }
.rows a { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 64px; font-size: clamp(18px, 1.8vw, 24px); transition: padding .3s var(--ease); }
.rows a:hover { padding-left: 10px; }
.rows.plain li { padding: 14px 0; font-size: 18px; }

.panel-next { min-height: 70vh; height: 70svh; }

/* spaces */
.tour-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tour-row { display: grid; grid-template-columns: 120px 1fr 1.4fr; gap: 20px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.tour-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-2); }
.tour-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tour-name { display: block; font-size: 20px; }
.tour-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.tour-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; transition: border-color .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease); }
.tour-links a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (max-width: 760px) {
  .tour-row { grid-template-columns: 88px 1fr; }
  .tour-links { grid-column: 1 / -1; justify-content: flex-start; }
}

/* studio */
.studio-image { padding: 0 var(--gutter); }
.studio-image img { width: 100%; max-height: 88vh; object-fit: cover; }
.studio-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px clamp(24px, 6vw, 96px); padding: clamp(64px, 9vw, 130px) var(--gutter); }
.studio-copy p { margin: 0 0 1.1em; font-size: clamp(18px, 1.5vw, 21px); max-width: 44ch; }
.studio-grid .block-title { margin-top: 0; }
.studio-grid .rows + .block-title { margin-top: 48px; }
.text-link { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (max-width: 760px) { .studio-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- footer */

.site-footer { position: relative; z-index: 2; background: var(--black); color: var(--on-dark); padding: clamp(56px, 8vw, 100px) var(--gutter) 24px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px; align-items: start; }
.footer-grid .wordmark { font-size: clamp(28px, 3.4vw, 48px); }
.site-footer nav { display: flex; flex-direction: column; align-items: flex-start; }
.site-footer nav a { position: relative; padding: 6px 0; font-size: 18px; }
.site-footer nav a:hover::after { transform: scaleX(1); }
.footer-grid p { margin: 0; color: rgba(255,255,255,.72); }
.footer-grid p a { color: var(--on-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: clamp(56px, 8vw, 100px); padding-top: 18px; border-top: 1px solid rgba(255,255,255,.16); font-size: 13px; color: rgba(255,255,255,.6); }
.footer-bottom a { padding: 10px 0; margin: -10px 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
  .js .panel-title > *, .js .card, .js .gallery-row, .js .compare-figure, .js .plan { opacity: 1; transform: none; }
  .panel > img { transform: none; }
}

/* 360° equirectangular frames: always shown whole, never cropped */
.compare.is-pano, .gallery-row.is-pano img { aspect-ratio: 2 / 1; max-height: none; }
.gallery-row.is-pano img { object-fit: contain; }

/* The hero sits on a bright interior: a deeper shade keeps the white title readable. */
.panel-intro .panel-shade { background: radial-gradient(ellipse at center, rgba(0,0,0,.46), rgba(0,0,0,.22) 70%), linear-gradient(180deg, rgba(0,0,0,.3), transparent 30%, rgba(0,0,0,.35)); }

/* The opening title never waits for the reveal observer: it is the first thing on the page,
   so it fades in on load by itself and is fully visible even if scripts run late. */
.js .panel-intro .panel-title > * { opacity: 1; transform: none; animation: hero-in 1s var(--ease) both; }
.js .panel-intro .panel-title > *:nth-child(2) { animation-delay: .15s; }
@keyframes hero-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
