/* ==========================================================================
   Glance Portal — Unified ReSeorch.AI × Glance Design System
   Matches reseorch-ai.com & glanceworld.app Palette, Typography & Grid
   ========================================================================== */

@font-face {
  font-family: Plex;
  src: url(/assets/IBMPlexSansKR-Regular.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Plex;
  src: url(/assets/IBMPlexSansKR-Medium.woff2) format("woff2");
  font-weight: 500 700;
  font-display: swap;
}

@font-face {
  font-family: Gowun;
  src: url(/assets/GowunBatang-Bold.woff2) format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Unified Studio & In-Game Palette (reseorch-ai.com + glanceworld.app) */
  --paper: #f5f4ec;
  --surface: #fafaf4;
  --sage: #e8ede2;
  --sage-strong: #dde5d4;
  --ink: #24382e;
  --muted: #68756b;
  --green: #3f6349;
  --green-hover: #2d4f37;
  --line: #d7ddd1;
  --line-strong: #bdcbb8;
  --amber: #a5703f;

  /* Font Families */
  --font-serif: Gowun, Georgia, serif;
  --font-sans: Plex, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Strict 4-Step Font Scale */
  --fs-hero: clamp(1.7rem, 2.3vw, 2.2rem);    /* Step 1: Hero Title */
  --fs-heading: 1.125rem;                     /* Step 2: Section / Brand Title (18px) */
  --fs-body: 0.875rem;                        /* Step 3: Body / Row Title / CTA (14px) */
  --fs-caption: 0.75rem;                      /* Step 4: Caption / Badge / Meta (12px) */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

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

a:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 4px;
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: "liga" 0, "zero" 1;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 24px;
  z-index: 999;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: #ffffff;
  font-size: var(--fs-caption);
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
}

/* Subtle Botanical Dot Grid matching in-game chat canvas */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(36, 56, 46, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ==========================================================================
   1. Strict 1200px Container Alignment
   ========================================================================== */

.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 28px;
  height: 28px;
  display: block;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: var(--fs-heading);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.badge-version {
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--green);
  background: var(--sage);
  border: 1px solid var(--line-strong);
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--muted);
}

.status-dot {
  color: #5b8751;
  font-size: var(--fs-caption);
  line-height: 1;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: var(--fs-caption);
  font-weight: 500;
  color: var(--ink);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.header-link:hover {
  background: var(--sage);
  border-color: #98aa90;
}

/* ==========================================================================
   Hero Section (Left 5 : Right 7, Strict Edge Alignment)
   ========================================================================== */

.hero-section {
  display: grid;
  grid-template-columns: 5fr 7fr;
  align-items: center;
  gap: 36px;
  padding: 44px 0 38px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--sage);
  border: 1px solid var(--line-strong);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--green);
  margin-bottom: 18px;
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.hero-title {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: var(--fs-hero);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.32;
  color: var(--ink);
  word-break: keep-all;
}

.hero-subcopy {
  margin: 0 0 26px;
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--muted);
  word-break: keep-all;
}

.hero-actions {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.cta-button {
  width: 100%;
  height: 54px;
  padding: 0 22px;
  border-radius: 6px;
  background: var(--green);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 6px 16px rgba(63, 99, 73, 0.18);
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.cta-button:hover {
  background: var(--green-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(45, 79, 55, 0.24);
}

.cta-text-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
  gap: 2px;
}

.cta-label {
  font-size: var(--fs-body);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cta-sub {
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: 0.06em;
  opacity: 0.82;
}

.cta-arrow {
  font-size: var(--fs-heading);
  font-weight: 500;
}

.access-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--fs-caption);
  color: var(--muted);
}

/* ==========================================================================
   Right Preview Frame (Matches reseorch-ai.com .hero-visual Window Frame)
   ========================================================================== */

.hero-preview {
  min-width: 0;
  width: 100%;
}

.preview-window {
  width: 100%;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  overflow: hidden;
  box-shadow: 0 22px 55px rgba(54, 84, 59, 0.11);
}

.window-bar {
  height: 38px;
  padding: 0 16px;
  background: #f8f9f2;
  border-bottom: 1px solid #d3ddcc;
  display: flex;
  align-items: center;
  gap: 12px;
}

.window-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b4c3ad;
  display: inline-block;
}

.window-title {
  font-size: var(--fs-caption);
  color: #74816d;
}

.window-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #97d3eb;
  overflow: hidden;
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  display: block;
}

/* Strictly 2 Clean Agent Status Overlay Badges Inside Preview */
.preview-overlay-pills {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.agent-overlay-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 7px;
  background: rgba(250, 251, 245, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 24px rgba(36, 56, 46, 0.14);
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--ink);
}

/* ==========================================================================
   Bottom 3-Column Bento Grid (gap: 24px, padding: 28px, Compact 3-Row Lists)
   ========================================================================== */

.bento-section {
  padding: 8px 0 44px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.bento-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.card-head {
  margin-bottom: 16px;
}

.card-eyebrow {
  display: block;
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #7b8d6f;
  margin-bottom: 6px;
}

.card-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-heading);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.list-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.row-date {
  font-size: var(--fs-caption);
  color: var(--muted);
  white-space: nowrap;
}

.row-title {
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--fs-caption);
  font-weight: 600;
  white-space: nowrap;
}

.badge-neutral {
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
}

.badge-accent {
  color: var(--green);
  background: var(--sage);
  border: 1px solid var(--line-strong);
}

.badge-warn {
  color: var(--amber);
  background: #f6efe4;
  border: 1px solid #dfd0ba;
}

/* ==========================================================================
   Footer (Matches reseorch-ai.com Identity + 12px Single-Line Business Info)
   ========================================================================== */

.site-footer {
  margin-top: auto;
  padding: 24px 0 28px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  display: block;
}

.footer-wordmark {
  font-size: var(--fs-body);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.footer-wordmark .dot {
  color: var(--amber);
}

.footer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--fs-caption);
  color: var(--muted);
}

.footer-meta a {
  color: var(--ink);
}

.footer-meta a:hover {
  color: var(--green);
}

.footer-meta .sep {
  color: var(--line-strong);
}

/* ==========================================================================
   Responsive Design (Tablet & 390px Mobile)
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 34px 0 30px;
  }

  .hero-actions {
    max-width: 100%;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .site-header {
    height: auto;
    padding: 14px 0;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .system-status,
  .header-link {
    white-space: nowrap;
    padding: 5px 9px;
  }

  .hero-section {
    padding: 24px 0;
    gap: 24px;
  }

  .preview-overlay-pills {
    left: 10px;
    right: 10px;
    bottom: 10px;
    gap: 6px;
  }

  .bento-card {
    padding: 24px 20px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
