:root {
  --bg: #07070a;
  --bg2: #101016;
  --line: #24242e;
  --text: #f4f4f7;
  --muted: #9a9aa8;
  --red: #ff1a2e;
  --red-dim: #b01020;
  --lime: #d6ff3a;
  --font: "Be Vietnam Pro", system-ui, sans-serif;
  --display: "Outfit", "Be Vietnam Pro", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font: 500 16px/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }
.dim { color: var(--muted); }

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.top, main, .foot { position: relative; z-index: 1; }

/* ——— Nav ——— */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 7, 10, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}
.logo img { width: 34px; height: 34px; border-radius: 8px; }
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a, .nav-out, .nav-edit {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.nav a:hover, .nav-out:hover, .nav-edit:hover { color: var(--text); background: #1a1a22; }
.nav a.on { color: var(--text); background: #1c1c26; }
.nav-cta {
  background: var(--red) !important;
  color: #fff !important;
  font-weight: 700;
}
.nav-cta:hover { background: #ff3344 !important; }
.nav-app {
  background: var(--lime) !important;
  color: #111 !important;
  font-weight: 700;
}
.nav-edit { color: var(--lime) !important; }
.burger {
  display: none;
  background: #1a1a22;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

/* ——— Hero ——— */
.hero {
  position: relative;
  min-height: min(92vh, 820px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.hero-orb-a {
  width: min(70vw, 640px);
  height: min(70vw, 640px);
  right: -10%;
  top: -15%;
  background: radial-gradient(circle, rgba(255, 26, 46, .45), transparent 70%);
}
.hero-orb-b {
  width: min(50vw, 420px);
  height: min(50vw, 420px);
  left: -8%;
  bottom: 10%;
  background: radial-gradient(circle, rgba(214, 255, 58, .12), transparent 70%);
}
.hero-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 40%, var(--bg) 95%),
    repeating-linear-gradient(90deg, transparent 0 78px, rgba(255,255,255,.03) 78px 79px),
    repeating-linear-gradient(0deg, transparent 0 78px, rgba(255,255,255,.03) 78px 79px);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
}
.hero-inner {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: clamp(48px, 10vh, 120px) clamp(16px, 4vw, 40px) clamp(40px, 8vh, 80px);
}
.hero-kicker {
  margin: 0 0 12px;
  color: var(--lime);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .78rem;
}
.hero-brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.2rem, 11vw, 6.4rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: #fff;
  text-shadow: 0 2px 0 rgba(255, 26, 46, .35);
  animation: brandIn .9s cubic-bezier(.2,.8,.2,1) both;
}
.hero-lead {
  margin: 18px 0 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: #c8c8d4;
  animation: fadeUp .8s .15s both;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  animation: fadeUp .8s .28s both;
}

@keyframes brandIn {
  from { opacity: 0; transform: translateY(28px) scale(.98); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  transition: transform .15s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #ff3344; }
.btn-ghost {
  background: transparent;
  border-color: #3a3a48;
  color: var(--text);
}
.btn-ghost:hover { border-color: #666; background: #16161e; }

/* ——— 3 big blocks ——— */
.blocks {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 40px) 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.block-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #16161e, #101016);
  color: var(--muted);
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.25rem);
  letter-spacing: -.02em;
  padding: 28px 18px;
  min-height: 110px;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  transition: border-color .2s, color .2s, background .2s, transform .2s;
}
.block-tab:hover {
  color: var(--text);
  border-color: #3a3a48;
  transform: translateY(-2px);
}
.block-tab.on {
  color: #fff;
  border-color: var(--red);
  background:
    linear-gradient(135deg, rgba(255, 26, 46, .22), transparent 60%),
    linear-gradient(180deg, #1a1216, #120e12);
  box-shadow: inset 0 0 0 1px rgba(255, 26, 46, .25);
}
.block-panel {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding: 28px clamp(18px, 3vw, 32px);
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg2);
  animation: panelIn .35s ease;
}
.block-panel h2 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: -.02em;
}
.block-body {
  color: #d2d2dc;
  max-width: 720px;
}
.block-body p {
  margin: 0 0 10px;
  white-space: pre-wrap;
}
.yt-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  margin: 12px 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #0a0a0e;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color .2s, transform .15s;
}
.yt-card:hover {
  border-color: var(--red);
  transform: translateY(-1px);
}
.yt-thumb {
  position: relative;
  flex: 0 0 148px;
  width: 148px;
  height: 84px;
  background: #111;
}
.yt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.yt-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  font-size: 1.4rem;
  text-shadow: 0 2px 8px #000;
}
.yt-label {
  font-weight: 700;
  font-size: .95rem;
  padding-right: 12px;
}
.yt-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 2px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 26, 46, .45);
  background: rgba(255, 26, 46, .12);
  color: #ff8a96;
  font: inherit;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
}
.yt-inline:hover { background: rgba(255, 26, 46, .22); }
.yt-box {
  position: relative;
  width: min(920px, 96vw);
  background: #0a0a0e;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 44px 14px 14px;
}
.yt-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}
.yt-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.yt-box .linkish {
  display: inline-block;
  margin-top: 10px;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ——— Gallery ——— */
.gallery-wrap {
  width: 100%;
  margin: 0 auto;
  padding: 8px clamp(16px, 3vw, 32px) 72px;
}
.gallery-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -.03em;
}
.gallery-head p { margin: 8px 0 22px; }
.gallery {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}
.gallery figure {
  margin: 0;
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #0a0a0e;
  cursor: zoom-in;
}
.gallery img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
  transition: opacity .2s;
}
.gallery figure:hover img { opacity: .92; }
.gallery figcaption {
  padding: 10px 14px 12px;
  font-size: .9rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.gallery-empty { margin-top: 8px; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, .92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 24px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: min(1100px, 96vw);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  cursor: default;
}
.lb-cap {
  margin: 12px 0 0;
  color: #ccc;
  text-align: center;
  max-width: 40rem;
}
.lightbox .modal-x {
  position: absolute;
  top: 14px;
  right: 16px;
  background: #222;
  border: 0;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
}

/* ——— Terms page ——— */
.page-terms {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 48px clamp(16px, 4vw, 40px) 80px;
}
.terms-box h1 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -.03em;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px clamp(16px, 4vw, 40px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* ——— Modals ——— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, .72);
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal-box {
  position: relative;
  width: min(440px, 100%);
  background: #121218;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 90vh;
  overflow: auto;
}
.edit-box { width: min(560px, 100%); }
.apply-box { width: min(480px, 100%); }
.apps-box { width: min(640px, 100%); }
.row2 {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3em;
  height: 1.3em;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
}
.apps-list { display: flex; flex-direction: column; gap: 12px; }
.app-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #0a0a0e;
}
.app-card.new { border-color: rgba(255, 26, 46, .45); }
.app-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.app-card .meta { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.app-card .body { white-space: pre-wrap; font-size: .92rem; color: #d8d8e0; }
.app-card .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.app-card .st {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}
.app-card .st.new { background: #3a1218; color: #ff8a96; }
.app-card .st.ok { background: #12351f; color: #7ee2a0; }
.app-card .st.no { background: #2a2a32; color: #aaa; }
.modal-box h2, .modal-box h3 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: -.02em;
}
.modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
}
.modal-box input,
.modal-box select,
.modal-box textarea {
  width: 100%;
  background: #0a0a0e;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .85rem;
  color: var(--muted);
}
.linkish {
  background: none;
  border: 0;
  color: var(--lime);
  cursor: pointer;
  text-align: left;
  padding: 0;
}
.edit-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 10px 0;
}
.file-btn { width: fit-content; cursor: pointer; }
.edit-gal {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.edit-gal .eg {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 1;
}
.edit-gal img { width: 100%; height: 100%; object-fit: cover; display: block; }
.edit-gal button {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,.75);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: .75rem;
}

.mailnote {
  background: #151520;
  border: 1px solid #2a2a38;
  border-radius: 12px;
  padding: 12px;
  font-size: .92rem;
  line-height: 1.5;
}
.spamwarn {
  margin: 8px 0;
  color: #ffb4b4;
  font-weight: 700;
}

@media (max-width: 820px) {
  .burger { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 16px;
    background: #0c0c12;
    border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .blocks { grid-template-columns: 1fr; }
  .block-tab { min-height: 72px; padding: 18px 16px; }
}
