/* Fonts (Archivo, JetBrains Mono — variable woff2, self-hosted) */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/archivo-vietnamese.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/archivo-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/archivo-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: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-cyrillic-ext.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-cyrillic.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-greek.woff2") format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-vietnamese.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-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 {
  --accent: #ec3013;
  --accent-hover: #dd2b0f;
  --accent-active: #ae1800;

  --bg: #131110;
  --text: #f3f2f2;
  --muted: #b2acaa;
  --accent-text: #ff9783;
  --glass: rgba(38, 34, 32, .5);
  --glass-soft: rgba(40, 36, 34, .4);
  --glass-border: rgba(255, 255, 255, .14);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 20px 60px rgba(0, 0, 0, .45);
  --logo-filter: invert(1);
  --stripe-a: rgba(255, 255, 255, .08);
  --stripe-b: rgba(255, 255, 255, .03);
  --field-bg: rgba(0, 0, 0, .25);
}

[data-theme="light"] {
  --bg: #f3f2f2;
  --text: #201e1d;
  --muted: #605d5d;
  --accent-text: #ae1800;
  --glass: rgba(255, 255, 255, .5);
  --glass-soft: rgba(255, 255, 255, .4);
  --glass-border: rgba(255, 255, 255, .8);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 20px 50px rgba(32, 30, 29, .10);
  --logo-filter: none;
  --stripe-a: rgba(32, 30, 29, .08);
  --stripe-b: rgba(32, 30, 29, .03);
  --field-bg: rgba(255, 255, 255, .6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
  transition: background .4s, color .4s;
}
a { color: var(--accent-active); text-decoration: none; }
a:hover { color: var(--accent); }
.mono { font-family: 'JetBrains Mono', monospace; }
.muted { color: var(--muted); }
.accent { color: var(--accent-text); }
.small { font-size: 15px; }
.mono-13 { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.mono-14 { font-family: 'JetBrains Mono', monospace; font-size: 14px; }

#app { position: relative; min-height: 100vh; overflow: hidden; }

.blobs { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); }
.blob-1 { left: 60%; top: -10%; width: 44vw; height: 44vw; background: oklch(0.66 0.21 32 / .5); animation: drift1 20s ease-in-out infinite; }
.blob-2 { left: -10%; top: 35%; width: 46vw; height: 46vw; background: oklch(0.78 0.14 60 / .4); animation: drift2 25s ease-in-out infinite; }
.blob-3 { left: 45%; top: 70%; width: 46vw; height: 46vw; background: oklch(0.62 0.2 20 / .5); animation: drift3 28s ease-in-out infinite; }
[data-theme="light"] .blob-1, [data-theme="light"] .blob-3 { background: oklch(0.66 0.21 32 / .65); }
[data-theme="light"] .blob-2 { background: oklch(0.78 0.14 60 / .52); }

.page { position: relative; z-index: 1; }

@keyframes drift1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(12vw, 8vh) scale(1.15); } }
@keyframes drift2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-14vw, 6vh) scale(.9); } }
@keyframes drift3 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(6vw, -10vh); } }
@keyframes logIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.container { max-width: 1280px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 5;
  background: var(--glass-soft);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px clamp(20px, 4vw, 48px);
  font-family: 'JetBrains Mono', monospace; font-size: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand-logo { height: 32px; filter: var(--logo-filter); }
.brand span { font-weight: 600; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(12px, 2.4vw, 28px); }
.nav-links > a { color: var(--text); }
.nav-links > a:hover { color: var(--accent); }

/* Buttons */
.btn {
  font-family: inherit; font-size: 15px; cursor: pointer; border-radius: 10px;
  padding: 12px 18px; border: 1px solid transparent; white-space: nowrap; display: inline-block;
}
.btn-ghost {
  font-size: 13px; padding: 8px 12px; color: var(--text);
  border: 1px solid var(--glass-border); background: var(--glass-soft);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-accent { background: var(--accent); color: #fff; font-weight: 600; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-accent:active { background: var(--accent-active); }
.btn-glass {
  color: var(--text); background: var(--glass-soft); border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-weight: 600;
}
.btn-glass:hover { border-color: var(--accent); color: var(--text); }
.btn-lg { font-size: 17px; padding: 16px 24px; min-width: 200px; }

/* Hero */
.hero { padding: clamp(56px, 9vw, 112px) 0 32px; display: flex; flex-direction: column; gap: 20px; }
.tag { font-family: 'JetBrains Mono', monospace; font-size: 15px; color: var(--accent-text); }
.hero h1 {
  margin: 0; font-size: clamp(48px, 8vw, 104px); line-height: .92; font-weight: 800;
  letter-spacing: -.04em; max-width: 1100px; text-wrap: pretty;
}
.lead { margin: 0; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; color: var(--muted); max-width: 640px; text-wrap: pretty; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }

/* Panel (terminal / form) */
.panel-wrap { padding: 32px 0 clamp(56px, 7vw, 88px); }
.panel {
  border-radius: 18px; overflow: hidden; background: var(--glass); border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow); backdrop-filter: blur(32px) saturate(180%); -webkit-backdrop-filter: blur(32px) saturate(180%);
}
.panel-bar {
  display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--glass-border);
  font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--muted);
}
.dot { width: 12px; height: 12px; border-radius: 9px; background: var(--stripe-a); flex: none; }
.dot-accent { background: var(--accent); }
.panel-title { margin-left: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--accent-text); flex: none; }
.live-dot { width: 8px; height: 8px; border-radius: 9px; background: var(--accent); animation: pulse 1.6s infinite; }

