/* ————————————————————————————————
   LIVA — gateway landing
   Editorial minimal: paper, hairlines, thin geometric caps.
   ———————————————————————————————— */

@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/jost-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/jost-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/jost-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --paper: #fbfaf7;
  --ink: #1a1917;
  --ink-soft: #6f6b63;
  --hairline: #e4e0d7;
  --ground: #d9d6cf;
  --fold-ms: 700ms;
  --fold-ease: cubic-bezier(.6, .05, .25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

html, body { height: 100%; }

body {
  font-family: 'Jost', 'Futura', 'Avenir Next', 'Helvetica Neue', system-ui, sans-serif;
  font-weight: 300;
  background: var(--ground);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ——— panel grid ——— */

.panels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 100vh;
  height: 100dvh;
  perspective: 1600px;
}

.panel {
  position: relative;
  overflow: hidden;
  display: block;
  text-decoration: none;
  color: inherit;
  border-right: 1px solid var(--hairline);
  background: var(--panel-bg, var(--paper));
  outline: none;
}
.panel:last-child { border-right: 0; }

.panel:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -6px;
}

/* ——— revealed content (behind the face) ——— */

.panel-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.photo {
  flex: 1 1 auto;
  min-height: 0;
  background-color: var(--panel-bg, var(--paper));
  background-size: cover;
  background-position: center;
  /* photo layer on top; soft top light shows through if the file is missing */
  background-image: var(--img, none), linear-gradient(to bottom, rgba(255,255,255,.28), rgba(255,255,255,0) 45%);
}

.panel-text {
  flex: 0 0 auto;
  background: var(--paper);
  border-top: 1px solid var(--hairline);
  padding: clamp(1rem, 2.2vh, 1.6rem) clamp(1rem, 1.6vw, 1.6rem) calc(clamp(1rem, 2.2vh, 1.6rem) + env(safe-area-inset-bottom, 0px));
}

.panel-text h2 {
  font-weight: 300;
  font-size: clamp(.95rem, 1.05vw + .4rem, 1.3rem);
  text-transform: uppercase;
  letter-spacing: .09em;
  margin-bottom: .5em;
}

.panel-text p {
  font-weight: 300;
  font-size: clamp(.82rem, .6vw + .5rem, .95rem);
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 1.1em;
  min-height: 3em;
}

.visit {
  display: flex;
  align-items: baseline;
  gap: .45em;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  border-top: 1px solid var(--hairline);
  padding-top: .9em;
}
.visit .arrow {
  font-size: .9em;
  transition: transform .3s var(--fold-ease);
}
.panel:hover .visit .arrow,
.panel.is-open .visit .arrow { transform: translate(.15em, -.15em); }
.visit .domain {
  margin-left: auto;
  color: var(--ink-soft);
  letter-spacing: .05em;
  text-transform: lowercase;
  font-size: .72rem;
}

/* ——— the letter face ——— */

.panel-face {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  transform-origin: top center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  transition: transform var(--fold-ms) var(--fold-ease);
}

/* shading that deepens as the face tilts away */
.panel-face::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(26,25,23,0), rgba(26,25,23,.22));
  opacity: 0;
  transition: opacity var(--fold-ms) var(--fold-ease);
}

.glyph {
  font-weight: 200;
  font-size: min(38vh, 17vw);
  line-height: 1;
  letter-spacing: .02em;
  user-select: none;
  -webkit-user-select: none;
}

.caption {
  white-space: pre-line;
  position: absolute;
  left: clamp(1rem, 1.6vw, 1.6rem);
  bottom: calc(clamp(1.1rem, 2.6vh, 1.8rem) + env(safe-area-inset-bottom, 0px));
  font-weight: 300;
  font-size: clamp(.9rem, .95vw + .35rem, 1.25rem);
  text-transform: uppercase;
  letter-spacing: .08em;
  line-height: 1.35;
}

