@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1a1a1a;
  --surface-3: #242424;
  --primary: #ff5540;
  --primary-glow: rgba(255, 85, 64, 0.15);
  --ink: #ffffff;
  --ink-2: #e4e4e7;
  --ink-3: #a1a1aa;
  --ink-4: #71717a;
  --ink-5: #52525b;
  --line: #27272a;
  --line-2: #3f3f46;
  --green: #83fe00;
  --error: #ef4444;

  --font-head: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-label: "Inter", ui-sans-serif, system-ui, sans-serif;

  --pad: clamp(16px, 3vw, 48px);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-head);
  overflow-x: hidden;
}

::selection { background: var(--primary); color: #000; }

a { color: inherit; }

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

/* ---------- small type ---------- */
.label {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.accent { color: var(--primary); }
.mono { font-family: var(--font-label); font-weight: 700; letter-spacing: 0.12em; }

.dot {
  display: inline-block;
  flex: none;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  background: var(--primary);
  vertical-align: middle;
}
.dot-green { background: var(--green); }
.dot-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.dot-pulse.d2 { animation-duration: 2.8s; }
.dot-pulse.d3 { animation-duration: 3.6s; }
.dot-blink { animation: blink 1.8s step-end infinite; }

@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes blink {
  0%, 28%, 40%, 80%, 100% { background: var(--green); box-shadow: 0 0 6px rgba(131, 254, 0, 0.5); }
  15%, 55%, 63%, 95% { background: #fe7d00; box-shadow: 0 0 6px rgba(254, 125, 0, 0.5); }
  22%, 35%, 60%, 90% { background: transparent; box-shadow: none; }
}

/* ---------- background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}
.bg-globe { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; }
.bg-globe.on { opacity: 1; }
.bg-grid {
  position: absolute;
  inset: 0;
  background-size: 50px 50px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
}
.bg-fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 0%, rgba(10, 10, 10, 0.4) 50%, rgba(10, 10, 10, 0.95) 100%);
}

/* ---------- frame ---------- */
.frame {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--pad) var(--pad) calc(var(--pad) + 40px);
  pointer-events: none;
}
.frame a, .frame button { pointer-events: auto; }

.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 1.6vw, 24px);
  text-decoration: none;
}
.brand-box {
  display: grid;
  place-items: center;
  flex: none;
  width: clamp(56px, 6vw, 88px);
  height: clamp(56px, 6vw, 88px);
  background: var(--surface-3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.3s;
}
.brand-box img { width: 72%; height: 72%; }
.brand:hover .brand-box { border-color: var(--primary); }
.brand-text { display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.brand-name {
  font-size: clamp(1.15rem, 0.8rem + 1.2vw, 1.9rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}
.brand:hover .brand-name { color: var(--primary); }
.brand-text .label { letter-spacing: 0.08em; text-transform: none; font-weight: 500; }

/* Small terminal-style captions, sized like gvstudio.lv */
.status, .sys-line {
  display: flex;
  align-items: center;
  font: 500 clamp(6px, 4px + 0.4vw, 11px)/1.4 var(--font-label);
  color: var(--ink-2);
}
.status .dot, .sys-line .dot { width: 5px; height: 5px; }

/* ---------- hero ---------- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0;
}
.hero-title {
  margin: 0 0 clamp(16px, 2vw, 28px);
  font-size: clamp(2.8rem, 1.6rem + 6.5vw, 8.5rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.hero-sub { display: flex; align-items: center; gap: 20px; }
.rule { flex: none; width: clamp(40px, 6vw, 96px); height: 1px; background: var(--primary); }
.hero-sub p {
  max-width: 52ch;
  margin: 0;
  color: var(--ink-3);
  font-size: clamp(0.95rem, 0.85rem + 0.3vw, 1.1rem);
}

/* ---------- bottom bar ---------- */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.bar-left { display: flex; flex-direction: column; gap: 16px; width: min(320px, 100%); }
.sys { display: flex; flex-direction: column; gap: 2px; }
.sys-line { font-weight: 700; color: var(--ink-5); }
.sys-micro {
  font: 400 clamp(4px, 3px + 0.25vw, 8px)/1.4 var(--font-label);
  color: rgba(82, 82, 91, 0.5);
}

.bar-right { display: flex; flex-direction: column; align-items: flex-end; gap: clamp(20px, 3vw, 40px); }
.index {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: right;
}
.index a {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 12px;
  color: rgba(228, 228, 231, 0.85);
  font-size: clamp(1.05rem, 0.6rem + 1.6vw, 2rem);
  font-weight: 400;
  line-height: 1.25;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.index a:hover { color: var(--primary); }
.index .num { color: var(--ink-5); }

.nav { display: flex; gap: clamp(16px, 2.4vw, 32px); }
.nav a {
  display: flex;
  align-items: center;
  font: 700 11px/1 var(--font-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  transition: color 0.2s;
}
.nav a:hover { color: var(--primary); }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 18px 32px;
  border: 0;
  background: var(--primary);
  color: #000;
  font: 700 13px/1 var(--font-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: letter-spacing 0.3s, transform 0.1s, opacity 0.2s;
}
.btn:hover { letter-spacing: 0.2em; }
.btn:active { transform: scale(0.97); }
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
}
.btn:hover::after { left: 200%; transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.btn[disabled] { opacity: 0.5; cursor: wait; }
.btn-glow { animation: glow 4s ease-in-out infinite; }
.btn-wide { width: 100%; padding: 22px; }

@keyframes glow {
  0%, 100% { box-shadow: 0 0 25px var(--primary-glow), 0 0 50px rgba(255, 85, 64, 0.05); }
  50% { box-shadow: 0 0 45px rgba(255, 85, 64, 0.3), 0 0 90px rgba(255, 85, 64, 0.15); }
}

/* ---------- footer ---------- */
.foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 10px var(--pad);
  background: rgba(0, 0, 0, 0.8);
  border-top: 1px solid rgba(255, 85, 64, 0.1);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--ink-5);
  font: italic 400 clamp(4px, 3px + 0.25vw, 8px)/1.4 var(--font-label);
}
.edge-left { position: fixed; top: 0; left: 0; z-index: 2; width: 1px; height: 100%; background: rgba(255, 85, 64, 0.1); }

/* ---------- overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  padding: var(--pad);
  background: rgba(8, 8, 8, 0.9);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  visibility: hidden;
}
/* The backdrop switches at once, so moving between overlays never shows the home screen
   through a half-faded layer; only the content slides and fades in. */
.overlay:target { visibility: visible; }
.overlay-inner {
  max-width: 1152px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 48px) 0 48px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.overlay:target .overlay-inner { opacity: 1; transform: none; }
.overlay-narrow { max-width: 620px; }

/* Header, close button and cards follow gvstudio.lv exactly */
.overlay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(40px, 5vw, 64px);
  padding-bottom: clamp(24px, 3vw, 32px);
  border-bottom: 1px solid rgba(39, 39, 42, 0.3);
}
.overlay-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 1rem + 3vw, 4rem);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}
.overlay-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  font: 500 clamp(6px, 4px + 0.4vw, 11px)/1.4 var(--font-label);
  color: var(--ink-4);
  text-transform: uppercase;
}
.overlay-sub .dot { width: 8px; height: 8px; margin: 0; }
.dot-flicker { background: var(--green); animation: flicker 3.7s step-end infinite; }
@keyframes flicker {
  0%, 9%, 14%, 41%, 47%, 52%, 78%, 100% { opacity: 1; }
  7%, 12%, 39%, 45%, 50%, 76%, 81% { opacity: 0.15; }
}

