/* Tervia website. Night sky, warm gold, clean type. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../assets/fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../assets/fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 800; font-display: swap; src: url("../assets/fonts/inter-800.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 900; font-display: swap; src: url("../assets/fonts/inter-900.woff") format("woff"); }

:root {
    --bg: #0b0d18;
    --bg-2: #10132250;
    --surface: #141828;
    --surface-2: #1a1f33;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .14);
    --text: #f3eee6;
    --text-2: #b9b6c6;
    --muted: #8a889c;
    --gold: #f2c878;
    --gold-hi: #ffe2a6;
    --gold-lo: #c9983f;
    --green: #5fd38a;
    --radius: 14px;
    --wrap: 1160px;
    --shadow: 0 20px 50px rgba(0, 0, 0, .45);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 17px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.01em; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip-link { position: absolute; left: -9999px; top: 12px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--gold); color: #1b1408; font-weight: 800; }
.skip-link:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* ---------- wordmark ---------- */
.wm {
    font-weight: 900; letter-spacing: .14em; font-size: 22px; line-height: 1;
    background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wm-sm { font-size: 18px; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 22px; border-radius: 10px; font-weight: 800; font-size: 15px;
    background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, #e0b062);
    color: #1d1508; border: 0; cursor: pointer;
    box-shadow: 0 6px 20px rgba(242, 200, 120, .22), inset 0 1px 0 rgba(255, 255, 255, .45);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 10px 26px rgba(242, 200, 120, .3), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn-ghost { background: rgba(255, 255, 255, .06); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); box-shadow: none; }
.btn-big { padding: 15px 26px; font-size: 16px; border-radius: 12px; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- header ---------- */
.site-header {
    position: fixed; inset: 0 0 auto; z-index: 50;
    display: flex; align-items: center; gap: 28px;
    padding: 16px max(24px, calc((100vw - var(--wrap)) / 2 + 24px));
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    transition: background .2s ease, border-color .2s ease, padding .2s ease;
    border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { background: rgba(11, 13, 24, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom-color: var(--line); padding-block: 12px; }
.brand { display: inline-flex; }
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { color: var(--text-2); font-weight: 600; font-size: 15px; transition: color .15s ease; }
.nav a:hover { color: var(--text); }
.header-cta { padding: 10px 18px; font-size: 14px; }
.header-discord { margin-left: 22px; margin-right: 10px; }
.header-discord svg { width: 18px; height: 18px; }
.nav .nav-discord { display: none; }
.nav-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); color: var(--text); font-size: 20px; cursor: pointer; }

/* ---------- hero ---------- */
.hero {
    position: relative; min-height: max(100vh, 760px); display: flex; align-items: flex-start;
    padding: clamp(120px, 16vh, 170px) 0 140px; overflow: hidden; isolation: isolate;
}
.hero > .wrap { width: 100%; }
.hero-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; image-rendering: pixelated; }
.hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(90deg, rgba(11, 13, 24, .92) 0%, rgba(11, 13, 24, .7) 38%, rgba(11, 13, 24, .1) 70%),
        linear-gradient(180deg, rgba(11, 13, 24, .55) 0%, rgba(11, 13, 24, 0) 30%, rgba(11, 13, 24, 0) 70%, var(--bg) 100%);
}
.hero-copy { max-width: 760px; }
.live-pill {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
    padding: 6px 12px 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2);
    background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2);
}
.live-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live-pill.live .dot { background: var(--green); box-shadow: 0 0 0 0 rgba(95, 211, 138, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(95, 211, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 211, 138, 0); } }
.hero h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 900; letter-spacing: -.025em; }
.hero h1 em { font-style: normal; background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { margin-top: 20px; font-size: clamp(17px, 2vw, 20px); color: var(--text-2); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--muted); }

/* ---------- stats ---------- */
.stats { position: relative; margin-top: -56px; z-index: 2; }
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: rgba(20, 24, 40, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat { padding: 22px 24px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font-size: 28px; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 14px; color: var(--muted); font-weight: 600; }

/* ---------- sections ---------- */
.section { padding: 120px 0; }
.section-head { max-width: 640px; margin: 0 auto 64px; text-align: center; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 900; letter-spacing: -.02em; }
.section-head p:not(.eyebrow) { margin-top: 16px; color: var(--text-2); font-size: 18px; }

/* Feature rows: picture and words side by side, alternating. */
.rows { display: grid; gap: 96px; }
.row { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }
.row:nth-child(even) .shot { order: 2; }
.shot { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow); background: var(--surface); aspect-ratio: 16 / 9; }
.shot img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.row h3 { font-size: clamp(24px, 3vw, 32px); font-weight: 900; letter-spacing: -.02em; }
.row p { margin-top: 14px; color: var(--text-2); font-size: 17px; }
.row ul { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.row li { position: relative; padding-left: 26px; color: var(--text-2); font-size: 16px; }
.row li::before { content: ""; position: absolute; left: 0; top: 8px; width: 12px; height: 12px; border-radius: 3px; background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); }

