/* ============================================================
   Quasar Infinity — www.quasar8.com
   Design system & styles. Dark, futuristic, wireframe.
   ============================================================ */

:root {
  /* Brand palette (derived from logo) */
  --brand:        #5569a5;
  --brand-light:  #8aa0e0;
  --brand-deep:   #1b3f83;
  --accent:       #6ea8ff;
  --accent-soft:  rgba(110, 168, 255, 0.14);

  /* Surfaces */
  --bg:        #080b13;
  --bg-2:      #0b101c;
  --surface:   #10172a;
  --surface-2: #141d33;
  --line:      rgba(138, 160, 224, 0.14);
  --line-soft: rgba(138, 160, 224, 0.08);

  /* Text */
  --text:      #e8edf9;
  --text-2:    #aeb9d4;
  --text-3:    #7d89a8;

  /* Layout */
  --maxw: 1180px;
  --radius: 14px;
  --radius-lg: 22px;
  --header-h: 72px;

  --font-display: "Space Grotesk", "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --font-body: "Inter", "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Background canvas ---------- */
#bg-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: -2;
  display: block;
}
.bg-overlay {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 75% -10%, rgba(85, 105, 165, 0.22), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, rgba(27, 63, 131, 0.20), transparent 60%),
    linear-gradient(180deg, rgba(8,11,19,0.20) 0%, rgba(8,11,19,0.50) 55%, rgba(8,11,19,0.80) 100%);
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 110px 0; position: relative; }
.section-alt { background: linear-gradient(180deg, rgba(16,23,42,0.4), rgba(11,16,28,0.5)); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--accent); color: #04122c; padding: 10px 16px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { left: 16px; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 0.74rem; font-weight: 600;
  color: var(--accent);
  margin: 0 0 14px;
}
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.7rem);
  line-height: 1.12; letter-spacing: -0.02em;
  margin: 0;
}
.section-lead { color: var(--text-2); font-size: 1.08rem; margin: 18px 0 0; max-width: 640px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  padding: 13px 26px; border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  will-change: transform;
}
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--brand));
  color: #061227;
  box-shadow: 0 8px 30px -10px rgba(110, 168, 255, 0.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -10px rgba(110, 168, 255, 0.75); }
.btn-ghost {
  background: rgba(138, 160, 224, 0.06);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(8, 11, 19, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark { height: 34px; width: auto; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; letter-spacing: -0.01em; }
.brand-name-accent { color: var(--accent); margin-left: 2px; }

.nav { display: flex; align-items: center; gap: 30px; margin-left: auto; }
.nav-link { color: var(--text-2); font-size: 0.95rem; font-weight: 500; position: relative; padding: 4px 0; transition: color .2s; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--accent); transition: width .25s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 14px; }

/* ---------- Language switcher ---------- */
.lang { position: relative; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(138, 160, 224, 0.06); border: 1px solid var(--line);
  color: var(--text); border-radius: 999px; padding: 8px 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.82rem;
  transition: border-color .2s, background .2s;
}
.lang-toggle:hover { border-color: var(--accent); }
.lang-caret { transition: transform .25s var(--ease); color: var(--text-3); }
.lang.open .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 168px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px; box-shadow: 0 24px 60px -20px rgba(0,0,0,0.7);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
.lang.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; font-size: 0.9rem; color: var(--text-2);
  cursor: pointer; transition: background .15s, color .15s;
}
.lang-menu li:hover { background: var(--accent-soft); color: var(--text); }
.lang-menu li[aria-selected="true"] { color: var(--text); background: rgba(138,160,224,0.08); }
.lang-code {
  font-family: var(--font-display); font-weight: 700; font-size: 0.72rem;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 5px; padding: 2px 6px; min-width: 30px; text-align: center;
}