.close {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.close-box {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 28px;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}
.close-text {
  font: 400 clamp(4px, 3px + 0.25vw, 8px)/1 var(--font-label);
  color: var(--ink-5);
  transition: color 0.2s;
}
.close:hover .close-box { background: var(--primary); color: #000; }
.close:hover .close-text { color: var(--primary); }

.cards { display: grid; gap: 16px; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 32px);
  background: rgba(26, 26, 26, 0.4);
  border: 1px solid rgba(39, 39, 42, 0.3);
  transition: border-color 0.3s;
}
.card:hover { border-color: var(--primary); }
.card h3 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 1.2rem + 0.6vw, 1.875rem);
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
  transition: color 0.2s;
}
.card:hover h3 { color: var(--primary); }
.card-rule {
  display: block;
  width: 48px;
  height: 2px;
  margin-bottom: 16px;
  background: rgba(255, 85, 64, 0.3);
  transition: width 0.5s;
}
.card:hover .card-rule { width: 100%; }
.card-tech {
  margin: 0 0 clamp(16px, 2vw, 24px);
  font: 500 clamp(6px, 4px + 0.4vw, 11px)/1.4 var(--font-label);
  color: var(--primary);
  text-transform: uppercase;
}
.card-text {
  flex: 1;
  margin: 0 0 clamp(24px, 2.5vw, 32px);
  color: var(--ink-3);
  font-size: clamp(0.75rem, 0.6rem + 0.3vw, 1rem);
  line-height: 1.5;
}
.card-dots { display: flex; gap: 6px; }
.card-dots span { width: 6px; height: 6px; background: var(--line-2); }

