/* ---- shared foundation ---- */
:root {
  --bg: #0a0908;
  --ink: #e8e4db;
  --cap: #7a7268;
  --hl: #c4b49a;
  --div: rgba(196, 180, 154, .12);
  --gap: clamp(1.1rem, 3vw, 2.5rem);
  --font-display: 'Cutive Mono', 'Courier Prime', 'Courier New', monospace;
  --font-main: 'Courier Prime', 'Courier New', monospace;
  --font-ui: 'IBM Plex Mono', 'Courier New', monospace;
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; background: var(--bg); color: var(--ink); overflow-x: clip; }
body { min-width: 320px; font-family: var(--font-main); background: var(--bg); color: var(--ink); overflow-x: hidden; }
body.scroll-locked { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; -webkit-user-drag: none; }
a { color: inherit; text-decoration: none; }
button { background: none; border: 0; color: inherit; font: inherit; }

.skip-link { position: fixed; top: .75rem; left: .75rem; z-index: 1000; transform: translateY(-140%); background: var(--ink); color: var(--bg); padding: .6rem .8rem; font-family: var(--font-ui); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; transition: transform .2s ease; }
.skip-link:focus { transform: translateY(0); }

#main-nav { position: fixed; inset: 0 0 auto; z-index: 100; display: flex; justify-content: center; padding: 1rem var(--gap); background: rgba(10, 9, 8, .82); border-bottom: 1px solid rgba(80, 74, 66, .45); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1400px; min-width: 0; gap: 1rem; }
.nav-name { font-size: clamp(.98rem, 1.8vw, 1.16rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; align-items: center; gap: clamp(.9rem, 2.2vw, 1.6rem); }
.nav-links a, .lang-btn, .lang-sep, .mob-menu-btn, .mob-close-btn { font-family: var(--font-ui); font-weight: 300; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.nav-links a, .lang-btn { opacity: .82; transition: opacity .2s ease, color .2s ease; cursor: pointer; }
.nav-links a:hover, .lang-btn:hover, .lang-btn.active, .nav-links a.active { opacity: 1; }
.nav-links a.active { color: var(--hl); }
.lang-sep { opacity: .4; }
.mob-menu-btn { display: none; opacity: .9; cursor: pointer; }
.mob-overlay { display: none; position: fixed; inset: 0; z-index: 200; background: var(--bg); flex-direction: column; align-items: center; justify-content: center; gap: 2.2rem; }
.mob-overlay.open { display: flex; }
.mob-overlay a { font-size: clamp(2rem, 8vw, 4rem); opacity: .88; }
.mob-close-btn { position: absolute; top: 1.1rem; right: var(--gap); color: var(--cap); cursor: pointer; }
.mob-lang { display: flex; gap: 1.5rem; margin-top: .5rem; }
.mob-lang button { font-family: var(--font-ui); font-size: .72rem; letter-spacing: .12em; color: var(--cap); cursor: pointer; }
.mob-lang button.active { color: var(--ink); }

footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.75rem var(--gap); border-top: 1px solid var(--div); font-family: var(--font-ui); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--cap); }
.footer-links { display: flex; gap: 1.4rem; }
.footer-links a:hover { color: var(--ink); }
.btt { position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 90; width: 40px; height: 40px; display: grid; place-items: center; background: rgba(10,9,8,.72); border: 1px solid rgba(196,180,154,.18); border-radius: 50%; color: var(--cap); opacity: 0; visibility: hidden; cursor: pointer; transition: opacity .25s ease, visibility .25s ease, color .2s ease; }
.btt.visible { opacity: 1; visibility: visible; }
.btt:hover { color: var(--ink); }
.photo-frame::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.load-error { max-width: 1380px; margin: 0 auto; color: #c47a6a; }

.lightbox { position: fixed; inset: 0; z-index: 500; display: none; align-items: center; justify-content: center; background: rgba(6, 5, 4, .97); padding: clamp(3.6rem, 6vw, 5rem) clamp(1rem, 4vw, 3.5rem) clamp(2rem, 4vw, 3rem); animation: lightbox-fade .25s ease both; }
.lightbox.open { display: flex; }
.lightbox-figure { display: grid; gap: 1rem; max-width: 100%; max-height: 100%; align-content: center; justify-items: center; margin: 0; }
.lightbox-frame { position: relative; display: grid; place-items: center; max-width: min(94vw, 1700px); max-height: 80svh; cursor: zoom-in; touch-action: pan-y; }
.lightbox-frame img { max-width: 100%; max-height: 80svh; width: auto; height: auto; opacity: 0; transform: scale(.985); transition: opacity .35s ease, transform .35s ease; user-select: none; }
.lightbox-frame.loaded img { opacity: 1; transform: scale(1); }
.lightbox.zoomed { overflow: auto; align-items: flex-start; padding: clamp(3.6rem, 6vw, 5rem) 0 0; }
.lightbox.zoomed .lightbox-figure { gap: 0; }
.lightbox.zoomed .lightbox-frame { cursor: zoom-out; max-width: none; max-height: none; touch-action: auto; }
.lightbox.zoomed .lightbox-frame img { max-width: none; max-height: none; width: auto; height: auto; }
.lightbox-topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 520; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1rem, 3vw, 1.6rem); background: linear-gradient(to bottom, rgba(6,5,4,.65), rgba(6,5,4,0)); pointer-events: none; }
.lightbox-counter { font-family: var(--font-ui); font-size: .72rem; letter-spacing: .18em; color: var(--cap); }
.lightbox-actions { display: flex; gap: .55rem; pointer-events: auto; }
.lightbox-action { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border: 1px solid rgba(196, 180, 154, .22); border-radius: 999px; color: var(--ink); background: rgba(10, 9, 8, .42); cursor: pointer; font-size: 1.15rem; line-height: 1; transition: border-color .2s ease, color .2s ease, background .2s ease, transform .15s ease; }
.lightbox-action:hover, .lightbox-action:focus-visible { border-color: rgba(196, 180, 154, .65); background: rgba(10, 9, 8, .7); }
.lightbox-action.lightbox-close { font-size: 1.4rem; }
.lightbox-action[aria-pressed="true"] { color: var(--bg); background: var(--hl); border-color: var(--hl); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 515; width: 3rem; height: 3rem; display: grid; place-items: center; border: 1px solid rgba(196, 180, 154, .22); border-radius: 999px; color: var(--ink); background: rgba(10, 9, 8, .42); cursor: pointer; font-size: 1.6rem; line-height: 1; transition: border-color .2s ease, color .2s ease, background .2s ease, transform .15s ease; }
.lightbox-nav:hover, .lightbox-nav:focus-visible { border-color: rgba(196, 180, 154, .65); background: rgba(10, 9, 8, .7); transform: translateY(-50%) scale(1.04); }
.lightbox-prev { left: clamp(.6rem, 2vw, 1.4rem); }
.lightbox-next { right: clamp(.6rem, 2vw, 1.4rem); }
.lightbox-nav[hidden] { display: none; }

@keyframes shimmer { 0%, 100% { opacity: .28; } 50% { opacity: .58; } }
@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .mob-menu-btn { display: block; flex: 0 0 auto; }
  .nav-name { max-width: calc(100vw - 7rem); }
  footer { align-items: flex-start; flex-direction: column; }
  .lightbox-action { width: 2.4rem; height: 2.4rem; font-size: 1.1rem; }
  .lightbox-action.lightbox-close { font-size: 1.3rem; }
  .lightbox-nav { width: 2.6rem; height: 2.6rem; font-size: 1.4rem; }
  .lightbox-prev { left: .5rem; }
  .lightbox-next { right: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
