/* ---------------------------------------------------
   Fonts (self-hosted — see /assets/fonts)
   font-display: block means the browser waits briefly for the real font
   rather than painting text in a fallback and swapping later. Combined
   with the <link rel="preload"> tags in index.html and these files being
   tiny (under 30KB each) and same-origin, that wait is effectively never
   noticeable — the goal is every visit rendering in the actual typeface,
   not a flash of Arial/Helvetica first.
--------------------------------------------------- */
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-200.woff2") format("woff2");
  font-weight: 200;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

/* ---------------------------------------------------
   Tokens
--------------------------------------------------- */
:root {
  --color-bg: #ffffff;
  --color-ink: #161513;
  --color-mute: #8a8172;
  --color-line: #e6e1d6;
  --color-accent: #a9876a;

  --font-display: "Archivo", sans-serif;
  --font-light: "Jost", sans-serif;
  --font-body: "Jost", sans-serif;

  --header-h: 96px;
  --gutter: clamp(24px, 5vw, 72px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------------------------------------------
   Header
--------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  background: var(--color-bg);
  z-index: 10;
}

/* Real heading text for search engines and screen readers, without
   changing pages that are intentionally led by an image (the wordmark)
   rather than a visible text headline. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mark { display: block; width: 56px; height: 56px; }
.mark-icon { width: 100%; height: 100%; object-fit: contain; }

html.is-home .mark { visibility: hidden; }

.site-nav {
  display: flex;
  gap: 28px;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.site-nav a {
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  border-bottom-color: var(--color-ink);
}

/* ---------------------------------------------------
   Main / app
--------------------------------------------------- */
.app {
  flex: 1;
  padding-top: var(--header-h);
  width: 100%;
  display: flex;
  flex-direction: column;
}

.route-projects .app,
.route-project .app {
  display: block;
}

/* ---------------------------------------------------
   Home
--------------------------------------------------- */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px var(--gutter);
}

/* Home is a single static screen — no scrolling, not even by a few px. */
body.route-home {
  height: 100vh;
  overflow: hidden;
}

.wordmark-img {
  width: 340px;
  width: clamp(220px, 30vw, 420px);
  height: auto;
}

.wordmark-img--small {
  width: min(70vw, 320px);
}

/* ---------------------------------------------------
   Projects grid
--------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 4px;
  padding: 64px var(--gutter) 96px;
}

.project-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f2f0ea;
}

.project-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: grayscale(1);
}

.project-card:hover .project-card-image {
  transform: scale(1.03);
  filter: grayscale(0);
}

.project-card-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: #fff;
  font-weight: 500;
  font-size: 1.1rem;
  background: rgba(20, 18, 15, 0);
  transition: background 0.3s ease;
}

.project-card:hover .project-card-title {
  background: rgba(20, 18, 15, 0.35);
}

/* ---------------------------------------------------
   Project detail
--------------------------------------------------- */
.project-detail {
  max-width: 1400px;
  margin: 0 auto;
  padding: 56px var(--gutter) 120px;
}

.project-detail-header {
  margin-bottom: 40px;
}

.project-detail-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  margin: 0;
}

.project-location {
  margin: 8px 0 0;
  color: var(--color-mute);
  font-size: 0.95rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.gallery-image--wide { grid-column: 1 / -1; }

.gallery-image img { width: 100%; height: 100%; object-fit: cover; }

.plans {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.plan-box {
  border: 1px solid var(--color-line);
  padding: 24px;
}

.plan-label {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--color-mute);
}

.back-link {
  display: inline-block;
  margin-top: 56px;
  font-size: 0.85rem;
  color: var(--color-mute);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.back-link:hover { border-color: var(--color-mute); }

/* ---------------------------------------------------
   Contact
--------------------------------------------------- */
.contact {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 28px;
  padding: 48px var(--gutter);
}

.contact-line {
  margin: 0;
  font-size: 1rem;
}

.contact-line a { border-bottom: 1px solid var(--color-line); }
.contact-line a:hover { border-color: var(--color-ink); }

/* ---------------------------------------------------
   Not found
--------------------------------------------------- */
.not-found {
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

/* ---------------------------------------------------
   Footer
--------------------------------------------------- */
.site-footer {
  padding: 32px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.socials {
  display: flex;
  gap: 14px;
}

.socials a {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.socials a:hover { background: var(--color-accent); }

.socials svg { width: 15px; height: 15px; fill: #fff; }

.copyright {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--color-mute);
  letter-spacing: 0.01em;
}

/* ---------------------------------------------------
   Responsive
--------------------------------------------------- */
@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery-image--wide { grid-column: auto; }
  .site-nav { gap: 18px; }
}
