@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700;800&display=swap');

@font-face {
  font-family: "Forma Local";
  src: local("Forma DJR Micro Regular"), local("FormaDJRMicro-Regular");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Forma Local";
  src: local("Forma DJR Micro Bold"), local("FormaDJRMicro-Bold");
  font-weight: 600 900;
  font-display: swap;
}

:root {
  --paper: #f5f4ee;
  --ink: #151713;
  --muted: #565a50;
  --line: #caccc1;
  --accent: #d0fa64;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --sans: "forma-djr-micro", "Forma Local", Inter, Arial, sans-serif;
  --gutter: clamp(1.1rem, 5vw, 5rem);
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid #60861a;
  outline-offset: 4px;
}
.hero a:focus-visible, .header:not(.header-static) a:focus-visible, .footer a:focus-visible,
.footer button:focus-visible, .gallery-stage :focus-visible { outline-color: var(--accent); }
.shell { width: min(100% - 2 * var(--gutter), 1320px); margin-inline: auto; }
.mono { font: 500 .72rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; }

.header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem var(--gutter);
  min-height: 72px;
  color: #fff;
  border-bottom: 1px solid #ffffff42;
}
.header-static { position: relative; color: var(--ink); border-color: var(--line); }
.brand { display: inline-flex; align-items: center; justify-self: start; font-weight: 800; letter-spacing: -.045em; white-space: nowrap; }
.brand > span:last-child { margin-left: .24em; font-weight: 500; }
.mark { position: relative; display: inline-block; width: 14px; height: 14px; color: var(--accent); flex: 0 0 14px; }
.brand .mark { margin-right: .52rem; }
.header-static .mark { color: #5a7b19; }
.mark::before, .mark::after { content: ""; position: absolute; background: currentColor; inset: 6px 0; }
.mark::after { inset: 0 6px; }
.header nav { display: flex; gap: clamp(1rem, 3vw, 2.6rem); font-size: .86rem; font-weight: 600; }
.header nav a:hover { text-decoration: underline; text-underline-offset: .3em; }
.languages { display: flex; justify-self: end; gap: .18rem; font: 500 .7rem var(--mono); }
.languages a { padding: .35rem .43rem; border: 1px solid transparent; transition: background .2s, color .2s; }
.languages a:hover { border-color: currentColor; }
.languages a[aria-current] { background: var(--accent); color: var(--ink); }

.hero {
  min-height: 610px;
  min-height: max(610px, 94svh);
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  color: white;
  background: #3d3731;
  padding: 7rem var(--gutter) 8rem;
}
.hero-photo, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero-photo {
  object-fit: cover;
  object-position: 50% 52%;
  opacity: 0;
  z-index: -3;
  transition: opacity 0s 1.05s;
}
.hero-photo.active { opacity: 1; z-index: -2; transition: opacity 1.05s ease-in-out; }
.hero::after {
  content: "";
  z-index: -1;
  background: linear-gradient(180deg,#1617198c,transparent 29%,#16171922 51%,#12131098 100%), #17161b39;
}
.hero-copy { text-align: center; animation: arrive .7s ease both; }
.hero h1 { font-size: clamp(2.35rem, 6.35vw, 7.2rem); line-height: .99; letter-spacing: -.067em; font-weight: 700; text-wrap: balance; }
.frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--frame-color, currentColor);
  padding: .09em .17em .16em;
}
.frame i {
  position: absolute;
  width: .39rem;
  height: .39rem;
  background: var(--frame-fill, var(--paper));
  border: 1px solid var(--frame-color, currentColor);
}
.frame i:nth-child(1) { top: 0; left: 0; transform: translate(-50%, -50%); }
.frame i:nth-child(2) { top: 0; right: 0; transform: translate(50%, -50%); }
.frame i:nth-child(3) { bottom: 0; left: 0; transform: translate(-50%, 50%); }
.frame i:nth-child(4) { bottom: 0; right: 0; transform: translate(50%, 50%); }
.hero .frame { --frame-color: #e6ffc9a8; --frame-fill: var(--accent); }
.hero-bottom {
  position: absolute;
  inset: auto var(--gutter) 1.45rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid #ffffff60;
  padding-top: 1.25rem;
}
.hero-credit:last-child { text-align: right; }
.hero-scroll { display: inline-flex; align-items: center; gap: .75rem; }
.hero-scroll span, .card-arrow, .gallery-expand {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--ink);
  width: 2rem;
  aspect-ratio: 1;
  font: 500 1.1rem var(--sans);
  transition: transform .22s, background .22s;
}
.hero-scroll:hover span { transform: translateY(4px); background: white; }

