/* ==========================================================================
   AnadosKR Portal - Modern Dark Fantasy Design System
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=Cinzel:wght@700;900&display=swap');

:root {
  /* Color Palette */
  --bg-main: #0a0d14;
  --bg-surface: rgba(18, 24, 38, 0.7);
  --bg-surface-hover: rgba(26, 35, 56, 0.85);
  --bg-card: rgba(15, 21, 35, 0.75);
  --bg-glass: rgba(255, 255, 255, 0.03);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);
  --border-active: rgba(255, 255, 255, 0.25);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-highlight: #e2e8f0;

  /* Accent Colors */
  --accent-pc: #38bdf8;         /* Cyan/Blue for PC */
  --accent-pc-glow: rgba(56, 189, 248, 0.25);
  --accent-mobile: #4ade80;     /* Green/Emerald for Android */
  --accent-mobile-glow: rgba(74, 222, 128, 0.25);
  --accent-viewer: #f43f5e;     /* Rose/Crimson for Viewer */
  --accent-viewer-glow: rgba(244, 63, 94, 0.25);

  /* Typography */
  --font-base: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  --font-display: 'Outfit', 'Pretendard', sans-serif;
  --font-title: 'Cinzel', serif;

  /* Shadows & Blurs */
  --blur-glass: 16px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px var(--border-subtle);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-base);
  background-color: var(--bg-main);
  color: var(--text-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background Ambient Glows & Effects */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
  animation: pulse-glow 12s infinite alternate ease-in-out;
}

.glow-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #4f46e5, #06b6d4);
  top: -100px;
  left: 15%;
}

.glow-orb-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #ec4899, #8b5cf6);
  bottom: 10%;
  right: 10%;
  animation-delay: -6s;
}

.glow-orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #10b981, #3b82f6);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.12;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

@keyframes pulse-glow {
  0% { transform: scale(1) translateY(0); opacity: 0.18; }
  50% { transform: scale(1.15) translateY(20px); opacity: 0.28; }
  100% { transform: scale(0.95) translateY(-20px); opacity: 0.18; }
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Subpage Top Bar (Back Button) */
.subpage-top-bar {
  padding: 24px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-back-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-highlight);
  font-size: 0.925rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}

.btn-back-main:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-active);
  color: #ffffff;
  transform: translateX(-4px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.subpage-top-logo {
  height: 34px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}

.subpage-top-logo:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Hero Section */
.hero-section {
  padding: 48px 0 28px;
  text-align: center;
  position: relative;
}

.hero-logo-wrapper {
  margin: 0 auto 16px;
  max-width: 520px;
  position: relative;
}

.hero-main-logo {
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 45px rgba(99, 102, 241, 0.3));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-main-logo:hover {
  transform: scale(1.03);
}

.hero-title-group {
  margin-bottom: 12px;
}

.hero-subtitle-en {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 4px;
}

.hero-title-ko {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-description {
  max-width: 600px;
  margin: 0 auto 28px;
  color: var(--text-secondary);
  font-size: 0.975rem;
  line-height: 1.6;
}

/* ==========================================================================
   Desktop Cards Layout (3-Columns)
   ========================================================================== */

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 50px;
}

.portal-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 30px 24px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(var(--blur-glass));
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.portal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent, #6366f1);
  opacity: 0.7;
  transition: opacity 0.3s ease, height 0.3s ease;
}

.portal-card:hover {
  transform: translateY(-8px);
  background: var(--bg-surface-hover);
  border-color: var(--border-active);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 30px var(--card-glow);
}

.portal-card:hover::before {
  opacity: 1;
  height: 6px;
}

.card-pc {
  --card-accent: var(--accent-pc);
  --card-glow: var(--accent-pc-glow);
}

.card-mobile {
  --card-accent: var(--accent-mobile);
  --card-glow: var(--accent-mobile-glow);
}

.card-viewer {
  --card-accent: var(--accent-viewer);
  --card-glow: var(--accent-viewer-glow);
}

/* Card Header (Desktop) */
.card-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--card-accent);
  box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.02);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

.portal-card:hover .card-icon-box {
  transform: scale(1.08) rotate(-2deg);
  box-shadow: 0 0 20px var(--card-glow);
  background: rgba(255, 255, 255, 0.08);
}

.card-mobile-title-wrap {
  display: none; /* Only for Mobile */
}

.card-desktop-title-wrap {
  display: block;
}

.card-badge-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.badge-version {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-highlight);
  font-family: var(--font-display);
}

.badge-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-status.stable {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-pc);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-status.progress {
  background: rgba(74, 222, 128, 0.15);
  color: var(--accent-mobile);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-status.web {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-viewer);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Card Content (Desktop) */
.card-content {
  flex-grow: 1;
  margin-bottom: 22px;
}

.card-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.card-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--card-accent);
  margin-bottom: 12px;
  font-family: var(--font-display);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 16px;
}

.card-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.825rem;
  color: var(--text-highlight);
}

.feature-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--card-accent);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-item {
  font-size: 0.725rem;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  color: var(--text-muted);
}

/* Card Buttons (Desktop) */
.card-actions {
  width: 100%;
}

.btn-card-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}

.btn-card-main.pc {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

.btn-card-main.pc:hover,
.portal-card.card-pc:hover .btn-card-main.pc {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.55);
}

.btn-card-main.mobile {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.35);
}

.btn-card-main.mobile:hover,
.portal-card.card-mobile:hover .btn-card-main.mobile {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.55);
}

.btn-card-main.viewer {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(225, 29, 72, 0.35);
}

.btn-card-main.viewer:hover,
.portal-card.card-viewer:hover .btn-card-main.viewer {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.55);
}

/* ==========================================================================
   Subpages Specific Styles (pc.html, mobile.html, viewer.html)
   ========================================================================== */

.subpage-hero {
  padding: 30px 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 36px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text-primary);
}

.subpage-title-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.subpage-icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.subpage-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.subpage-badge {
  display: inline-block;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  margin-top: 6px;
}

.guide-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 36px;
  margin-bottom: 60px;
}

.guide-main {
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px;
  backdrop-filter: blur(12px);
  min-width: 0;
}

.guide-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.step-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
  counter-reset: step-counter;
}

.step-item {
  position: relative;
  padding-left: 44px;
}

.step-item::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.step-heading {
  font-weight: 700;
  color: var(--text-highlight);
  margin-bottom: 4px;
}

.step-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-desc code {
  overflow-wrap: anywhere;
}

.code-block {
  background: #06090e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: 0.85rem;
  color: #38bdf8;
  margin-top: 8px;
  overflow-x: auto;
}

.guide-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.download-cta-box {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.download-cta-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.download-cta-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.download-note {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.btn-big-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.btn-big-download[aria-disabled="true"] {
  cursor: not-allowed;
  filter: saturate(0.35);
  opacity: 0.58;
  pointer-events: none;
}

.release-hash {
  display: inline-block;
  max-width: 100%;
  margin-top: 4px;
  color: var(--text-secondary);
  font-family: 'Cascadia Code', Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  user-select: all;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 12px;
}

.specs-table td {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.specs-table td:first-child {
  color: var(--text-muted);
  width: 40%;
}

.specs-table td:last-child {
  color: var(--text-highlight);
  font-weight: 600;
}

/* ==========================================================================
   Responsive Breakpoints - Exact Sketch Matching (Mobile 1-Col Stack)
   ========================================================================== */

/* Tablet (<= 1024px) */
@media (max-width: 1024px) {
  .portal-grid {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto 40px;
    gap: 20px;
  }

  .guide-layout {
    grid-template-columns: 1fr;
  }

  .guide-sidebar {
    order: -1;
  }
}

/* Mobile Devices (<= 768px - Exact sketch matching for notitle.png) */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

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

  .hero-logo-wrapper {
    max-width: 260px;
    margin-bottom: 10px;
  }

  .hero-main-logo {
    max-height: 95px;
  }

  .hero-subtitle-en {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
  }

  .hero-title-ko {
    font-size: 1.45rem;
  }

  .hero-description {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 auto 18px;
    padding: 0 16px;
    word-break: keep-all;
  }

  /* Compact 1-Column Stack (Matching notitle.png right side) */
  .portal-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 30px;
    max-width: 100%;
  }

  .portal-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 18px;
    gap: 12px;
  }

  .portal-card::before {
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    height: 100%;
  }

  .portal-card:hover::before {
    width: 6px;
    height: 100%;
  }

  .card-top-content {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-grow: 1;
  }

  .card-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    width: 100%;
  }

  .card-icon-box {
    width: 52px;
    height: 52px;
    font-size: 1.65rem;
    border-radius: 14px;
    flex-shrink: 0;
  }

  .card-mobile-title-wrap {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
  }

  .card-mobile-title-wrap .card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0px;
  }

  .card-mobile-title-wrap .card-subtitle {
    font-size: 0.75rem;
    margin-bottom: 0;
  }

  .card-badge-group {
    display: none; /* Hide heavy badges in compact mobile row */
  }

  .card-content {
    display: none; /* Hide verbose desktop text in mobile view */
  }

  .card-actions {
    width: auto;
    flex-shrink: 0;
  }

  .portal-card .btn-card-main {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .portal-card .btn-card-main span {
    display: none;
  }

  .portal-card .btn-card-main svg {
    width: 18px;
    height: 18px;
  }

  /* Subpage mobile styles */
  .subpage-hero {
    padding: 20px 0 16px;
    margin-bottom: 24px;
  }

  .subpage-title-wrap {
    gap: 12px;
  }

  .subpage-icon-badge {
    width: 46px;
    height: 46px;
    font-size: 1.4rem;
    border-radius: 12px;
  }

  .subpage-title {
    font-size: 1.35rem;
  }

  .guide-card {
    padding: 20px 16px;
  }
}
