/* =========================================================================
   Granpai 3D Globe — Space Dark design system
   ========================================================================= */

:root {
  /* Design tokens */
  --signal:      #00E5FF;
  --signal-2:    #7C3AED;
  --ink:         #EAF2FF;
  --ink-soft:    #93A5C4;
  --paper:       #05070D;
  --paper-dim:   #0B0F1A;
  --line:        rgba(234, 242, 255, 0.10);
  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
  --radius:      16px;
  --shadow-md:   0 20px 60px -20px rgba(0, 229, 255, 0.15);

  /* Section background system (overridden per-section by _bg control) */
  --section-bg:        transparent;
  --section-text:      var(--ink);
  --section-btn-bg:    var(--signal);
  --section-btn-text:  var(--paper);
}

/* =========================================================================
   Reset & base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0.3em 0 0.4em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* =========================================================================
   Layout
   ========================================================================= */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
.section {
  position: relative;
  padding: 96px 0;
  background: var(--section-bg);
  color: var(--section-text);
  overflow: hidden;
}
.section[data-has-bg="1"] p,
.section[data-has-bg="1"] .lead,
.section[data-has-bg="1"] .eyebrow { color: var(--section-text); opacity: 0.85; }
.section--dim { background: var(--paper-dim); }
.section--dark { background: #000000; }
.section--tight { padding: 72px 0; }
.section--reversed .split-col-grid { direction: rtl; }
.section--reversed .split-col-grid > * { direction: ltr; }
.section--mobile-reversed .split-col-grid { }

/* Background-image sections */
.section[data-has-bg-image="1"] {
  background-image: var(--section-bg-image);
  background-size: cover;
  background-position: center;
}
.section[data-has-bg-image="1"]::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--section-overlay-color, #000);
  opacity: var(--section-overlay-opacity, 0);
  pointer-events: none;
}

/* =========================================================================
   Typography helpers
   ========================================================================= */
.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 14px;
}
.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 640px;
}
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

/* =========================================================================
   Grids
   ========================================================================= */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.split-col-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.split-col-text {}
.split-col-media {}
@media (max-width: 900px) {
  .split-col-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   Head row (section title blocks)
   ========================================================================= */
.head-row {
  max-width: 700px;
  margin: 0 auto 56px;
  text-align: center;
}
.head-row .lead { margin: 0 auto; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.96rem;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--section-btn-bg, var(--signal));
  color: var(--section-btn-text, var(--paper));
  box-shadow: 0 8px 30px -8px rgba(0, 229, 255, 0.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -8px rgba(0, 229, 255, 0.65); }
.btn-secondary {
  background: transparent;
  color: var(--section-text, var(--ink));
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--signal); color: var(--signal); transform: translateY(-2px); }

/* =========================================================================
   Chips
   ========================================================================= */
.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip--signal { background: rgba(0, 229, 255, 0.12); border-color: rgba(0, 229, 255, 0.35); color: var(--signal); }
.chip--violet { background: rgba(124, 58, 237, 0.15); border-color: rgba(124, 58, 237, 0.4); color: #B79CF7; }
.chip--outline { background: transparent; }

/* =========================================================================
   Cards
   ========================================================================= */
.card {
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(0, 229, 255, 0.3); }

/* Decorative bracket / corner accents */
.bracketed { position: relative; }
.corner { position: absolute; width: 18px; height: 18px; border-color: var(--signal); }
.corner-tl { top: 0; left: 0; border-top: 2px solid; border-left: 2px solid; }
.corner-tr { top: 0; right: 0; border-top: 2px solid; border-right: 2px solid; }
.corner-bl { bottom: 0; left: 0; border-bottom: 2px solid; border-left: 2px solid; }
.corner-br { bottom: 0; right: 0; border-bottom: 2px solid; border-right: 2px solid; }

/* =========================================================================
   Rich text / prose patterns (available, used where content is HTML)
   ========================================================================= */
.prose { color: var(--ink-soft); }
.prose a { color: var(--signal); text-decoration: underline; }
.quote-block { border-left: 3px solid var(--signal); padding-left: 20px; font-style: italic; }
.callout { background: rgba(0, 229, 255, 0.08); border: 1px solid rgba(0, 229, 255, 0.25); border-radius: var(--radius); padding: 20px 24px; }
.check-list li { position: relative; padding-left: 28px; margin-bottom: 10px; color: var(--ink-soft); }
.check-list li::before {
  content: "\2713";
  position: absolute; left: 0; top: 0;
  color: var(--signal);
  font-weight: 700;
}
.cta-banner { text-align: center; max-width: 720px; margin: 0 auto; }
.cta-banner .btn-row { justify-content: center; }

/* =========================================================================
   Page-hero / steps / faq patterns (vocabulary kept available)
   ========================================================================= */
.page-hero { padding: 64px 0 32px; text-align: center; }
.steps { display: grid; gap: 20px; }
.step { display: flex; gap: 16px; }
.step-num {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0, 229, 255, 0.12); color: var(--signal);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700;
}

