/* ========================================
   Yoki Landing — Single Viewport, Liquid Glass
   Scaled ~150%
   ======================================== */

:root {
  --font: 'Outfit', system-ui, -apple-system, sans-serif;
  --accent: #03A9FC;
  --accent-rgb: 3, 169, 252;
  --accent-dim: rgba(3, 169, 252, 0.08);
  --accent-glow: rgba(3, 169, 252, 0.2);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --glass-blur: 36px;
  --glass-saturate: 180%;
  --glass-radius: 18px;
}

/* ---- DARK ---- */
[data-theme="dark"] {
  --bg: #050507;
  --text: #f0f0f5;
  --text-sub: rgba(240, 240, 245, 0.55);
  --text-dim: rgba(240, 240, 245, 0.28);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.07);
  --glass-highlight: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  --nav-bg: rgba(5, 5, 7, 0.6);
  --kbd-bg: rgba(255, 255, 255, 0.06);
  --code-bg: rgba(255, 255, 255, 0.06);
}

/* ---- LIGHT ---- */
[data-theme="light"] {
  --bg: #f5f5f7;
  --text: #1d1d1f;
  --text-sub: rgba(29, 29, 31, 0.5);
  --text-dim: rgba(29, 29, 31, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-bg-hover: rgba(255, 255, 255, 0.6);
  --glass-highlight: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
  --nav-bg: rgba(245, 245, 247, 0.65);
  --kbd-bg: rgba(0, 0, 0, 0.05);
  --code-bg: rgba(0, 0, 0, 0.04);
}

/* ---- RESET ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

a { color: inherit; text-decoration: none; }

/* ---- BACKGROUND ---- */
#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}

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

/* ---- GLASS ---- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

/* ---- NAV ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 40px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.5s var(--ease), border 0.5s var(--ease);
}

.nav-inner {
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.logo-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-sub);
}

.nav-links a:not(.nav-cta) { transition: color 0.2s; }
.nav-links a:not(.nav-cta):hover { color: var(--text); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: var(--glass-bg);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 3px rgba(255, 255, 255, 0.08);
}
.theme-toggle:hover { background: var(--glass-bg-hover); color: var(--text); }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: 12px;
  box-shadow: inset 0 0 3px rgba(255, 255, 255, 0.15);
  transition: transform 0.2s var(--spring), box-shadow 0.2s;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px var(--accent-glow), inset 0 0 3px rgba(255, 255, 255, 0.15);
}

/* ---- PAGE LAYOUT ---- */
.page {
  max-width: 1800px;
  margin: 0 auto;
  padding: 80px 40px 0;
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 56px;
  align-items: start;
  min-height: calc(100vh - 50px);
}

/* ---- HERO ---- */
.hero {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  padding-top: 20px;
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
  animation: fadeUp 0.7s var(--ease) both;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 32px;
  animation: fadeUp 0.7s var(--ease) 0.1s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  animation: fadeUp 0.7s var(--ease) 0.2s both;
}

.hero-shortcut {
  font-size: 1.1rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 3px;
}

.hero-mascot {
  animation: dragonEnter 0.9s var(--ease) 0.3s both;
}

.dragon-img {
  width: 340px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(var(--accent-rgb), 0.18));
  animation: dragonFloat 5s ease-in-out 1.2s infinite;
}

@keyframes dragonEnter {
  from { opacity: 0; transform: translateY(30px) scale(0.85) rotate(5deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}

@keyframes dragonFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-10px) rotate(-1deg); }
  70% { transform: translateY(4px) rotate(0.5deg); }
}

/* ---- BUTTONS ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 600;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: transform 0.2s var(--spring), box-shadow 0.2s;
}
.btn-primary {
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.12);
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 28px var(--accent-glow), inset 0 0 4px rgba(255, 255, 255, 0.12);
}

kbd {
  display: inline-block;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  padding: 4px 10px;
  background: var(--kbd-bg);
  border: 1px solid var(--glass-border);
  border-radius: 7px;
  color: var(--text-sub);
}

code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1rem;
  padding: 4px 10px;
  background: var(--code-bg);
  border-radius: 6px;
  color: var(--accent);
}

/* ---- FEATURES GRID ---- */
.features {
  display: grid;
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 16px;
  padding-top: 20px;
  overflow-x: auto;
  padding-right: 40px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

/* ---- BENTO CARD ---- */
.bento-card {
  padding: 26px 28px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(
    400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(var(--accent-rgb), 0.06),
    transparent 40%
  );
  transition: opacity 0.3s;
  pointer-events: none;
}
.bento-card:hover::before { opacity: 1; }
.bento-card:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-2px);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.ico { font-size: 1.7rem; font-variant-emoji: text; }

.bento-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bento-card h3::after {
  content: ' +';
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.8em;
}
.bento-card.expanded h3::after {
  content: ' \2212';
  color: var(--accent);
}

.bento-card > p {
  font-size: 1.05rem;
  color: var(--text-sub);
  line-height: 1.5;
}

/* Expand */
.bento-expand {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s var(--ease), opacity 0.25s var(--ease), margin 0.25s var(--ease);
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bento-expand code {
  white-space: nowrap;
  font-size: 0.88rem;
}

.bento-card.expanded .bento-expand,
.bento-card:hover .bento-expand {
  max-height: 100px;
  opacity: 1;
  margin-top: 10px;
}

.bento-card.expanded,
.bento-card:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(var(--accent-rgb), 0.12);
}

/* ---- FOOTER ---- */
.footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px;
  font-size: 0.95rem;
  color: var(--text-dim);
  pointer-events: none;
}

.footer span { pointer-events: auto; }

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */

/* Tablet landscape / small desktop */
@media (max-width: 1200px) {
  .page {
    grid-template-columns: 360px 1fr;
    gap: 36px;
    padding: 76px 32px 0;
  }
  .hero h1 { font-size: 2.2rem; }
  .dragon-img { width: 250px; }
}

/* Tablet */
@media (max-width: 1000px) {
  .page {
    grid-template-columns: 1fr;
    padding: 72px 32px 80px;
    min-height: auto;
    gap: 32px;
  }
  .hero {
    position: static;
    text-align: center;
    align-items: center;
  }
  .hero h1 { font-size: 2.4rem; }
  .hero p { max-width: 500px; }
  .hero-mascot { display: none; }
  .hero-actions { justify-content: center; }
  .features {
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(3, 1fr);
    overflow-x: visible;
    padding-right: 0;
  }
  .footer {
    position: static;
    justify-content: center;
    gap: 16px;
    padding: 20px 32px;
  }
}

/* Small tablet */
@media (max-width: 780px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow-x: visible;
    padding-right: 0;
  }
  .hero h1 { font-size: 2rem; }
  .nav-inner { height: 56px; }
  .page { padding-top: 64px; }
}

/* Mobile */
@media (max-width: 520px) {
  .nav { padding: 0 20px; }
  .nav-links a:not(.nav-cta):not(.theme-toggle) { display: none; }
  .nav-links .theme-toggle { display: flex; }
  .page {
    padding: 60px 20px 60px;
    gap: 24px;
  }
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: 1rem; }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .btn-primary {
    width: 100%;
    justify-content: center;
  }
  .features {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow-x: visible;
    padding-right: 0;
  }
  .bento-card {
    padding: 18px 20px;
  }
  .footer {
    flex-direction: column;
    gap: 4px;
    text-align: center;
    padding: 16px 20px;
  }
}