/* Card grid */
.band { background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .025) 20%, rgba(255, 255, 255, .025) 80%, transparent); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s ease, transform .2s ease; }
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card .ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 18px; background: rgba(242, 200, 120, .12); color: var(--gold); }
.card .ic svg { width: 22px; height: 22px; }
.card h3 { font-size: 19px; font-weight: 800; }
.card p { margin-top: 8px; color: var(--text-2); font-size: 15.5px; }

/* Chat translation example */
.safe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.chat { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.chat-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 700; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.chat-head span:last-child { color: var(--gold); }
.msg { padding: 12px 0; }
.msg + .msg { border-top: 1px solid var(--line); }
.msg b { display: block; font-size: 14px; color: var(--gold-hi); margin-bottom: 2px; }
.msg small { display: block; margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.safe-list { display: grid; gap: 22px; }
.safe-item h3 { font-size: 18px; font-weight: 800; }
.safe-item p { margin-top: 6px; color: var(--text-2); font-size: 15.5px; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); font-weight: 600; }

/* Final call */
.cta { text-align: center; padding: 72px 32px; border-radius: 20px; border: 1px solid var(--line-2); position: relative; overflow: hidden; isolation: isolate; background: var(--surface); }
.cta-bg { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; opacity: .45; image-rendering: pixelated; }
.cta h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 900; letter-spacing: -.02em; }
.cta p { margin: 14px auto 0; max-width: 520px; color: var(--text-2); font-size: 18px; }
.cta .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 30px; }
.discord-live { margin-top: 18px !important; font-size: 14px !important; color: var(--muted) !important; }
.discord-live b { color: var(--green); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 calc(40px + env(safe-area-inset-bottom, 0px)); margin-top: 40px; }
.foot { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-left: auto; }
.foot nav a, .foot > span { color: var(--muted); font-size: 14px; font-weight: 600; }
.foot nav a:hover { color: var(--text); }
.foot > span { width: 100%; }

/* ---------- legal / support / 404 pages ---------- */
.legal-hero { padding: 150px 24px 40px; text-align: center; border-bottom: 1px solid var(--line); background: radial-gradient(ellipse at 50% 0%, rgba(242, 200, 120, .08), transparent 60%); }
.legal-hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 900; letter-spacing: -.02em; }
.legal-hero p { margin: 12px 0 26px; color: var(--muted); font-weight: 600; }
.legal { max-width: 820px; margin: 0 auto; padding: 48px 24px 96px; counter-reset: sec; }
.legal > .panel { background: none; border: 0; padding: 0; }
.legal h2 { counter-increment: sec; margin: 44px 0 12px; font-size: 22px; font-weight: 800; }
.legal h2::before { content: counter(sec) ". "; color: var(--gold); }
.legal h2.nonum::before { content: ""; }
.legal p, .legal li { color: var(--text-2); font-size: 16px; line-height: 1.8; }
.legal p { margin: 10px 0; }
.legal ul { padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal a { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(242, 200, 120, .4); }
.legal strong { color: var(--text); }
.callout { margin: 20px 0; padding: 16px 20px; border-radius: 12px; background: rgba(242, 200, 120, .08); border: 1px solid rgba(242, 200, 120, .35); }
.callout p { margin: 0; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 900px; margin: 0 auto; }
.toc a { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); color: var(--text-2); }
.toc a:hover { color: var(--text); border-color: rgba(242, 200, 120, .5); }
details.faq { margin: 10px 0; padding: 4px 20px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
details.faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 16.5px; color: var(--text); }
details.faq p { margin: 0 0 16px; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .live-pill.live .dot { animation: none; }
    .btn, .card { transition: none; }
}

/* ---------- smaller screens ---------- */
@media (max-width: 960px) {
    .row, .safe-grid { grid-template-columns: 1fr; gap: 28px; }
    .row:nth-child(even) .shot { order: 0; }
    .rows { gap: 72px; }
    .cards { grid-template-columns: 1fr 1fr; }
    .gallery { grid-template-columns: 1fr 1fr; }
    .section { padding: 88px 0; }
}
@media (max-width: 760px) {
    .nav { display: none; position: absolute; top: 100%; left: 16px; right: 16px; flex-direction: column; gap: 0; padding: 8px; margin: 0; border-radius: 12px; background: rgba(20, 24, 40, .98); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
    .nav.open { display: flex; }
    .nav a { padding: 12px 14px; border-radius: 8px; }
    .nav a:hover { background: rgba(255, 255, 255, .05); }
    .nav-toggle { display: block; }
    .header-cta { display: none; }
    .nav .nav-discord { display: block; }
    .site-header { background: rgba(11, 13, 24, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom-color: var(--line); }
    .hero { min-height: auto; padding: 120px 0 110px; }
    .hero::after { background: linear-gradient(180deg, rgba(11, 13, 24, .72) 0%, rgba(11, 13, 24, .82) 55%, var(--bg) 100%); }
    .cta-bg { opacity: .22; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat:nth-child(3) { border-left: 0; }
    .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
    .stat { padding: 18px 20px; }
    .stat b { font-size: 24px; }
    .cards, .gallery { grid-template-columns: 1fr; }
    .section { padding: 72px 0; }
    .section-head { margin-bottom: 44px; }
    .cta { padding: 52px 20px; }
    .hero-actions .btn { flex: 1 1 100%; }
}