.terminal {
  padding: 20px 24px; display: flex; flex-direction: column-reverse; gap: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: clamp(12px, 1.2vw, 15px);
  min-height: 260px; overflow-x: auto;
}
.terminal-line {
  display: grid; grid-template-columns: 80px 120px minmax(0, 1fr) 32px; gap: 12px;
  animation: logIn .5s ease both; min-width: 560px;
}
.terminal-line .t-agent { color: var(--accent-text); font-weight: 600; }
.terminal-line .t-time, .terminal-line .t-ok { color: var(--muted); }
.terminal-line .t-ok { text-align: right; }
.terminal-cursor { color: var(--accent-text); order: -1; }
.cursor-blink { animation: pulse 1s steps(1) infinite; }

/* Sections */
.section { padding-bottom: clamp(56px, 7vw, 88px); display: flex; flex-direction: column; gap: 24px; scroll-margin-top: 90px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.section-title { display: flex; flex-direction: column; gap: 12px; }
.section-title h2, h2.inline { margin: 0; font-size: clamp(36px, 4.5vw, 56px); line-height: 1; font-weight: 800; letter-spacing: -.03em; }
.section-desc { margin: 0; font-size: 17px; line-height: 1.45; max-width: 420px; color: var(--muted); }

/* Agents grid */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 12px; }
.agent-card {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px; padding: 24px; border-radius: 14px;
  background: var(--glass-soft); border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: transform .25s, border-color .25s;
}
.agent-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.agent-code { display: flex; flex-direction: column; gap: 10px; font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; color: var(--accent-text); }
.agent-up { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; }
.agent-up .dot { width: 6px; height: 6px; background: var(--accent); animation: pulse 2s infinite; }
.agent-body { display: flex; flex-direction: column; gap: 6px; }
.agent-name { font-size: 22px; font-weight: 800; }
.agent-desc { font-size: 16px; line-height: 1.45; color: var(--muted); }

/* Infra */
.infra-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.infra-card {
  padding: clamp(24px, 3vw, 40px); border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  display: flex; flex-direction: column; gap: 20px;
}
.infra-card h2 { margin: 0; font-size: clamp(34px, 4vw, 48px); line-height: 1; font-weight: 800; letter-spacing: -.03em; }
.kv-list { display: flex; flex-direction: column; gap: 10px; font-family: 'JetBrains Mono', monospace; font-size: 14px; padding-top: 8px; border-top: 1px solid var(--glass-border); }
.kv-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; }
.infra-photo {
  border-radius: 18px; min-height: 380px; border: 1px solid var(--glass-border);
  background: repeating-linear-gradient(135deg, var(--stripe-a) 0 12px, var(--stripe-b) 12px 24px);
  display: flex; align-items: flex-end; padding: 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--muted);
}