.face-top {
  position: absolute;
  top: clamp(1.1rem, 2.6vh, 1.8rem);
  left: clamp(1rem, 1.6vw, 1.6rem);
  font-size: .8rem;
  letter-spacing: .06em;
}
.brand {
  display: flex;
  align-items: center;
  gap: .4em;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 400;
}
.logo-mark {
  display: block;
  width: 24px;
  height: 24px;
}
.tagline {
  white-space: pre-line;
  line-height: 1.45;
  color: var(--ink-soft);
}
.asterisk {
  left: auto;
  right: clamp(1rem, 1.6vw, 1.6rem);
  font-size: 1.4rem;
}

/* ——— fold states ——— */

.panel.is-open .panel-face,
.panel:focus-visible .panel-face {
  transform: rotateX(-88deg);
}
.panel.is-open .panel-face::after,
.panel:focus-visible .panel-face::after {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .panel:hover .panel-face { transform: rotateX(-88deg); }
  .panel:hover .panel-face::after { opacity: 1; }
}

/* ——— intro: letters settle in, staggered ——— */

.glyph, .caption, .face-top {
  animation: rise .9s var(--fold-ease) backwards;
}
.panel:nth-child(1) .glyph, .panel:nth-child(1) .caption, .panel:nth-child(1) .face-top { animation-delay: .05s; }
.panel:nth-child(2) .glyph, .panel:nth-child(2) .caption, .panel:nth-child(2) .face-top { animation-delay: .15s; }
.panel:nth-child(3) .glyph, .panel:nth-child(3) .caption, .panel:nth-child(3) .face-top { animation-delay: .25s; }
.panel:nth-child(4) .glyph, .panel:nth-child(4) .caption, .panel:nth-child(4) .face-top { animation-delay: .35s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ——— language switcher ——— */

.lang {
  position: fixed;
  top: calc(clamp(.9rem, 2.2vh, 1.5rem) + env(safe-area-inset-top, 0px));
  right: calc(clamp(.9rem, 1.4vw, 1.4rem) + env(safe-area-inset-right, 0px));
  z-index: 10;
}

#lang-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-weight: 400;
  font-size: .78rem;
  letter-spacing: .1em;
  color: var(--ink);
  background: rgba(251, 250, 247, .85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: .45em 2em .45em 1em;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'><path d='M1 1l3 3 3-3' fill='none' stroke='%231a1917' stroke-width='1'/></svg>");
  background-repeat: no-repeat;
  background-position: right .8em center;
}
#lang-select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ——— small screens: 2 × 2, wordmark reads LI / VA ——— */

@media (max-width: 719px) {
  .panels {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    perspective: 1100px;
  }
  .panel { border-bottom: 1px solid var(--hairline); }
  .panel:nth-child(2n) { border-right: 0; }
  .panel:nth-child(n+3) { border-bottom: 0; }
  .glyph { font-size: min(24vh, 32vw); }
  .caption { font-size: .82rem; }
  .face-top { font-size: .72rem; }
  .tagline { display: none; }
  .panel-text { padding-bottom: clamp(1rem, 2.2vh, 1.6rem); }
  .panel:nth-child(n+3) .panel-text {
    padding-bottom: calc(clamp(1rem, 2.2vh, 1.6rem) + env(safe-area-inset-bottom, 0px));
  }
  .panel-text p { min-height: 0; }
  .visit .domain { display: none; }
}

/* ——— reduced motion: crossfade instead of fold ——— */

@media (prefers-reduced-motion: reduce) {
  .glyph, .caption, .face-top { animation: none; }
  .panel-face {
    transition: opacity .35s ease;
    transform: none !important;
  }
  .panel.is-open .panel-face,
  .panel:focus-visible .panel-face { opacity: 0; }
  .panel-face::after { display: none; }
}

@media (prefers-reduced-motion: reduce) and (hover: hover) and (pointer: fine) {
  .panel:hover .panel-face { opacity: 0; }
}