.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.tag {
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  color: var(--ink-3);
  font: 700 10px/1 var(--font-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.tag-live { border-color: rgba(255, 85, 64, 0.5); color: var(--primary); }

.link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

.overlay-cta { margin-top: 32px; }

.registry {
  max-width: 760px;
  margin: 0;
  padding: clamp(24px, 4vw, 48px);
  border-left: 4px solid var(--primary);
  background: rgba(26, 26, 26, 0.3);
}
.registry > div {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  padding: 12px 0;
}
.registry dt { padding-top: 5px; }
.registry dd { margin: 0; color: var(--ink-2); font-size: 1.05rem; }
.registry-name { font-size: clamp(1.4rem, 1rem + 1.2vw, 2rem) !important; font-weight: 500; color: var(--ink) !important; }

/* ---------- form ---------- */
.form { display: flex; flex-direction: column; gap: 32px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field input, .field textarea {
  width: 100%;
  padding: 16px;
  border: 0;
  border-bottom: 2px solid rgba(39, 39, 42, 0.8);
  background: var(--surface-2);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font-head);
  transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--primary); }
.field textarea { resize: vertical; min-height: 140px; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { min-height: 1.5em; margin: -8px 0 0; color: var(--ink-3); }
.form-msg.error { color: var(--error); }
.form-msg.ok { color: var(--green); }
.form-alt { margin: 0; text-align: center; text-transform: none; letter-spacing: 0.04em; }

/* ---------- smaller screens ---------- */
@media (max-width: 900px) {
  .cards-3 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .status { display: none; }
  .cards-2 { grid-template-columns: 1fr; }
  .bar { flex-direction: column; align-items: stretch; gap: 32px; }
  .bar-left { width: 100%; order: 2; }
  .bar-right { align-items: flex-start; }
  .index { text-align: left; }
  .index a { justify-content: flex-start; }
  .nav { flex-wrap: wrap; }
  .hero { padding: 56px 0 40px; }
  .hero-sub .rule { display: none; }
  .registry > div { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-height: 640px) and (min-width: 721px) {
  .hero-title { font-size: clamp(2.2rem, 9vh, 5rem); }
}

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

/* ---------- product preview gallery ---------- */
.preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.preview-btn:hover,
.preview-btn:focus-visible { background: var(--primary); color: #000; box-shadow: 0 0 24px var(--primary-glow); }
.preview-icon {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid currentColor;
}
.card-foot .preview-btn + .tag { margin-left: auto; }

.gallery {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(16px, 3vw, 40px) var(--pad);
  border: 0;
  background: var(--bg);
  color: var(--ink);
}
.gallery[open] { display: flex; flex-direction: column; gap: clamp(12px, 2vw, 20px); }
.gallery::backdrop { background: rgba(0, 0, 0, 0.7); }
.gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: clamp(12px, 2vw, 20px);
  border-bottom: 1px solid rgba(39, 39, 42, 0.6);
}
.gallery-title {
  margin: 0;
  font-size: clamp(1.4rem, 1rem + 2vw, 2.6rem);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}
button.close { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }

.gallery-stage {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px clamp(8px, 2vw, 24px);
  flex: 1;
  min-height: 0;
  margin: 0;
  touch-action: pan-y;
}
.gallery-stage img {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.7));
  user-select: none;
}
.gallery-nav {
  grid-row: 1;
  align-self: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.gallery-nav:hover,
.gallery-nav:focus-visible { background: var(--primary); border-color: var(--primary); color: #000; }
.gallery-prev { grid-column: 1; }
.gallery-next { grid-column: 3; }
.gallery-caption {
  grid-column: 2;
  grid-row: 2;
  text-align: center;
  color: var(--ink-3);
  font-size: clamp(0.85rem, 0.75rem + 0.3vw, 1rem);
}
.gallery-caption .label { margin-right: 10px; color: var(--primary); }

.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.gallery-thumbs button {
  flex: none;
  width: 112px;
  height: 70px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s;
}
.gallery-thumbs button:hover { opacity: 0.9; }
.gallery-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--primary); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

/* Phones: the screenshot takes the full width, arrows sit over its edges (swiping works too) */
@media (max-width: 640px) {
  .gallery-stage { position: relative; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .gallery-stage img,
  .gallery-caption { grid-column: 1; }
  .gallery-nav { position: absolute; top: 50%; z-index: 1; width: 36px; height: 36px; font-size: 16px; opacity: 0.85; transform: translateY(-50%); }
  .gallery-prev { left: 0; }
  .gallery-next { right: 0; }
  .gallery-thumbs button { width: 84px; height: 54px; }
}
