/* latin-ext */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/bricolage-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/bricolage-600-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;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/plexmono-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/plexmono-500-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;
}

:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); box-sizing: border-box; }

/* Layout: one screen. A live contour map fills the viewport; the S monogram is its summit,
   the wordmark sits under it, two entrances rise at the bottom centre and open a sign-in panel. */
:root {
  --ground: #070B0A;      /* night ground, green-biased black */
  --ground-lift: #0D1714; /* faint lift behind the mark */
  --contour: #5FB597;     /* SKAVA accent, every isoline */
  --contour-hi: #A8EBCF;  /* crest of the wave on the wordmark */
  --ink: #E6ECE7;         /* wordmark, field text */
  --muted: #8D9B93;       /* labels at rest */
  --faint: #7A877F;       /* legal line, footnotes */
  --rim: rgba(230, 236, 231, 0.16);
  --glass: rgba(9, 15, 13, 0.46);
  --panel: rgba(8, 14, 12, 0.88);
  --field: #0A1210;
  --field-line: #2A3832;
  --on-accent: #04110C;
  --accent-hover: #74C7A9;
  --danger: #EE9A8B;
  --warn: #E7C27C;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 42%, var(--ground-lift) 0%, var(--ground) 62%) var(--ground);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
#field { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 45%, transparent 55%, rgba(3, 5, 4, 0.72) 100%);
}
.veil::after { /* film grain */
  content: ""; position: absolute; inset: 0; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.stage {
  position: relative; z-index: 2;
  height: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: 1fr auto auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 clamp(14px, 3.2vh, 30px);
  transition: opacity .5s ease, filter .5s ease;
}
.modal-open .stage { opacity: 0.3; filter: blur(2px); }
.lockup {
  align-self: center; justify-self: center;
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(20px, 3.4vh, 34px);
  transform: translateY(-1.5vh);
}
.mark-slot { height: clamp(150px, 33vh, 340px); aspect-ratio: 302 / 358; max-width: 62vw; }

/* wordmark: tracks in, then a green wave rolls through the letters */
.word {
  margin: 0;
  font: 600 clamp(19px, 1.4vw + 10px, 32px)/1 var(--display);
  font-variation-settings: "opsz" 96;
  letter-spacing: 0.5em; padding-left: 0.5em;
  color: transparent;
  background-image: linear-gradient(100deg, var(--ink) 0 34%, var(--contour) 43%, var(--contour-hi) 50%, var(--contour) 57%, var(--ink) 66% 100%);
  background-size: 300% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  animation: track-in 2.2s cubic-bezier(.16, .8, .14, 1) .7s both, wave 6.5s ease-in-out 3.4s infinite;
}
@keyframes track-in {
  from { letter-spacing: 1.25em; padding-left: 1.25em; opacity: 0; filter: blur(10px); }
  to   { letter-spacing: 0.5em;  padding-left: 0.5em;  opacity: 1; filter: blur(0); }
}
@keyframes wave {
  0%        { background-position: 100% 0; }
  46%, 100% { background-position: 0% 0; }
}

/* entrances surface one after another, slowly, as if rising out of the map */
.doors {
  justify-self: center;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
}
@keyframes surface {
  from { opacity: 0; transform: translateY(40px); filter: blur(10px); }
  55%  { opacity: 1; }
  to   { opacity: 1; transform: none; filter: none; }
}
.door {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 0; margin: 0;
  padding: 13px 18px 13px 16px;
  border: 1px solid var(--rim); border-radius: 3px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(130%); backdrop-filter: blur(12px) saturate(130%);
  color: var(--muted); cursor: pointer;
  font: 500 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  transition: color .35s, border-color .35s, background-color .35s;
  -webkit-tap-highlight-color: transparent;
  animation: surface 2.6s cubic-bezier(.16, .8, .24, 1) 2s both;
}
.door + .door { animation-delay: 2.9s; }
.door svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.door:hover, .door:focus-visible { color: var(--ink); border-color: rgba(95, 181, 151, 0.55); background-color: rgba(14, 28, 23, 0.6); }
.door:focus-visible { outline: 1px solid var(--contour); outline-offset: 3px; }

.legal {
  justify-self: center; margin: 0;
  padding-top: clamp(14px, 2.6vh, 24px);
  font: 500 10px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); text-align: center;
  font-variant-numeric: tabular-nums;
}
.legal .sep { padding-inline: 0.6em; opacity: 0.6; }