/* ---------- Burger ---------- */
.nav-burger { display: none; background: none; border: none; width: 40px; height: 40px; position: relative; }
.nav-burger span {
  display: block; position: absolute; left: 8px; right: 8px; height: 2px; background: var(--text);
  transition: transform .3s var(--ease), opacity .2s;
}
.nav-burger span:nth-child(1) { top: 13px; }
.nav-burger span:nth-child(2) { top: 19px; }
.nav-burger span:nth-child(3) { top: 25px; }
.nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--header-h) + 40px) 0 80px; position: relative;
}
.hero-inner { max-width: 880px; }
.hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.4rem, 1.2rem + 5vw, 4.6rem);
  line-height: 1.04; letter-spacing: -0.03em;
  margin: 0 0 28px;
  background: linear-gradient(180deg, #ffffff 30%, #b9c6ec 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-subtitle { font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.28rem); color: var(--text-2); max-width: 680px; margin: 0 0 38px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-scroll {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-3);
}
.hero-scroll-line { width: 1px; height: 46px; background: linear-gradient(180deg, var(--accent), transparent); animation: scrollPulse 2.4s var(--ease) infinite; }
@keyframes scrollPulse { 0%,100% { opacity: .3; transform: scaleY(.6); } 50% { opacity: 1; transform: scaleY(1); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: start; }
.about-body p { color: var(--text-2); font-size: 1.08rem; margin: 0 0 20px; }
.about-body p:last-child { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 28px 24px; display: flex; flex-direction: column; gap: 8px; }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; line-height: 1; color: var(--text); letter-spacing: -0.02em; }
.stat-plus { color: var(--accent); }
.stat-label { font-size: 0.86rem; color: var(--text-3); line-height: 1.45; }

/* ---------- Quote bands ---------- */
.quote-band { padding: 90px 0; position: relative; }
.quote { max-width: 920px; margin: 0 auto; text-align: center; }
.quote blockquote {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.4rem, 1rem + 1.8vw, 2.2rem); line-height: 1.34; letter-spacing: -0.01em;
  margin: 0; color: var(--text);
  text-wrap: balance;
}
.quote figcaption { margin-top: 26px; }
.quote-author { font-size: 0.82rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); font-family: var(--font-display); font-weight: 600; }
.quote-band-2 blockquote { background: linear-gradient(180deg, #eaf0ff, #9fb4ec); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Vision ---------- */
.vision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.vision-grid .section-head { margin-bottom: 0; }
.vision-body p { color: var(--text-2); font-size: 1.08rem; margin: 0 0 20px; }
.vision-body p:last-child { margin-bottom: 0; }

/* ---------- Cards ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.cards-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 36px 30px; transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: rgba(110,168,255,0.4); box-shadow: 0 30px 60px -30px rgba(110,168,255,0.4); }
.card-icon { width: 56px; height: 56px; color: var(--accent); margin-bottom: 22px; }
.card-icon svg { width: 100%; height: 100%; }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin: 0 0 12px; }
.card-body { color: var(--text-2); margin: 0; font-size: 0.98rem; }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-top: 20px; padding-left: 0; }
.timeline::before { content: ""; position: absolute; left: 90px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(180deg, transparent, var(--line) 8%, var(--line) 92%, transparent); }
.tl-item { position: relative; display: grid; grid-template-columns: 90px 1fr; gap: 36px; padding: 16px 0; align-items: start; }
.tl-year { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text); text-align: right; padding-top: 16px; }
.tl-item::before {
  content: ""; position: absolute; left: 85px; top: 24px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(110,168,255,0.12); z-index: 1;
}
.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; transition: transform .3s var(--ease), border-color .3s; }
.tl-card:hover { transform: translateX(6px); border-color: rgba(110,168,255,0.35); }
.tl-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin: 0 0 6px; }
.tl-card p { margin: 0; color: var(--text-2); font-size: 0.95rem; }
.tl-item.is-future .tl-year { color: var(--accent); }
.tl-item.is-future::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(110,168,255,0.25), 0 0 22px rgba(110,168,255,0.8); }
.tl-item.is-future .tl-card { border-color: rgba(110,168,255,0.4); background: linear-gradient(180deg, rgba(110,168,255,0.07), var(--surface)); }

/* ---------- Products ---------- */
.product-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 40px 36px; display: flex; flex-direction: column; gap: 18px;
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}
.product-card:hover { transform: translateY(-6px); border-color: rgba(110,168,255,0.4); box-shadow: 0 30px 60px -30px rgba(110,168,255,0.4); }
.product-card-feature { background: linear-gradient(160deg, rgba(110,168,255,0.12), var(--surface) 55%); border-color: rgba(110,168,255,0.3); }
.product-head { display: flex; flex-direction: column; gap: 12px; }
.product-badge {
  align-self: flex-start; font-family: var(--font-display); font-weight: 600;
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(110,168,255,0.25);
  padding: 5px 12px; border-radius: 999px;
}
.product-badge-alt { color: var(--brand-light); background: rgba(138,160,224,0.08); border-color: var(--line); }
.product-name { font-family: var(--font-display); font-weight: 700; font-size: 2rem; margin: 0; letter-spacing: -0.02em; }
.product-tagline { font-family: var(--font-display); font-weight: 500; font-size: 1.1rem; color: var(--text); margin: 0; }
.product-body { color: var(--text-2); margin: 0; flex-grow: 1; }
.product-card .btn { align-self: flex-start; margin-top: 6px; }

/* ---------- Offices ---------- */
.offices-grid { margin-top: 8px; }
.office-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: transform .35s var(--ease), border-color .35s; }
.office-card:hover { transform: translateY(-6px); border-color: rgba(110,168,255,0.4); }
.map-frame { position: relative; aspect-ratio: 16 / 11; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.map-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
  filter: invert(0.92) hue-rotate(180deg) brightness(0.92) contrast(0.95) saturate(0.7);
  transition: filter .4s var(--ease);
}
.map-frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 60px rgba(8,11,19,0.6); mix-blend-mode: multiply; }
.office-card:hover .map-frame iframe { filter: invert(0.9) hue-rotate(180deg) brightness(1) contrast(1) saturate(0.85); }
.office-info { padding: 22px 24px; }
.office-role { font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.office-city { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin: 8px 0 12px; }
.office-link { color: var(--text-2); font-size: 0.9rem; font-weight: 500; transition: color .2s; }
.office-link:hover { color: var(--accent); }

/* ---------- News ---------- */
.news-band { text-align: center; max-width: 680px; margin: 0 auto; padding: 30px 0; }
.badge-soon {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(110,168,255,0.35); background: var(--accent-soft);
  padding: 7px 16px; border-radius: 999px; margin-bottom: 22px;
}
.news-band .section-title { margin-bottom: 14px; }
.news-band .section-lead { margin: 0 auto; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 48px; align-items: start; }
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-family: var(--font-display); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; color: var(--text-2); }
.field input, .field textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 16px; color: var(--text); font-family: inherit; font-size: 0.98rem;
  transition: border-color .2s, background .2s, box-shadow .2s; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input:invalid:not(:placeholder-shown), .field textarea:invalid:not(:placeholder-shown) { border-color: rgba(255,120,120,0.5); }