/* Contact */
.contact-card {
  flex: 1 1 320px; min-width: 0; padding: clamp(24px, 3vw, 36px); border-radius: 18px;
  background: var(--glass-soft); border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  display: flex; flex-direction: column; gap: 24px;
}
.contact-card > p { margin: 0; font-size: 17px; line-height: 1.5; color: var(--muted); }
.contact-fields { display: flex; flex-direction: column; gap: 14px; font-family: 'JetBrains Mono', monospace; font-size: 14px; }
.contact-field { display: flex; flex-direction: column; gap: 4px; }
.contact-footnote { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--glass-border); font-size: 14px; line-height: 1.5; color: var(--muted); }

.contact-card { max-width: 640px; }
.contact-open { align-self: flex-start; }

.contact-dialog {
  border: 0; padding: 0; background: transparent; color: var(--text);
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: visible; margin: auto;
}
.contact-dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.contact-dialog .panel { max-height: calc(100vh - 32px); overflow-y: auto; background: color-mix(in srgb, var(--bg) 90%, transparent); }
.dialog-close { margin-left: auto; }
.contact-form { padding: clamp(20px, 3vw, 32px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--muted); }
.field-full { grid-column: 1 / -1; }
.field input, .field textarea {
  width: 100%; box-sizing: border-box; font-family: 'Archivo', sans-serif; font-size: 16px;
  padding: 14px 16px; border-radius: 10px; border: 1px solid var(--glass-border);
  background: var(--field-bg); color: var(--text); outline: none;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(236, 48, 19, .25); }
.field-error { color: var(--accent-text); }
.subject-row { display: flex; flex-wrap: wrap; gap: 8px; }
.subject-btn {
  font-family: 'JetBrains Mono', monospace; font-size: 13px; padding: 10px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--glass-border); background: var(--glass-soft); color: var(--text);
}
.subject-btn:hover { border-color: var(--accent); }
.subject-btn.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }

.contact-sent { padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; gap: 10px; font-family: 'JetBrains Mono', monospace; font-size: 15px; min-height: 320px; }
.sent-line { animation: logIn .4s ease both; }
.sent-line:nth-of-type(2) { animation-delay: .3s; }
.sent-line:nth-of-type(3) { animation-delay: .6s; }
.sent-ok { animation-delay: .9s; color: var(--accent-text); }
.sent-reset { margin-top: auto; align-self: flex-start; }

/* Legal pages */
.legal { max-width: 920px; padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 48px) clamp(56px, 7vw, 96px); display: flex; flex-direction: column; gap: 24px; }
.back-link { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--muted); }
.back-link:hover { color: var(--accent); }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.legal-tab { font-family: 'JetBrains Mono', monospace; font-size: 13px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--glass-border); background: var(--glass-soft); color: var(--text); }
.legal-tab:hover { border-color: var(--accent); }
.legal-tab.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.legal-notice { padding: 14px 18px; border-radius: 12px; border: 1px dashed var(--accent); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--glass-soft); }
.legal-article {
  padding: clamp(24px, 4vw, 48px); border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow); backdrop-filter: blur(32px) saturate(160%); -webkit-backdrop-filter: blur(32px) saturate(160%);
  display: flex; flex-direction: column; gap: 28px; font-size: 16px; line-height: 1.6;
}
.legal-panel { display: flex; flex-direction: column; gap: 28px; }
.legal-head { display: flex; flex-direction: column; gap: 10px; }
.legal-head h1 { margin: 0; font-size: clamp(36px, 5vw, 56px); line-height: 1; font-weight: 800; letter-spacing: -.03em; }
.legal-block { display: flex; flex-direction: column; gap: 8px; }
.legal-block h2 { margin: 0; font-size: 22px; font-weight: 800; }
.legal-block p { margin: 0; }
.table-list { display: flex; flex-direction: column; border-top: 1px solid var(--glass-border); }
.table-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--glass-border); font-size: 15px; }
.table-row.mono-14 { font-size: 14px; }
.table-row-2col { grid-template-columns: minmax(0, 1fr) auto; }
.table-head { text-transform: none; }

/* Footer */
.footer { border-top: 1px solid var(--glass-border); background: var(--glass-soft); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 28px clamp(20px, 4vw, 48px) 32px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }
