/**
 * Ariam Chat — single stylesheet (source of truth)
 * Base layout + modern immersive layer (cascade order: modern wins)
 */

/* Geez Able @font-face stays in index.html (paired with <link rel="preload">) */

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

:root {
      --nav-h: clamp(52px, 8vw, 72px);
      --page-pad: 15px;
      --font-ui: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
      --font-family: 'Geez Able', var(--font-ui);
      --bg: #070b14;
      --cyan: #22d3ee;
      --blue: #38bdf8;
      --purple: #8b5cf6;
      --magenta: #e879f9;
      --text: #f8fafc;
      --muted: #94a3b8;
      --glass: rgba(15, 23, 42, 0.42);
      --glass-border: rgba(148, 163, 184, 0.18);
      --glow: 0 0 28px rgba(34, 211, 238, 0.3);
      --ease: cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* ── Bulletproof CSS reset + mobile-first base ── */
    *, *::before, *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    html {
      -webkit-text-size-adjust: 100%;
      text-size-adjust: 100%;
      scroll-behavior: smooth;
      overflow-x: hidden;
      width: 100%;
      max-width: 100%;
      font-family: var(--font-family);
      font-size: clamp(15px, 2.6vw, 18px);
    }

    body {
      font-family: var(--font-family);
      font-size: clamp(0.94rem, 2.4vw, 1.06rem);
      line-height: 1.55;
      background: var(--bg);
      color: var(--text);
      min-height: 100dvh;
      width: 100%;
      max-width: 100%;
      overflow-x: hidden;
      position: relative;
    }

    img, video, canvas, iframe, svg {
      display: block;
      max-width: 100%;
      height: auto;
    }

    button, input, textarea, select {
      font: inherit;
      color: inherit;
      max-width: 100%;
    }

    a { color: inherit; }

    .nav-logo,
    .avatar-control-icon svg {
      max-width: none;
      height: auto;
    }

    .navbar,
    #home,
    .hero-visual,
    .orb-zone,
    .chat-sidebar,
    .section,
    .site-footer,
    .footer-inner {
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }

    .navbar,
    #home,
    .section,
    .site-footer {
      overflow-x: clip;
    }

    /* Background atmosphere + grid removal live in /assets/style.css */

    /* ── Navbar ── */
    .navbar {
      position: sticky;
      top: 0;
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      max-width: 100vw;
      padding: 0.85rem clamp(1rem, 3vw, 2rem);
      box-sizing: border-box;
      background: rgba(11, 15, 25, 0.82);
      backdrop-filter: blur(20px);
      border-bottom: 1px solid var(--glass-border);
      box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
    }

    .nav-brand {
      display: inline-flex;
      align-items: center;
      gap: 0.55rem;
      text-decoration: none;
      min-width: 0;
      flex-shrink: 1;
    }

    .nav-logo {
      width: 54px;
      height: 54px;
      flex-shrink: 0;
      display: block;
      object-fit: contain;
      filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.35));
    }

    .nav-brand-text {
      font-size: clamp(1rem, 3.5vw, 1.5rem);
      font-weight: 800;
      letter-spacing: -0.03em;
      background: linear-gradient(135deg, var(--cyan), var(--blue));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      white-space: nowrap;
    }

    .nav-links {
      display: flex;
      align-items: center;
      gap: 2rem;
      list-style: none;
    }

    .nav-links a {
      color: var(--muted);
      text-decoration: none;
      font-size: 0.88rem;
      font-weight: 500;
      transition: color 0.25s var(--ease);
    }

    .nav-links a:hover { color: var(--cyan); }

    .nav-right {
      display: flex;
      align-items: center;
      gap: 1rem;
    }

    .mode-toggle {
      display: flex;
      background: var(--glass);
      border: 1px solid var(--glass-border);
      border-radius: 999px;
      padding: 3px;
      backdrop-filter: blur(12px);
      box-shadow: var(--glow);
    }

    .mode-btn {
      padding: 0.45rem 1rem;
      border: none;
      border-radius: 999px;
      background: transparent;
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: all 0.3s var(--ease);
    }

    .mode-btn.active {
      background: linear-gradient(135deg, rgba(34, 211, 238, 0.3), rgba(56, 189, 248, 0.2));
      color: #fff;
      box-shadow: 0 0 16px rgba(34, 211, 238, 0.25);
    }

    .nav-toggle {
      display: none;
      background: none;
      border: 1px solid var(--glass-border);
      border-radius: 8px;
      color: var(--text);
      padding: 0.4rem 0.6rem;
      cursor: pointer;
      font-size: 1.1rem;
      z-index: 320;
    }

    .nav-drawer-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(2, 6, 23, 0.62);
      backdrop-filter: blur(4px);
      z-index: 280;
      opacity: 0;
      transition: opacity 0.28s var(--ease);
      pointer-events: none;
    }

    .nav-drawer-backdrop.open {
      display: block;
      opacity: 1;
      pointer-events: auto;
    }

    /* ── Hero (mobile-first: stacked column) ── */
    #home {
      position: relative;
      z-index: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      gap: 0;
      width: 100%;
      max-width: 100%;
      margin: 0 auto;
      padding: var(--page-pad);
      box-sizing: border-box;
      min-height: calc(100dvh - var(--nav-h));
      overflow: hidden;
    }

    .hero-visual {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      flex: 1 1 52%;
      min-height: 0;
      width: 100%;
      max-width: 100%;
      overflow: hidden;
      border-radius: 0 0 20px 20px;
    }

    .chat-sidebar {
      display: flex;
      flex-direction: column;
      flex: 1 1 48%;
      min-height: 0;
      width: 100%;
      max-width: 100%;
      /* Glass look finalized in /assets/style.css */
      overflow: hidden;
    }

    #vizCanvas {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
    }

    .orb-zone {
      position: relative;
      z-index: 5;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: clamp(0.65rem, 2.5vw, 1.15rem);
      padding: var(--page-pad);
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }

    .hero-greeting {
      position: relative;
      z-index: 6;
      margin: 0 0 -0.15rem;
      padding: 1.2rem 1.6rem 1.3rem;
      max-width: min(540px, 94vw);
      text-align: center;
      direction: ltr;
      unicode-bidi: plaintext;
      pointer-events: none;
      transform: translateY(-0.85rem);
      background: linear-gradient(145deg, rgba(15, 23, 42, 0.82), rgba(34, 211, 238, 0.07));
      border: 1px solid rgba(34, 211, 238, 0.32);
      border-radius: 22px;
      backdrop-filter: blur(18px);
      box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.28),
        0 0 48px rgba(34, 211, 238, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
      transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
    }

    .hero-greeting::after {
      content: "";
      position: absolute;
      bottom: -1px;
      left: 50%;
      transform: translateX(-50%);
      width: 56px;
      height: 3px;
      border-radius: 999px;
      background: linear-gradient(90deg, transparent, var(--cyan), var(--blue), transparent);
      opacity: 0.85;
    }

    .hero-greeting-lead {
      display: block;
      font-size: clamp(1.45rem, 4.8vw, 2.15rem);
      font-weight: 800;
      line-height: 1.3;
      margin-bottom: 0.5rem;
      letter-spacing: -0.02em;
      background: linear-gradient(135deg, #ffffff 0%, var(--cyan) 48%, var(--blue) 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .hero-greeting-body {
      display: block;
      font-size: clamp(1.05rem, 3.4vw, 1.4rem);
      font-weight: 600;
      line-height: 1.55;
      color: #e2e8f0;
      text-shadow: 0 1px 12px rgba(34, 211, 238, 0.15);
    }

    .hero-tagline {
      margin: -0.35rem 0 0;
      font-size: clamp(0.88rem, 2.6vw, 1.02rem);
      font-weight: 600;
      color: rgba(148, 163, 184, 0.95);
      text-align: center;
      letter-spacing: 0.02em;
    }

    .hero-chips {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 0.5rem;
      max-width: min(520px, 94vw);
    }

    .hero-chip {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.4rem 0.85rem;
      border-radius: 999px;
      font-size: 0.82rem;
      font-weight: 700;
      color: #e2e8f0;
      background: rgba(15, 23, 42, 0.72);
      border: 1px solid rgba(34, 211, 238, 0.28);
      box-shadow: 0 0 18px rgba(34, 211, 238, 0.08);
      font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", var(--font-family);
    }

    .hero-cta {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.45rem;
      margin-top: 0.15rem;
      padding: 0.7rem 1.35rem;
      border-radius: 999px;
      text-decoration: none;
      font-size: 0.92rem;
      font-weight: 800;
      color: #0b0f19;
      background: linear-gradient(135deg, var(--cyan), var(--blue));
      box-shadow: 0 0 28px rgba(34, 211, 238, 0.35);
      transition: transform 0.25s var(--ease), box-shadow 0.25s;
    }

    .hero-cta:hover {
      transform: translateY(-2px);
      box-shadow: 0 0 36px rgba(34, 211, 238, 0.5);
    }

    .hero-cta::after { content: "↓"; font-weight: 900; }

    .hero-visual.live .hero-greeting,
    .hero-visual.connecting .hero-greeting {
      opacity: 0.72;
      transform: translateY(-0.85rem) scale(0.98);
    }

    .avatar-stack {
      position: relative;
      width: clamp(168px, 28vw, 220px);
      height: clamp(168px, 28vw, 220px);
      display: grid;
      place-items: center;
      flex-shrink: 0;
    }

    .avatar-halo {
      position: absolute;
      inset: -8%;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(34, 211, 238, 0.14), transparent 68%);
      pointer-events: none;
      transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
    }

    .hero-visual.live .avatar-stack { width: clamp(188px, 32vw, 240px); height: clamp(188px, 32vw, 240px); }
    .hero-visual.connecting .avatar-stack { width: clamp(178px, 30vw, 225px); height: clamp(178px, 30vw, 225px); }

    .talking-avatar.orb-btn {
      position: relative;
      width: 100%;
      height: 100%;
      padding: 0;
      border: none;
      border-radius: 50%;
      cursor: pointer;
      background: transparent;
      box-shadow: none;
      transition: transform 0.3s var(--ease);
      z-index: 2;
    }

    .talking-avatar.orb-btn:hover:not(:disabled) { transform: scale(1.03); }
    .talking-avatar.orb-btn:active:not(:disabled) { transform: scale(0.97); }
    .talking-avatar.orb-btn:disabled { opacity: 0.5; cursor: not-allowed; }

    .avatar-inner {
      position: relative;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      overflow: hidden;
      background: linear-gradient(165deg, #1e3a5f 0%, #0f172a 45%, #1a1033 100%);
      box-shadow:
        0 0 0 2px rgba(34, 211, 238, 0.35),
        0 0 48px rgba(34, 211, 238, 0.22),
        0 16px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
      transition: box-shadow 0.4s var(--ease), transform 0.35s var(--ease);
    }

    .hero-visual.live .avatar-inner {
      box-shadow:
        0 0 0 3px rgba(56, 189, 248, 0.5),
        0 0 64px rgba(34, 211, 238, 0.38),
        0 0 100px rgba(232, 121, 249, 0.18),
        inset 0 0 36px rgba(34, 211, 238, 0.08);
    }

    .avatar-portrait {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      padding-bottom: 4%;
    }

    .avatar-svg {
      width: 92%;
      height: auto;
      filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
    }

    .avatar-video {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 50%;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.35s ease;
    }

    .avatar-video.show { opacity: 1; }

    .avatar-mouth-ring {
      position: absolute;
      bottom: 18%;
      left: 50%;
      width: 22%;
      height: 8%;
      transform: translateX(-50%);
      border-radius: 999px;
      background: rgba(232, 121, 249, 0.35);
      opacity: 0;
      transition: opacity 0.25s ease;
    }

    .avatar-inner.listening .avatar-mouth-ring {
      opacity: 0.45;
      animation: avatarListen 1.4s ease-in-out infinite;
    }

    @keyframes avatarListen {
      0%, 100% { transform: translateX(-50%) scaleX(1); opacity: 0.35; }
      50% { transform: translateX(-50%) scaleX(1.15); opacity: 0.65; }
    }

    /* Cyan neon talking glow defined in /assets/style.css */
    @keyframes avatarMouthTalk {
      0%, 100% { transform: translateX(-50%) scaleY(0.7); }
      50% { transform: translateX(-50%) scaleY(1.25); }
    }

    .hero-visual.live .avatar-halo {
      animation: ringPulse 2s ease-in-out infinite;
      opacity: 1;
    }

    .hero-visual.connecting .avatar-halo {
      animation: ringPulse 1.5s ease-in-out infinite;
    }

    @keyframes ringPulse {
      0%, 100% { transform: scale(1); opacity: 0.55; }
      50% { transform: scale(1.12); opacity: 1; }
    }

    .avatar-control-icon {
      position: absolute;
      right: 4%;
      bottom: 4%;
      width: clamp(36px, 9vw, 44px);
      height: clamp(36px, 9vw, 44px);
      border-radius: 50%;
      display: grid;
      place-items: center;
      background: rgba(15, 23, 42, 0.92);
      border: 1px solid rgba(34, 211, 238, 0.45);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
      pointer-events: none;
    }

    .avatar-control-icon svg {
      width: 52%;
      height: 52%;
      fill: url(#micGrad);
      filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.6));
    }

    .hero-visual.live .avatar-control-icon svg { fill: url(#stopGrad); }

    .avatar-name-badge {
      position: absolute;
      top: 6%;
      left: 50%;
      transform: translateX(-50%);
      padding: 0.2rem 0.55rem;
      border-radius: 999px;
      font-size: 0.68rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--cyan);
      background: rgba(15, 23, 42, 0.75);
      border: 1px solid rgba(34, 211, 238, 0.35);
      pointer-events: none;
    }

    .status-label {
      font-size: clamp(0.82rem, 2.8vw, 1rem);
      font-weight: 600;
      color: var(--cyan);
      letter-spacing: 0.02em;
      text-align: center;
      min-height: 1.2em;
      transition: color 0.3s, opacity 0.3s;
    }

    .status-label:empty { display: none; }

    .hero-visual.live .status-label { color: var(--cyan); }
    .hero-visual.speaking .status-label { color: var(--magenta); }

    .status-sub {
      font-size: 0.78rem;
      color: rgba(148, 163, 184, 0.85);
      margin-top: -1rem;
    }

    /* ── Chat Sidebar (desktop overrides in min-width query) ── */

    .chat-header {
      padding: 1.25rem 1.5rem;
      border-bottom: 1px solid rgba(34, 211, 238, 0.12);
      font-weight: 700;
      font-size: 0.95rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .chat-header::before {
      content: "";
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--cyan);
      box-shadow: 0 0 10px var(--cyan);
    }

    .chat-messages {
      flex: 1;
      overflow-y: auto;
      padding: 1.25rem 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
      scrollbar-width: thin;
      scrollbar-color: rgba(34, 211, 238, 0.4) transparent;
    }

    .chat-messages::-webkit-scrollbar { width: 6px; }
    .chat-messages::-webkit-scrollbar-track { background: transparent; }
    .chat-messages::-webkit-scrollbar-thumb {
      background: rgba(34, 211, 238, 0.35);
      border-radius: 999px;
    }
    .chat-messages::-webkit-scrollbar-thumb:hover {
      background: rgba(34, 211, 238, 0.55);
    }

    .msg {
      max-width: min(92%, 100%);
      padding: clamp(0.65rem, 2vw, 0.85rem) clamp(0.8rem, 2.5vw, 1.1rem);
      border-radius: 16px;
      font-size: clamp(0.92rem, 2.8vw, 1.05rem);
      line-height: 1.65;
      animation: fadeUp 0.35s var(--ease);
      white-space: pre-wrap;
      word-wrap: break-word;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(8px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .msg.user {
      align-self: flex-end;
      color: #f8fafc;
      font-weight: 500;
      background: linear-gradient(135deg, rgba(34, 211, 238, 0.28), rgba(56, 189, 248, 0.22));
      border: 1px solid rgba(34, 211, 238, 0.4);
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    }

    .msg.model {
      align-self: flex-start;
      color: #f8fafc;
      font-weight: 500;
      background: linear-gradient(145deg, rgba(51, 65, 85, 0.95), rgba(30, 41, 59, 0.92));
      border: 1px solid rgba(148, 163, 184, 0.35);
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    }

    .msg.model strong {
      color: #67e8f9;
      font-weight: 700;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    }

    .msg.model a {
      color: #7dd3fc;
      font-weight: 600;
      text-decoration: underline;
      text-underline-offset: 2px;
      text-shadow: none;
    }
    .msg.model a:hover { color: #bae6fd; }

    .typing {
      align-self: flex-start;
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 0.65rem 1rem;
      margin: 0;
      min-height: 2.25rem;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .typing.show {
      opacity: 1;
      visibility: visible;
    }

    .typing span {
      width: 6px;
      height: 6px;
      background: var(--cyan);
      border-radius: 50%;
      animation: typingDot 1.1s ease-in-out infinite;
      will-change: opacity, transform;
    }

    .typing span:nth-child(2) { animation-delay: 0.18s; }
    .typing span:nth-child(3) { animation-delay: 0.36s; }

    @keyframes typingDot {
      0%, 70%, 100% { opacity: 0.35; transform: scale(0.88); }
      35% { opacity: 1; transform: scale(1); }
    }

    .chat-input-bar {
      padding: 1rem 1.25rem 1.25rem;
      border-top: 1px solid rgba(34, 211, 238, 0.12);
    }

    .chat-input-row {
      display: flex;
      gap: 0.6rem;
      background: rgba(11, 15, 25, 0.7);
      border: 1px solid var(--glass-border);
      border-radius: 16px;
      padding: 0.45rem 0.45rem 0.45rem 1rem;
      backdrop-filter: blur(12px);
      box-shadow: inset 0 0 20px rgba(34, 211, 238, 0.04);
    }

    .chat-input-row input {
      flex: 1;
      min-width: 0;
      border: none;
      background: transparent;
      color: var(--text);
      font-size: clamp(0.82rem, 2.6vw, 0.92rem);
      font-family: inherit;
      outline: none;
    }

    .chat-input-row input::placeholder { color: var(--muted); }
    .chat-input-row input:disabled { opacity: 0.5; cursor: not-allowed; }

    .btn-send {
      padding: 0.65rem 1.15rem;
      border: none;
      border-radius: 12px;
      background: linear-gradient(135deg, var(--cyan), var(--blue));
      color: #fff;
      font-weight: 700;
      font-size: 0.82rem;
      cursor: pointer;
      font-family: inherit;
      transition: transform 0.2s, opacity 0.2s;
      white-space: nowrap;
    }

    .btn-send:hover:not(:disabled) { transform: scale(1.03); }
    .btn-send:disabled { opacity: 0.4; cursor: not-allowed; }

    /* ── Quick-action link bar ── */
    .quick-links {
      display: none;
      flex-wrap: wrap;
      gap: 0.5rem;
      padding: 0.75rem 1rem;
      border-top: 1px solid rgba(34, 211, 238, 0.15);
      background: rgba(34, 211, 238, 0.06);
      animation: quickFadeIn 0.35s var(--ease);
    }

    .quick-links.show { display: flex; }

    @keyframes quickFadeIn {
      from { opacity: 0; transform: translateY(6px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .quick-link-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.5rem 0.85rem;
      border-radius: 999px;
      border: 1px solid rgba(34, 211, 238, 0.45);
      background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(56, 189, 248, 0.12));
      color: var(--cyan);
      font-size: 0.72rem;
      font-weight: 700;
      text-decoration: none;
      transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
      box-shadow: 0 0 16px rgba(34, 211, 238, 0.15);
    }

    .quick-link-btn:hover {
      transform: scale(1.04);
      border-color: var(--cyan);
      box-shadow: 0 0 24px rgba(34, 211, 238, 0.35);
      color: #fff;
    }

    /* ── Inline link badges in chat transcript ── */
    .msg-link-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 0.45rem;
      margin-top: 0.65rem;
      padding-top: 0.55rem;
      border-top: 1px solid rgba(34, 211, 238, 0.12);
      animation: quickFadeIn 0.3s var(--ease);
    }

    .link-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.45rem 0.8rem;
      border-radius: 10px;
      border: 1px solid rgba(34, 211, 238, 0.45);
      background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(56, 189, 248, 0.1));
      color: var(--cyan);
      font-size: 0.72rem;
      font-weight: 700;
      text-decoration: none;
      transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
      box-shadow: 0 0 14px rgba(34, 211, 238, 0.12);
      word-break: break-all;
    }

    .link-badge:hover {
      transform: translateY(-1px) scale(1.02);
      border-color: var(--cyan);
      color: #fff;
      box-shadow: 0 0 22px rgba(34, 211, 238, 0.35);
    }

    .link-badge-icon {
      font-size: 0.95rem;
      flex-shrink: 0;
      font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    }

    .link-badge-host {
      opacity: 0.9;
    }

    /* ── Isolated quick-action cards (voice mode) ── */
    .msg.action-card-wrap {
      background: transparent;
      border: none;
      padding: 0.35rem 0.75rem;
      max-width: 100%;
      animation: quickFadeIn 0.35s var(--ease);
    }

    .action-card-hint {
      font-size: 0.82rem;
      font-weight: 600;
      letter-spacing: 0.03em;
      color: rgba(34, 211, 238, 0.85);
      margin: 0 0 0.5rem 0.15rem;
    }

    .action-card {
      display: flex;
      flex-direction: column;
      gap: 0.55rem;
      width: 100%;
    }

    .action-card-btn {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 0.65rem;
      width: 100%;
      min-height: 52px;
      padding: 0.75rem 1.05rem;
      border-radius: 14px;
      border: 1px solid rgba(34, 211, 238, 0.55);
      background: linear-gradient(135deg, rgba(34, 211, 238, 0.24), rgba(56, 189, 248, 0.14));
      color: var(--cyan);
      font-size: 1rem;
      font-weight: 700;
      text-decoration: none;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
      transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
      box-shadow: 0 0 18px rgba(34, 211, 238, 0.2);
    }

    .action-card-btn:hover {
      transform: scale(1.03);
      border-color: var(--cyan);
      box-shadow: 0 0 26px rgba(34, 211, 238, 0.35);
      color: #fff;
    }

    .action-card-icon {
      font-size: 1.25rem;
      line-height: 1;
      flex-shrink: 0;
      font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    }

    .action-card-label {
      line-height: 1.45;
      font-size: 1rem;
    }

    .action-card-btn.action-register-btn {
      cursor: pointer;
      border: 1px solid rgba(34, 211, 238, 0.45);
      background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(56, 189, 248, 0.12));
    }

    .register-form-wrap {
      align-self: stretch;
      max-width: 100%;
      background: rgba(15, 23, 42, 0.75);
      border: 1px solid rgba(34, 211, 238, 0.28);
      border-radius: 16px;
      padding: 1rem 1.1rem;
      display: grid;
      gap: 0.65rem;
    }

    .register-form-title {
      font-weight: 700;
      color: var(--cyan);
      font-size: 0.95rem;
      margin: 0;
    }

    .register-form-hint {
      margin: 0;
      font-size: 0.88rem;
      color: rgba(148, 163, 184, 0.95);
      line-height: 1.5;
    }

    .register-form-wrap input {
      width: 100%;
      border: 1px solid rgba(148, 163, 184, 0.25);
      border-radius: 12px;
      background: rgba(11, 15, 25, 0.85);
      color: #fff;
      padding: 0.7rem 0.85rem;
      font-family: inherit;
      font-size: 1rem;
    }

    .register-form-wrap input:focus {
      outline: none;
      border-color: rgba(34, 211, 238, 0.55);
      box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
    }

    .register-submit-btn {
      border: none;
      border-radius: 12px;
      padding: 0.75rem 1rem;
      font-weight: 700;
      font-family: inherit;
      font-size: 0.95rem;
      cursor: pointer;
      color: #0b0f19;
      background: linear-gradient(135deg, var(--cyan), var(--blue));
    }

    .register-submit-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    .register-form-msg {
      margin: 0;
      font-size: 0.85rem;
      min-height: 1.2em;
      color: #86efac;
    }

    .register-form-msg.error {
      color: #fca5a5;
    }

    /* ── Tech Production Bento Grid ── */
    .product-grid.bento {
      display: grid;
      grid-template-columns: repeat(12, 1fr);
      gap: 1.25rem;
      align-items: stretch;
    }

    .product-grid.bento .product-card[data-id="ariam_academy"] {
      grid-column: 1 / 5;
      padding: 1.75rem;
    }

    .product-grid.bento .product-card[data-id="ariam_photostudio"] { grid-column: 5 / 9; }
    .product-grid.bento .product-card[data-id="adam44"] { grid-column: 9 / 13; }
    .product-grid.bento .product-card[data-id="natnaai"] { grid-column: 1 / 7; }
    .product-grid.bento .product-card[data-id="seven1"] { grid-column: 7 / 13; }

    .product-card.featured {
      background: linear-gradient(155deg, rgba(15, 23, 42, 0.88), rgba(34, 211, 238, 0.1));
      border-color: rgba(34, 211, 238, 0.42);
    }

    .product-card.featured .product-icon {
      width: 58px;
      height: 58px;
      font-size: 2rem;
    }

    .product-card.featured h3 { font-size: 1.45rem; }

    .product-badge {
      position: absolute;
      top: 1.1rem;
      right: 1.1rem;
      padding: 0.3rem 0.65rem;
      border-radius: 999px;
      font-size: 0.72rem;
      font-weight: 800;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: #0b0f19;
      background: linear-gradient(135deg, var(--cyan), var(--blue));
    }

    .product-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
      gap: 1.5rem;
    }

    .product-card {
      position: relative;
      display: flex;
      flex-direction: column;
      background: var(--glass);
      backdrop-filter: blur(24px);
      border: 1px solid var(--glass-border);
      border-radius: 24px;
      padding: 2rem;
      overflow: hidden;
      transition: transform 0.35s var(--ease), box-shadow 0.35s, border-color 0.35s;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    }

    .product-card::before {
      content: "";
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 3px;
      background: linear-gradient(90deg, var(--cyan), var(--blue), var(--purple));
      opacity: 0.7;
    }

    .product-card:hover {
      transform: translateY(-6px);
      border-color: rgba(34, 211, 238, 0.55);
      box-shadow: 0 16px 48px rgba(34, 211, 238, 0.18), 0 0 40px rgba(56, 189, 248, 0.12);
    }

    .product-card .product-icon {
      width: 58px;
      height: 58px;
      border-radius: 14px;
      display: grid;
      place-items: center;
      font-size: 2rem;
      margin-bottom: 1.25rem;
      background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(139, 92, 246, 0.15));
      border: 1px solid rgba(34, 211, 238, 0.25);
      box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
      font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
      line-height: 1;
    }

    .product-card h3 {
      font-size: 1.45rem;
      font-weight: 800;
      margin-bottom: 0.35rem;
      letter-spacing: -0.02em;
    }

    .product-card .product-sub {
      font-size: 1rem;
      color: var(--cyan);
      font-weight: 600;
      margin-bottom: 0.95rem;
    }

    .product-card .product-desc {
      color: var(--muted);
      font-size: 1.05rem;
      line-height: 1.7;
      margin-bottom: 1rem;
      flex: 1 1 auto;
      display: -webkit-box;
      -webkit-line-clamp: 4;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .product-card.featured .product-desc {
      -webkit-line-clamp: 3;
    }

    .product-card-foot {
      margin-top: auto;
      padding-top: 0.5rem;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 0.85rem;
      width: 100%;
    }

    .product-card .product-price {
      display: inline-block;
      color: var(--cyan);
      font-weight: 800;
      font-size: 1rem;
      padding: 0.25rem 0.65rem;
      border-radius: 8px;
      background: rgba(34, 211, 238, 0.1);
      border: 1px solid rgba(34, 211, 238, 0.25);
      margin-bottom: 0;
    }

    .product-card .product-price.empty { display: none; }

    .product-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      padding: 0.8rem 1.25rem;
      border-radius: 12px;
      border: 1px solid rgba(34, 211, 238, 0.4);
      background: linear-gradient(135deg, rgba(34, 211, 238, 0.25), rgba(56, 189, 248, 0.15));
      color: #fff;
      font-weight: 700;
      font-size: 0.98rem;
      text-decoration: none;
      transition: transform 0.2s, box-shadow 0.25s;
      box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
    }

    .product-btn:hover {
      transform: scale(1.03);
      box-shadow: 0 0 30px rgba(34, 211, 238, 0.4);
    }

    .product-btn::after { content: "→"; }

    /* ── Sections ── */
    .section {
      position: relative;
      z-index: 1;
      width: 100%;
      max-width: min(1200px, 100vw);
      margin: 0 auto;
      padding: 5rem clamp(1rem, 4vw, 2rem);
      box-sizing: border-box;
    }

    .section-title {
      font-size: clamp(1.35rem, 4.5vw, 2rem);
      font-weight: 800;
      letter-spacing: -0.03em;
      margin-bottom: 0.5rem;
      background: linear-gradient(135deg, #fff, var(--cyan));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .section-sub {
      color: var(--muted);
      font-size: clamp(0.88rem, 2.6vw, 1.08rem);
      margin-bottom: 2.5rem;
      max-width: 640px;
      line-height: 1.7;
    }

    .section-eyebrow {
      display: inline-block;
      margin-bottom: 0.65rem;
      padding: 0.3rem 0.75rem;
      border-radius: 999px;
      font-size: 0.75rem;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--cyan);
      background: rgba(34, 211, 238, 0.1);
      border: 1px solid rgba(34, 211, 238, 0.28);
    }

    .section-divider {
      width: 72px;
      height: 3px;
      margin: 0 0 1.25rem;
      border-radius: 999px;
      background: linear-gradient(90deg, var(--cyan), var(--blue), transparent);
    }

    .course-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
      gap: 1.25rem;
    }

    .glass-card {
      background: var(--glass);
      backdrop-filter: blur(20px);
      border: 1px solid var(--glass-border);
      border-radius: 20px;
      padding: 1.75rem;
      transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }

    .glass-card:hover {
      transform: translateY(-4px);
      border-color: rgba(34, 211, 238, 0.45);
      box-shadow: 0 12px 40px rgba(34, 211, 238, 0.12), var(--glow);
    }

    .glass-card .icon {
      font-size: 2rem;
      margin-bottom: 1rem;
      font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    }

    .glass-card h3 {
      font-size: 1.05rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
    }

    .glass-card .price {
      color: var(--cyan);
      font-weight: 700;
      font-size: 0.95rem;
      margin-bottom: 0.75rem;
    }

    .glass-card p {
      color: var(--muted);
      font-size: 0.85rem;
      line-height: 1.6;
    }

    .contact-card {
      max-width: 520px;
      background: var(--glass);
      backdrop-filter: blur(20px);
      border: 1px solid var(--glass-border);
      border-radius: 24px;
      padding: 2.5rem;
      box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25), var(--glow);
    }

    .contact-card h3 {
      font-size: 1.4rem;
      font-weight: 800;
      margin-bottom: 1.25rem;
    }

    .contact-row {
      display: flex;
      align-items: flex-start;
      gap: 1rem;
      margin-bottom: 1.25rem;
      font-size: 0.95rem;
    }

    .contact-row .label {
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      min-width: 70px;
    }

    .contact-row a {
      color: var(--cyan);
      text-decoration: none;
    }

    .contact-row a:hover { text-decoration: underline; }

    /* ── Footer ── */
    .site-footer {
      position: relative;
      z-index: 1;
      margin-top: 1rem;
      padding: 3rem clamp(1rem, 4vw, 2rem) 2rem;
      border-top: 1px solid rgba(34, 211, 238, 0.15);
      background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.55));
    }

    .footer-inner {
      max-width: min(1200px, 100vw);
      margin: 0 auto;
      display: grid;
      grid-template-columns: 1.2fr 1fr;
      gap: 2rem;
      align-items: start;
    }

    .footer-brand h3 {
      font-size: 1.35rem;
      font-weight: 800;
      margin-bottom: 0.45rem;
      background: linear-gradient(135deg, #fff, var(--cyan));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .footer-brand p {
      color: var(--muted);
      font-size: 0.95rem;
      line-height: 1.65;
      max-width: 420px;
    }

    .footer-powered {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      margin-top: 0.85rem;
      padding: 0.35rem 0.75rem;
      border-radius: 999px;
      font-size: 0.78rem;
      font-weight: 800;
      color: var(--cyan);
      border: 1px solid rgba(34, 211, 238, 0.28);
      background: rgba(34, 211, 238, 0.08);
    }

    .footer-links {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0.55rem 1.25rem;
    }

    .footer-links a {
      color: var(--muted);
      text-decoration: none;
      font-size: 0.9rem;
      font-weight: 600;
      transition: color 0.2s;
    }

    .footer-links a:hover { color: var(--cyan); }

    .footer-copy {
      grid-column: 1 / -1;
      margin-top: 0.5rem;
      padding-top: 1.25rem;
      border-top: 1px solid rgba(34, 211, 238, 0.1);
      text-align: center;
      color: rgba(148, 163, 184, 0.85);
      font-size: 0.82rem;
    }

    .footer-copy strong { color: var(--text); }

    /* Desktop home layout overridden in /assets/style.css */

    /* ── Tablet / mobile nav drawer ── */
    @media (max-width: 960px) {
      .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: min(280px, 86vw);
        height: 100dvh;
        margin: 0;
        padding: 4.75rem 1.25rem 1.5rem;
        gap: 0.35rem;
        background: rgba(11, 15, 25, 0.98);
        backdrop-filter: blur(24px);
        border-left: 1px solid var(--glass-border);
        box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
        z-index: 300;
        transform: translateX(110%);
        visibility: hidden;
        transition: transform 0.3s var(--ease), visibility 0.3s;
        pointer-events: none;
      }

      .nav-links.open {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
      }

      .nav-links li { width: 100%; }

      .nav-links a {
        display: block;
        width: 100%;
        padding: 0.85rem 0.75rem;
        border-radius: 10px;
        font-size: 0.92rem;
      }

      .nav-links a:hover {
        background: rgba(34, 211, 238, 0.1);
        color: var(--cyan);
      }

      .nav-toggle { display: block; }
      .navbar {
        position: sticky;
        flex-wrap: nowrap;
        z-index: 310;
      }
      .product-grid.bento {
        grid-template-columns: repeat(2, 1fr);
      }

      .product-grid.bento .product-card[data-id="ariam_academy"],
      .product-grid.bento .product-card[data-id="ariam_photostudio"],
      .product-grid.bento .product-card[data-id="adam44"],
      .product-grid.bento .product-card[data-id="natnaai"],
      .product-grid.bento .product-card[data-id="seven1"] {
        grid-column: auto;
        grid-row: auto;
      }

      .footer-inner { grid-template-columns: 1fr; }
      .product-grid { grid-template-columns: repeat(2, 1fr); }
    }

    /* ── Mobile strict layout (max-width: 768px) ── */
    @media (max-width: 768px) {
      :root { --page-pad: 15px; }

      .navbar,
      #home,
      .hero-visual,
      .orb-zone,
      .hero-greeting,
      .chat-header,
      .chat-messages,
      .chat-input-bar,
      .quick-links,
      .section,
      .site-footer,
      .footer-inner,
      .contact-card,
      .product-card,
      .glass-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
      }

      .navbar,
      #home,
      .orb-zone,
      .hero-greeting,
      .section,
      .site-footer,
      .footer-inner,
      .contact-card {
        padding-left: var(--page-pad);
        padding-right: var(--page-pad);
      }

      .navbar {
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
        min-height: var(--nav-h);
      }

      .nav-brand { gap: 0.5rem; }
      .nav-logo { width: clamp(40px, 11vw, 46px); height: clamp(40px, 11vw, 46px); }
      .mode-btn { padding: 0.35rem 0.75rem; font-size: clamp(0.68rem, 2.2vw, 0.78rem); }
      .mode-toggle { padding: 2px; }

      #home {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        height: auto;
        min-height: calc(100dvh - var(--nav-h));
        max-height: none;
        padding: var(--page-pad);
        gap: 0.85rem;
        overflow: visible;
      }

      .hero-visual {
        flex: 1 1 52%;
        min-height: 0;
        height: auto;
        padding: var(--page-pad) var(--page-pad) 0.35rem;
        border-radius: 16px 16px 0 0;
        overflow: hidden;
      }

      .orb-zone {
        gap: clamp(0.55rem, 2vw, 0.85rem);
        padding: var(--page-pad);
        margin-top: 0;
      }

      .hero-greeting {
        padding: 0.85rem 1rem 1rem;
        border-radius: 18px;
        max-width: 100%;
        transform: translateY(-0.35rem);
        margin-bottom: 0;
      }

      .hero-visual.live .hero-greeting,
      .hero-visual.connecting .hero-greeting {
        transform: translateY(-0.35rem) scale(0.98);
      }

      .hero-tagline,
      .hero-chips,
      .hero-cta {
        max-width: 100%;
      }

      .hero-chip {
        font-size: clamp(0.72rem, 2.4vw, 0.82rem);
      }

      .avatar-stack {
        width: clamp(108px, 32vw, 132px);
        height: clamp(108px, 32vw, 132px);
      }

      .hero-visual.live .avatar-stack,
      .hero-visual.connecting .avatar-stack {
        width: clamp(118px, 34vw, 142px);
        height: clamp(118px, 34vw, 142px);
      }

      .avatar-control-icon {
        width: clamp(28px, 8vw, 34px);
        height: clamp(28px, 8vw, 34px);
      }

      .status-label {
        line-height: 1.35;
        margin-top: 0.5rem;
        max-width: 100%;
        padding: 0;
      }

      .status-sub { display: none; }

      .chat-sidebar {
        flex: 1 1 48%;
        min-height: 0;
        height: auto;
        padding: 0;
        border-left: none;
        border-top: 1px solid var(--glass-border);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.28);
        overflow: hidden;
      }

      .chat-header {
        padding: 0.55rem var(--page-pad);
        font-size: clamp(0.78rem, 2.5vw, 0.88rem);
      }

      .chat-messages {
        padding: 0.5rem var(--page-pad);
        gap: 0.45rem;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }

      .msg {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
      }

      .chat-input-bar {
        padding: 0.45rem var(--page-pad) 0.65rem;
      }

      .chat-input-row {
        width: 100%;
        min-width: 0;
        padding: 0.4rem 0.4rem 0.4rem 0.75rem;
      }

      .chat-input-row input {
        min-width: 0;
        width: 100%;
      }

      .btn-send {
        padding: 0.5rem 0.75rem;
        font-size: clamp(0.72rem, 2.2vw, 0.8rem);
        flex-shrink: 0;
      }

      .quick-links {
        padding: 0  var(--page-pad) 0.35rem;
        gap: 0.4rem;
      }

      .quick-link-btn {
        font-size: clamp(0.65rem, 2.2vw, 0.72rem);
        padding: 0.35rem 0.6rem;
        max-width: 100%;
        overflow-wrap: anywhere;
      }

      .action-card-btn,
      .action-card-label,
      .register-form-wrap,
      .register-form-wrap input {
        max-width: 100%;
      }

      .section {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
      }

      .product-grid,
      .product-grid.bento,
      .course-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
      }

      .product-grid.bento .product-card[data-id="ariam_academy"],
      .product-grid.bento .product-card[data-id="ariam_photostudio"],
      .product-grid.bento .product-card[data-id="adam44"],
      .product-grid.bento .product-card[data-id="natnaai"],
      .product-grid.bento .product-card[data-id="seven1"] {
        grid-column: auto !important;
        grid-row: auto !important;
      }

      .product-card { padding: 1.15rem; }
      .product-card h3 { font-size: clamp(1.1rem, 4vw, 1.3rem); }
      .glass-card { padding: 1.15rem; }
      .contact-card { padding: 1.25rem; }

      footer,
      .site-footer {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
        font-size: clamp(0.75rem, 2.2vw, 0.82rem);
      }

      .footer-links {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 600px) {
      .nav-brand-text { font-size: clamp(0.95rem, 3.2vw, 1.05rem); }
      .contact-row span,
      .contact-row a { overflow-wrap: anywhere; word-break: break-word; }
    }

    @media (max-width: 380px) {
      .mode-btn { padding: 0.3rem 0.55rem; font-size: 0.68rem; }
      .nav-brand-text { display: none; }
      .navbar { padding: 0.55rem 0.75rem; }
    }

/* ═══════════════════════════════════════════
   Modern immersive layer (cascade priority)
   ═══════════════════════════════════════════ */

:root {
  --nav-h: clamp(52px, 8vw, 72px);
  --page-pad: 1rem;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-geez: "Geez Able", var(--font-ui);
  --font-family: var(--font-geez);
  --bg: #070b14;
  --bg-elevated: rgba(12, 18, 32, 0.55);
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.45);
  --blue: #38bdf8;
  --text: #f8fafc;
  --text-soft: #e2e8f0;
  --muted: #94a3b8;
  --glass: rgba(15, 23, 42, 0.42);
  --glass-strong: rgba(8, 14, 28, 0.58);
  --glass-border: rgba(148, 163, 184, 0.18);
  --glass-border-cyan: rgba(34, 211, 238, 0.28);
  --glow: 0 0 32px rgba(34, 211, 238, 0.28);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --radius-card: 24px;
  --chat-pad: clamp(1rem, 2.5vw, 1.5rem);
}

html {
  font-family: var(--font-family);
  letter-spacing: 0.01em;
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Latin UI chrome prefers Inter; Geez Able still covers Tigrinya glyphs */
.navbar,
.mode-btn,
.chat-header,
.chat-input-row input,
.btn-send,
.status-sub,
.section-eyebrow,
.section-title,
.nav-brand-text {
  font-family: var(--font-ui), var(--font-geez);
}

/* ── Radial atmosphere (no grid) ── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 48% at 38% 42%, rgba(34, 211, 238, 0.16), transparent 62%),
    radial-gradient(ellipse 40% 36% at 72% 28%, rgba(56, 189, 248, 0.08), transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 78%, rgba(15, 23, 42, 0.9), transparent 70%),
    linear-gradient(180deg, #070b14 0%, #0a1220 45%, #070b14 100%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  display: none;
}

/* Soft radial glow anchored behind the avatar hero */
.hero-visual::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(72vw, 520px);
  height: min(72vw, 520px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(34, 211, 238, 0.22) 0%,
    rgba(56, 189, 248, 0.1) 32%,
    transparent 68%
  );
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.hero-visual.live::before,
.hero-visual.speaking::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.08);
  background: radial-gradient(
    circle,
    rgba(34, 211, 238, 0.32) 0%,
    rgba(56, 189, 248, 0.14) 36%,
    transparent 70%
  );
}

/* ── Navbar ── */
.navbar {
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}

.nav-brand-text {
  letter-spacing: -0.04em;
  font-weight: 700;
}

.mode-toggle {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
}

.mode-btn {
  position: relative;
  z-index: 1;
  letter-spacing: 0.02em;
  transition:
    color 0.35s var(--ease),
    background 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    transform 0.25s var(--ease);
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.35), rgba(56, 189, 248, 0.22));
  color: #fff;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.28);
}

/* ── Home layout: avatar as hero ── */
#home {
  position: relative;
  z-index: 1;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  padding: clamp(0.75rem, 2vw, 1.5rem);
  max-width: min(1280px, 100%);
  margin: 0 auto;
  transition: opacity 0.4s var(--ease);
}

#home.mode-switching {
  pointer-events: none;
}

#home.mode-switching .hero-visual,
#home.mode-switching .chat-sidebar {
  opacity: 0.82;
  transform: translateY(4px);
}

.hero-visual,
.chat-sidebar {
  transition:
    opacity 0.45s var(--ease),
    transform 0.45s var(--ease),
    box-shadow 0.45s var(--ease),
    filter 0.45s var(--ease);
}

.hero-visual {
  border-radius: var(--radius-card);
  overflow: hidden;
}

body.chat-mode-text .hero-visual {
  filter: saturate(0.92);
}

body.chat-mode-text .avatar-stack {
  transform: scale(0.94);
  opacity: 0.78;
}

body.chat-mode-voice .chat-sidebar {
  /* voice-first: chat is secondary transcript */
}

body.chat-mode-text .chat-sidebar {
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(34, 211, 238, 0.22),
    0 0 40px rgba(34, 211, 238, 0.12);
}

.avatar-stack {
  transition: width 0.4s var(--ease), height 0.4s var(--ease), transform 0.45s var(--ease), opacity 0.45s var(--ease);
  width: clamp(190px, 34vw, 260px);
  height: clamp(190px, 34vw, 260px);
}

.hero-visual.live .avatar-stack {
  width: clamp(210px, 36vw, 280px);
  height: clamp(210px, 36vw, 280px);
}

.avatar-halo {
  inset: -14%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 70%);
  opacity: 0.85;
}

.hero-visual.live .avatar-halo,
.hero-visual.speaking .avatar-halo {
  animation: cyanHaloPulse 1.8s ease-in-out infinite;
}

@keyframes cyanHaloPulse {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.14); opacity: 1; }
}

.avatar-inner {
  box-shadow:
    0 0 0 2px rgba(34, 211, 238, 0.4),
    0 0 40px rgba(34, 211, 238, 0.25),
    0 18px 44px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-visual.live .avatar-inner {
  box-shadow:
    0 0 0 3px rgba(34, 211, 238, 0.55),
    0 0 56px rgba(34, 211, 238, 0.42),
    0 0 90px rgba(56, 189, 248, 0.22),
    inset 0 0 28px rgba(34, 211, 238, 0.08);
}

/* Neon cyan pulse while AI audio is active */
.avatar-inner.talking {
  animation: avatarCyanPulse 1.05s ease-in-out infinite;
  box-shadow:
    0 0 0 3px rgba(34, 211, 238, 0.7),
    0 0 36px rgba(34, 211, 238, 0.55),
    0 0 72px rgba(56, 189, 248, 0.35),
    0 16px 40px rgba(0, 0, 0, 0.35);
}

.avatar-inner.talking::before {
  content: "";
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, 0.65);
  box-shadow:
    0 0 24px rgba(34, 211, 238, 0.55),
    0 0 48px rgba(56, 189, 248, 0.35),
    inset 0 0 24px rgba(34, 211, 238, 0.12);
  animation: avatarCyanRing 1.05s ease-in-out infinite;
  pointer-events: none;
  z-index: 4;
}

.avatar-inner.talking .avatar-mouth-ring {
  background: rgba(34, 211, 238, 0.45);
  opacity: 1;
  animation: avatarMouthTalk 0.28s ease-in-out infinite;
}

@keyframes avatarCyanPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.028); filter: brightness(1.06); }
}

@keyframes avatarCyanRing {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.hero-greeting {
  background: linear-gradient(145deg, rgba(8, 14, 28, 0.72), rgba(34, 211, 238, 0.06));
  border: 1px solid var(--glass-border-cyan);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.hero-greeting-body {
  color: var(--text-soft);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.hero-tagline {
  color: var(--muted);
  font-weight: 500;
}

.hero-chip {
  background: rgba(8, 14, 28, 0.65);
  border: 1px solid var(--glass-border);
  color: var(--text-soft);
  font-weight: 600;
}

.hero-cta {
  letter-spacing: 0.01em;
}

.status-label {
  color: var(--cyan);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.hero-visual.speaking .status-label {
  color: var(--cyan);
}

.status-sub {
  color: rgba(148, 163, 184, 0.9);
  margin-top: 0.15rem;
}

/* ── Glassmorphism floating chat card ── */
.chat-sidebar {
  background: var(--glass-strong);
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 40px rgba(34, 211, 238, 0.08);
  overflow: hidden;
}

.chat-header {
  padding: var(--chat-pad);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.chat-messages {
  padding: var(--chat-pad);
  gap: 0.95rem;
}

.msg {
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  font-size: clamp(0.94rem, 2.4vw, 1.02rem);
  line-height: 1.65;
  letter-spacing: 0.01em;
}

.msg.user {
  color: #f8fafc;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.32), rgba(56, 189, 248, 0.2));
  border: 1px solid rgba(34, 211, 238, 0.38);
  text-shadow: none;
}

.msg.model {
  color: #f1f5f9;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  text-shadow: none;
}

.msg.model strong {
  color: #67e8f9;
  font-weight: 700;
}

.chat-input-bar {
  padding: var(--chat-pad);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(0, 0, 0, 0.12);
}

.chat-input-row {
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  box-shadow: none;
}

.chat-input-row input {
  color: var(--text);
  font-size: 0.95rem;
}

.chat-input-row input::placeholder {
  color: rgba(148, 163, 184, 0.85);
}

.btn-send {
  border-radius: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

/* Academy / section glass cards (override inline .glass-card) */
.glass-card {
  background: rgba(8, 14, 28, 0.55) !important;
  backdrop-filter: blur(22px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  border-radius: var(--radius-card) !important;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset !important;
  color: var(--text-soft);
}

.glass-card:hover {
  border-color: rgba(34, 211, 238, 0.4) !important;
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.38),
    0 0 32px rgba(34, 211, 238, 0.12) !important;
}

.glass-card h3,
.glass-card p,
.glass-card .price {
  color: var(--text-soft);
}

.glass-card .price {
  color: var(--cyan) !important;
}

/* ── Desktop centered hero + floating chat ── */
@media (min-width: 769px) {
  #home {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 400px);
    align-items: center;
    justify-content: center;
    gap: clamp(1.25rem, 3vw, 2.25rem);
    max-width: min(1200px, 100%);
    padding: 1.25rem 1.75rem 1.75rem;
    min-height: calc(100dvh - var(--nav-h));
  }

  .hero-visual {
    min-height: calc(100dvh - var(--nav-h) - 2.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-card);
  }

  .chat-sidebar {
    min-height: min(720px, calc(100dvh - var(--nav-h) - 2.5rem));
    max-height: calc(100dvh - var(--nav-h) - 2.5rem);
    align-self: center;
    border-left: none;
    border-top: none;
    border-radius: var(--radius-card);
    margin: 0;
  }

  .orb-zone {
    padding: 1rem 1.5rem 1.25rem;
  }
}

/* ── Mobile: no overflow, stacked glass card ── */
@media (max-width: 768px) {
  #home {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    height: auto;
    min-height: calc(100dvh - var(--nav-h));
    max-height: none;
    overflow: visible;
    padding: var(--page-pad);
  }

  .hero-visual {
    flex: 0 0 auto;
    min-height: 0;
    border-radius: var(--radius-card);
    padding: 0.5rem 0.25rem 0.75rem;
  }

  .hero-visual::before {
    width: min(88vw, 420px);
    height: min(88vw, 420px);
    top: 52%;
  }

  .avatar-stack {
    width: clamp(160px, 42vw, 210px);
    height: clamp(160px, 42vw, 210px);
  }

  .hero-visual.live .avatar-stack {
    width: clamp(172px, 44vw, 220px);
    height: clamp(172px, 44vw, 220px);
  }

  .chat-sidebar {
    flex: 1 1 auto;
    min-height: 280px;
    max-height: none;
    border-radius: var(--radius-card);
    border-top: 1px solid var(--glass-border);
  }

  .hero-greeting {
    transform: none;
    margin: 0 auto 0.35rem;
  }

  .hero-visual.live .hero-greeting,
  .hero-visual.connecting .hero-greeting {
    transform: scale(0.98);
  }

  .status-sub {
    margin-top: 0;
  }
}

@media (max-width: 600px) {
  .hero-chips {
    display: none;
  }

  .hero-tagline {
    font-size: 0.8rem;
  }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .avatar-inner.talking,
  .avatar-inner.talking::before,
  .hero-visual.live .avatar-halo,
  .hero-visual.speaking .avatar-halo {
    animation: none !important;
  }

  #home.mode-switching .hero-visual,
  #home.mode-switching .chat-sidebar,
  body.chat-mode-text .avatar-stack {
    transition: none;
  }
}

/* ═══════════════════════════════════════════
   Class Sync Force Layer (beats older base rules)
   HTML: .hero-visual > … > .avatar-inner | .chat-sidebar
   ═══════════════════════════════════════════ */
body.ariam-ui {
  background: #070b14 !important;
  color: #f8fafc;
}

body.ariam-ui::before {
  content: "" !important;
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
  pointer-events: none !important;
  background:
    radial-gradient(ellipse 60% 50% at 40% 40%, rgba(34, 211, 238, 0.2), transparent 65%),
    radial-gradient(ellipse 45% 40% at 75% 25%, rgba(56, 189, 248, 0.1), transparent 55%),
    linear-gradient(180deg, #070b14 0%, #0b1424 50%, #070b14 100%) !important;
}

body.ariam-ui::after {
  display: none !important;
  content: none !important;
  background: none !important;
}

body.ariam-ui .navbar,
body.ariam-ui #home,
body.ariam-ui .section,
body.ariam-ui .site-footer {
  position: relative;
  z-index: 1;
}

body.ariam-ui .hero-visual {
  overflow: visible !important;
  border-radius: 24px !important;
}

body.ariam-ui .hero-visual::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 50% !important;
  top: 48% !important;
  width: min(78vw, 560px) !important;
  height: min(78vw, 560px) !important;
  transform: translate(-50%, -50%) !important;
  border-radius: 50% !important;
  z-index: 0 !important;
  pointer-events: none !important;
  background: radial-gradient(
    circle,
    rgba(34, 211, 238, 0.35) 0%,
    rgba(56, 189, 248, 0.14) 35%,
    transparent 70%
  ) !important;
  filter: blur(6px);
}

body.ariam-ui .avatar-stack {
  position: relative;
  z-index: 2;
}

body.ariam-ui .avatar-inner {
  box-shadow:
    0 0 0 2px rgba(34, 211, 238, 0.55),
    0 0 48px rgba(34, 211, 238, 0.35),
    0 18px 44px rgba(0, 0, 0, 0.45) !important;
}

body.ariam-ui .avatar-inner.talking {
  box-shadow:
    0 0 0 3px rgba(34, 211, 238, 0.85),
    0 0 40px rgba(34, 211, 238, 0.65),
    0 0 80px rgba(56, 189, 248, 0.4),
    0 16px 40px rgba(0, 0, 0, 0.4) !important;
}

body.ariam-ui .chat-sidebar {
  background: rgba(8, 14, 28, 0.52) !important;
  backdrop-filter: blur(28px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.3) !important;
  border: 1px solid rgba(34, 211, 238, 0.22) !important;
  border-radius: 24px !important;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(34, 211, 238, 0.12) !important;
}

body.ariam-ui .glass-card {
  background: rgba(8, 14, 28, 0.55) !important;
  backdrop-filter: blur(22px) !important;
  -webkit-backdrop-filter: blur(22px) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: 24px !important;
}

@media (min-width: 769px) {
  body.ariam-ui #home {
    display: grid !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 400px) !important;
    align-items: center !important;
    gap: clamp(1.25rem, 3vw, 2.25rem) !important;
    max-width: min(1200px, 100%) !important;
    margin: 0 auto !important;
  }

  body.ariam-ui .chat-sidebar {
    min-height: min(720px, calc(100dvh - var(--nav-h) - 2.5rem)) !important;
    max-height: calc(100dvh - var(--nav-h) - 2.5rem) !important;
  }
}