.contact-form .btn { align-self: flex-start; margin-top: 4px; }
.form-note { font-size: 0.82rem; color: var(--text-3); margin: 0; }

.contact-aside { display: flex; flex-direction: column; gap: 28px; }
.contact-direct, .contact-pgp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.contact-label { display: block; font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.contact-email { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--text); transition: color .2s; }
.contact-email:hover { color: var(--accent); }
.contact-pgp p { color: var(--text-2); font-size: 0.92rem; margin: 0 0 16px; }
.pgp-fingerprint { display: block; margin-top: 14px; font-size: 0.66rem; color: var(--text-3); word-break: break-all; line-height: 1.7; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); padding: 60px 0 30px; background: rgba(8,11,19,0.6); }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; align-items: flex-start; }
.footer-brand { max-width: 320px; }
.footer-logo { height: 30px; opacity: 0.85; filter: brightness(2.2); }
.footer-tagline { color: var(--text-3); font-size: 0.92rem; margin: 16px 0 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-nav a { color: var(--text-2); font-size: 0.92rem; transition: color .2s; }
.footer-nav a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.footer-bottom p { margin: 0; color: var(--text-3); font-size: 0.84rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .about-grid, .vision-grid, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .cards-3 { grid-template-columns: 1fr 1fr; }
  .vision-grid .section-head { margin-bottom: 0; }
}
@media (max-width: 820px) {
  .nav, .nav-cta { display: none; }
  .nav-burger { display: block; }
  .nav.open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    position: fixed; top: var(--header-h); left: 0; right: 0;
    background: rgba(8,11,19,0.96); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line); padding: 18px 24px 26px; margin: 0;
  }
  .nav.open .nav-link { font-size: 1.1rem; padding: 12px 0; width: 100%; border-bottom: 1px solid var(--line-soft); }
  .section { padding: 84px 0; }
}
@media (max-width: 680px) {
  .cards-3, .cards-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .timeline::before { left: 7px; }
  .tl-item { grid-template-columns: 1fr; gap: 8px; padding-left: 34px; }
  .tl-year { text-align: left; padding-top: 0; }
  .tl-item::before { left: 2px; top: 7px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}
@media (max-width: 420px) {
  .container { padding: 0 18px; }
  .stats { grid-template-columns: 1fr; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