/* sign-in panel */
.modal {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-items: center;
  box-sizing: border-box;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
.scrim {
  position: fixed; inset: 0;
  background: rgba(3, 6, 5, 0.4);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  animation: fade .45s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
.panel {
  position: relative;
  width: min(100%, 384px); box-sizing: border-box;
  display: grid; gap: 16px;
  padding: 26px 26px 18px;
  background: var(--panel);
  border: 1px solid var(--rim); border-radius: 6px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  animation: panel-in .6s cubic-bezier(.16, .8, .24, 1) both;
}
.panel-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding-bottom: 4px; }
.shield {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(95, 181, 151, 0.45);
  color: var(--contour);
}
.shield svg, .x svg, .eye svg, .tls svg { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.shield svg { width: 17px; height: 17px; }
.eyebrow { margin: 0; font: 500 10px/1.2 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.panel h2 { margin: 5px 0 0; font: 600 21px/1.15 var(--display); font-variation-settings: "opsz" 48; color: var(--ink); text-wrap: balance; }
.x {
  align-self: start;
  width: 34px; height: 34px; margin: -6px -8px 0 0; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 4px;
  color: var(--muted); cursor: pointer;
}
.x svg { width: 16px; height: 16px; }
.x:hover, .x:focus-visible { color: var(--ink); background: rgba(230, 236, 231, 0.06); }
.x:focus-visible, .eye:focus-visible { outline: 1px solid var(--contour); }

.fld { display: grid; gap: 7px; min-width: 0; }
.fld label { font: 500 10.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.fld input {
  width: 100%; height: 46px; box-sizing: border-box; margin: 0;
  padding: 0 14px;
  background: var(--field); color: var(--ink);
  border: 1px solid var(--field-line); border-radius: 4px;
  font: 500 15px/1 var(--mono); letter-spacing: 0.02em;
  transition: border-color .2s, box-shadow .2s;
}
.fld input:focus { outline: none; border-color: var(--contour); box-shadow: 0 0 0 3px rgba(95, 181, 151, 0.18); }
.fld input:disabled { opacity: 0.5; }
.pw { position: relative; }
.pw input { padding-right: 50px; }
.eye {
  position: absolute; top: 5px; right: 5px;
  width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 3px;
  color: var(--muted); cursor: pointer;
}
.eye svg { width: 18px; height: 18px; }
.eye:hover { color: var(--ink); }
.eye .off { display: none; }
.eye[aria-pressed="true"] .on { display: none; }
.eye[aria-pressed="true"] .off { display: inline; }

.note { margin: -6px 0 0; font: 500 11.5px/1.45 var(--mono); }
.caps { color: var(--warn); }
.msg { color: var(--danger); }

.go {
  height: 48px; margin: 2px 0 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--contour); color: var(--on-accent);
  border: 0; border-radius: 4px; cursor: pointer;
  font: 500 12px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase;
  transition: background-color .2s, opacity .2s;
}
.go:hover:not(:disabled) { background: var(--accent-hover); }
.go:focus-visible { outline: 2px solid var(--contour-hi); outline-offset: 2px; }
.go:disabled { opacity: 0.6; cursor: default; }
.spin { display: none; width: 13px; height: 13px; box-sizing: border-box; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.go.is-busy .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.panel-foot {
  display: grid; gap: 7px;
  margin-top: 2px; padding-top: 14px;
  border-top: 1px solid rgba(230, 236, 231, 0.08);
  font: 500 10px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint);
}
.tls { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.tls svg { width: 12px; height: 12px; color: var(--contour); }

@media (max-width: 520px) {
  .doors { flex-direction: column; align-items: stretch; width: min(100%, 270px); }
  .panel { padding: 22px 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .word, .door, .panel, .scrim { animation: none; }
  .stage { transition: none; }
}