/* =========================================================================
   Header
   ========================================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 7, 13, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
}
.site-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; }
.site-logo__img { width: 34px; height: 34px; border-radius: 8px; }
.site-logo__text { font-size: 1.05rem; }
.site-nav__list { display: flex; gap: 28px; }
.site-nav__list a { font-size: 0.94rem; color: var(--ink-soft); transition: color 0.15s ease; }
.site-nav__list a:hover { color: var(--signal); }
.site-header__cta { padding: 10px 20px; font-size: 0.9rem; }
.site-nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.site-nav__toggle span { width: 22px; height: 2px; background: var(--ink); display: block; }

@media (max-width: 820px) {
  .site-nav__toggle { display: flex; }
  .site-nav__list {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper-dim);
    border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .site-nav__list.is-open { max-height: 400px; }
  .site-nav__list li { border-top: 1px solid var(--line); }
  .site-nav__list a { display: block; padding: 16px 24px; }
  .site-header__cta { padding: 9px 16px; font-size: 0.82rem; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero-section {
  padding-top: 88px;
  background:
    radial-gradient(ellipse 60% 50% at 80% 0%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 10%, rgba(0, 229, 255, 0.12), transparent 60%),
    var(--paper);
}
.hero-starfield {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent),
    radial-gradient(1px 1px at 30% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 60% 15%, #fff, transparent),
    radial-gradient(1px 1px at 80% 45%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 90% 80%, #fff, transparent),
    radial-gradient(1px 1px at 45% 90%, #fff, transparent),
    radial-gradient(1px 1px at 20% 50%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 70% 60%, #fff, transparent);
  opacity: 0.5;
}
.hero-grid { position: relative; z-index: 1; }
.hero-h1 { margin-top: 6px; }
.hero-lead { margin-top: 10px; }
.hero-btn-row { margin: 30px 0 8px; }
.hero-stats { display: flex; gap: 32px; margin-top: 28px; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; }
.hero-stat strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--signal); }
.hero-stat span { font-size: 0.82rem; color: var(--ink-soft); }

.hero-visual { position: relative; min-height: 420px; display: flex; align-items: center; justify-content: center; }
.hero-orbit {
  position: absolute; border: 1px dashed rgba(0, 229, 255, 0.18); border-radius: 50%;
  animation: spin 34s linear infinite;
  pointer-events: none;
}
.hero-orbit--1 { width: 360px; height: 360px; }
.hero-orbit--2 { width: 460px; height: 460px; border-color: rgba(124, 58, 237, 0.16); animation-duration: 48s; animation-direction: reverse; }

.hero-shortcode-slot {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
}
.hero-shortcode-slot > * { width: 100%; height: 100%; }
.hero-shortcode-placeholder {
  border: 1px dashed rgba(0, 229, 255, 0.35);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(0,229,255,0.06), rgba(124,58,237,0.08));
  padding: 32px 28px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  box-sizing: border-box;
}
.hero-shortcode-placeholder__icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(0, 229, 255, 0.12); color: var(--signal);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.hero-shortcode-placeholder__icon svg { width: 26px; height: 26px; }
.hero-shortcode-placeholder__title { font-family: var(--font-display); color: var(--ink); font-weight: 600; margin: 0; }
.hero-shortcode-placeholder__hint { font-size: 0.85rem; margin: 0; max-width: 320px; }
.hero-shortcode-placeholder__hint code { color: var(--signal); font-family: var(--font-mono); font-size: 0.8rem; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .hero-visual { min-height: 300px; }
  .hero-orbit--1 { width: 260px; height: 260px; }
  .hero-orbit--2 { width: 340px; height: 340px; }
}

/* =========================================================================
   Demo section
   ========================================================================= */
.demo-grid { align-items: start; }
.demo-card__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000 center/cover no-repeat;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.demo-card__embed, .demo-card__embed iframe { width: 100%; height: 100%; border: 0; }
.demo-card__placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--ink-soft);
  background: linear-gradient(160deg, rgba(0,229,255,0.08), rgba(124,58,237,0.10));
  width: 100%; height: 100%;
  justify-content: center;
}
.demo-card__play {
  width: 62px; height: 62px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--signal);
}
.demo-card__play svg { width: 24px; height: 24px; }
.demo-card__placeholder-text { font-size: 0.85rem; font-family: var(--font-mono); }
.demo-card__tag { position: absolute; top: 14px; left: 14px; }
.demo-card__caption { margin-top: 14px; font-size: 0.92rem; }

/* =========================================================================
   Features
   ========================================================================= */
.feature-card { position: relative; }
.feature-card__tag { position: absolute; top: 20px; right: 20px; }
.feature-card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(0, 229, 255, 0.10); color: var(--signal);
  margin-bottom: 18px;
}
.feature-card__icon svg { width: 22px; height: 22px; }
.feature-card h3 { margin-top: 0; }
.feature-card p { margin-bottom: 0; font-size: 0.95rem; }

/* =========================================================================
   Comparison table
   ========================================================================= */
.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-dim);
}
.comparison-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.comparison-table th, .comparison-table td {
  padding: 16px 22px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
}
.comparison-table thead th {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.comparison-table__feature-head, .comparison-table th[scope="row"] { text-align: left; color: var(--ink); font-weight: 500; }
.comparison-table__pro-head { color: var(--signal); }
.comparison-table__pro-col { background: rgba(0, 229, 255, 0.05); }
.comparison-table tbody tr:last-child th, .comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-cell--yes { color: var(--signal); font-weight: 700; }
.comparison-cell--no { color: rgba(147, 165, 196, 0.4); }
.comparison-cell--text { font-size: 0.85rem; color: var(--ink-soft); }

/* =========================================================================
   Pricing
   ========================================================================= */
.pricing-grid { align-items: stretch; max-width: 900px; margin: 0 auto; }
.pricing-card {
  position: relative;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  display: flex; flex-direction: column;
}
.pricing-card--featured {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.08), var(--paper-dim) 40%);
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: var(--shadow-md);
}
.pricing-card__badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--signal); color: var(--paper);
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700;
  padding: 5px 14px; border-radius: 999px;
}
.pricing-card__tagline { font-size: 0.92rem; margin-top: -6px; }
.pricing-card__price { display: flex; align-items: baseline; gap: 6px; margin: 12px 0 2px; }
.pricing-card__amount { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; }
.pricing-card__period { color: var(--ink-soft); }
.pricing-card__note { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 20px; }
.pricing-card__features { margin: 8px 0 28px; flex: 1; }
.pricing-card__btn { width: 100%; }
.pricing-footnote { text-align: center; font-size: 0.85rem; margin-top: 28px; }

@media (max-width: 700px) { .pricing-grid { grid-template-columns: 1fr; } }

/* =========================================================================
   FAQ
   ========================================================================= */
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}
.faq-item__q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  background: none; border: 0; cursor: pointer;
  padding: 18px 22px;
  font-family: var(--font-display); font-size: 1rem; color: var(--ink);
  text-align: left;
}
.faq-item__icon { color: var(--signal); font-size: 1.2rem; transition: transform 0.2s ease; }
.faq-item__q[aria-expanded="true"] .faq-item__icon { transform: rotate(45deg); }
.faq-item__a { padding: 0 22px 20px; }
.faq-item__a p { margin: 0; }

/* =========================================================================
   Final CTA
   ========================================================================= */
.final-cta-section { text-align: center; }
.final-cta-section .eyebrow { color: inherit; opacity: 0.8; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer { background: #000000; border-top: 1px solid var(--line); padding-top: 64px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-tag { font-size: 0.9rem; margin-top: 14px; max-width: 260px; }
.footer-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: 16px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 0.92rem; color: var(--ink-soft); }
.footer-col ul li a:hover { color: var(--signal); }
.footer-socials { display: flex; gap: 12px; margin-top: 16px; }
.footer-socials a {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
}
.footer-socials a:hover { color: var(--signal); border-color: var(--signal); }
.footer-socials svg { width: 16px; height: 16px; }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 22px 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 0.82rem; color: var(--ink-soft);
}
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   Global-section edit-mode badge (GranpaiEdit)
   ========================================================================= */
.ge-global-badge {
  background: #103b2e; color: #6cf2b9;
  font-family: var(--font-mono); font-size: 0.75rem;
  padding: 6px 14px; text-align: center;
  border-bottom: 1px solid rgba(108, 242, 185, 0.3);
}