.catalog { max-width: 1120px; padding-block: clamp(3rem, 8vw, 7rem); }
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: .8rem;
  margin-bottom: 1.3rem;
}
.section-bar h2 { font: inherit; }
.map-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(.7rem, 2vw, 1.6rem); }
.map-card {
  min-width: 0;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 5 / 8;
  overflow: hidden;
  color: white;
  background: var(--ink);
  box-shadow: 0 0 0 1px #15171329;
  transition: box-shadow .25s, transform .25s;
}
.map-card img, .map-card::after { position: absolute; inset: 0; height: 100%; width: 100%; z-index: -2; }
.map-card img { object-fit: cover; object-position: var(--position); transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.map-card::after { content: ""; z-index: -1; background: linear-gradient(180deg,#10120f60,transparent 25%,transparent 42%,#10120ff2); }
.map-card:hover, .map-card:focus-visible { box-shadow: 0 0 0 2px #648123; transform: translateY(-5px); }
.map-card:hover img, .map-card:focus-visible img { transform: scale(1.065); }
.card-number { position: absolute; top: 1rem; left: 1rem; padding: .3rem .48rem; background: #151713dd; }
.card-arrow { position: absolute; top: 1rem; right: 1rem; }
.map-card:hover .card-arrow { transform: translate(2px,-2px); background: white; }
.card-title { display: grid; gap: .5rem; width: 100%; margin: 0 1rem 1.05rem; padding-top: .8rem; border-top: 1px solid #ffffff75; }
.card-name { font-size: clamp(1.6rem, 4.1vw, 4rem); font-weight: 700; line-height: .94; letter-spacing: -.065em; }
.card-setting { color: #efefe5; }
.tagline { text-align: center; margin-top: clamp(2rem, 5vw, 4rem); font-size: clamp(1.4rem, 3.9vw, 3.55rem); text-transform: uppercase; font-weight: 600; letter-spacing: -.055em; line-height: 1.04; text-wrap: balance; }
.tagline .frame { --frame-color: #6b7460; }

.footer { background: var(--ink); color: var(--paper); padding-block: clamp(2.2rem, 6vw, 5rem) 1.5rem; }
.footer .section-bar, .footer-bottom, .contact-links a { border-color: #f5f4ee42; }
.footer-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.4rem; align-items: end; padding-block: clamp(1rem, 5vw, 3.5rem) clamp(2rem, 6vw, 5rem); }
.footer h2 { font: 600 clamp(1.9rem, 4.3vw, 4rem)/1.1 var(--mono); letter-spacing: -.085em; text-wrap: balance; }
.footer p { color: #cbd0c2; margin: 1rem 0 1.35rem; max-width: 38ch; line-height: 1.55; }
.contact-links { display: grid; font-style: normal; min-width: 0; }
.contact-links a { border-top: 1px solid #f5f4ee42; padding-block: .85rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; overflow-wrap: anywhere; transition: color .2s; }
.contact-links a:hover { color: var(--accent); }
.contact-links small { display: block; margin-bottom: .25rem; color: #cbd0c2; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid #f5f4ee42; padding-top: 1rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  border: 1px solid var(--ink);
  padding: .75rem .95rem;
  font-size: .9rem;
  font-weight: 700;
  transition: background .2s, transform .2s, box-shadow .2s;
}
.button-accent { background: var(--accent); color: var(--ink); }
.button:hover { background: #e2ffa0; transform: translateY(-2px); box-shadow: 2px 3px 0 #81a23c; }
.button:active { transform: translateY(1px); box-shadow: none; }

.detail { padding-block: 2.15rem clamp(3rem, 7vw, 6rem); }
.back { display: inline-flex; align-items: center; gap: .55rem; }
.back:hover { text-decoration: underline; text-underline-offset: .3em; }
.detail-intro { display: grid; grid-template-columns: 1.15fr 1fr; align-items: end; gap: 2rem; margin-block: clamp(1.6rem, 4vw, 3.4rem); }
.detail-code { color: var(--muted); margin-bottom: .65rem; }
.detail h1 { font-size: clamp(3rem, 8vw, 8.4rem); font-weight: 800; letter-spacing: -.075em; line-height: .95; }
.detail-info { max-width: 48ch; }
.detail-info p { margin: .6rem 0 1rem; line-height: 1.55; color: var(--muted); }
.gallery-stage { position: relative; background: var(--ink); }
.gallery-stage img { aspect-ratio: 16 / 9; object-fit: contain; }
.gallery-stage a { display: block; }
.gallery-expand, .gallery-arrow { position: absolute; }
.gallery-expand { top: .8rem; right: .8rem; }
.gallery-arrow {
  top: 50%;
  translate: 0 -50%;
  width: clamp(2.25rem, 5vw, 3.2rem);
  aspect-ratio: 1;
  border: 1px solid #ffffff8c;
  background: #151713de;
  color: white;
  transition: background .2s, color .2s;
}
.gallery-arrow:hover { background: var(--accent); color: var(--ink); }
.gallery-prev { left: .8rem; }
.gallery-next { right: .8rem; }
.thumbnails { display: grid; grid-template-columns: repeat(auto-fit,minmax(94px,1fr)); gap: .55rem; margin-top: .75rem; }
.thumb { position: relative; padding: 0; background: var(--ink); color: white; border: 2px solid transparent; opacity: .75; transition: opacity .2s; }
.thumb img { aspect-ratio: 16 / 9; object-fit: cover; }
.thumb span { position: absolute; bottom: 0; left: 0; padding: .17rem .35rem; background: #151713d9; }
.thumb:hover, .thumb[aria-pressed="true"] { opacity: 1; }
.thumb[aria-pressed="true"] { border-color: #6b891f; box-shadow: 0 0 0 1px #6b891f; }
.missing { min-height: 48vh; padding-block: 4rem; }
.missing h1 { margin-bottom: 1rem; }

dialog { width: min(92vw, 540px); max-height: 90vh; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); padding: 1.4rem; }
dialog::backdrop { background: #151713b8; }
.dialog-header { display: flex; justify-content: space-between; gap: .9rem; align-items: start; }
.dialog-header h2 { font-family: var(--mono); line-height: 1.15; }
.dialog-header button { border: 1px solid var(--line); background: transparent; font-size: 1.3rem; padding: .15rem .55rem; }
form label { display: grid; gap: .3rem; margin: 1rem 0; font-weight: 600; }
input, textarea { min-width: 0; width: 100%; background: white; color: var(--ink); border: 1px solid var(--line); padding: .55rem; }
textarea { resize: vertical; }

.arrived { animation: arrive .55s var(--delay,0ms) cubic-bezier(.2,.7,.2,1) backwards; }
@keyframes arrive { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }

.crosshair { display: none; }
.crosshair-active:not(:has(dialog[open])) * { cursor: none !important; }
.crosshair-active:not(:has(dialog[open])) .crosshair {
  display: block;
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 25px;
  height: 25px;
  margin: -12px;
  pointer-events: none;
  mix-blend-mode: difference;
  background:
    linear-gradient(white,white) center 0 / 3px 8px,
    linear-gradient(white,white) center bottom / 3px 8px,
    linear-gradient(white,white) left center / 8px 3px,
    linear-gradient(white,white) right center / 8px 3px,
    linear-gradient(white,white) center / 3px 3px;
  background-repeat: no-repeat;
}

@media (max-width: 760px) {
  .hero { min-height: clamp(520px, 88svh, 780px); }
  .detail-intro, .footer-main { grid-template-columns: 1fr; }
  .contact-links { max-width: 34rem; }
  .card-name { font-size: clamp(1.3rem, 5vw, 2.5rem); }
  .card-title { margin: 0 .55rem .65rem; }
  .card-setting { font-size: .58rem; }
  .card-arrow, .card-number { top: .5rem; }
  .card-number { left: .5rem; }
  .card-arrow { right: .5rem; width: 1.55rem; }
}

@media (max-width: 500px) {
  .header { grid-template-columns: 1fr auto; gap: .5rem; padding-block: .8rem; }
  .header nav { grid-row: 2; grid-column: 1 / -1; }
  .languages { grid-row: 1; grid-column: 2; }
  .hero { min-height: clamp(500px, 84svh, 740px); }
  .hero-bottom { grid-template-columns: 1fr auto; gap: .5rem; }
  .hero-credit:last-child { display: none; }
  .hero-scroll { gap: .4rem; }
  .hero-scroll span { width: 1.55rem; }
  .map-grid { gap: .45rem; }
  .map-card { aspect-ratio: 5 / 9; }
  .card-name { font-size: clamp(.96rem, 4vw, 1.35rem); }
  .card-setting { display: none; }
  .card-title { margin: 0 .38rem .5rem; padding-top: .5rem; }
  .card-number { padding: .2rem .28rem; font-size: .57rem; }
  .card-arrow { width: 1.22rem; font-size: .8rem; }
  .tagline { line-height: 1.15; }
}

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