/* YYamin Hub Page - app-aligned dark/light theme */

:root {
  --bg: #0F1216;
  --surface: #111418;
  --surface-2: #141920;
  --card: #171B21;
  --card-hover: #1C222B;
  --text: #F5F7F2;
  --text-secondary: #B8C0BA;
  --text-muted: #7F8A84;
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.18);
  --primary: #64B5F6;
  --primary-strong: #2196F3;
  --primary-soft: rgba(33, 150, 243, 0.16);
  --accent: #8BD17C;
  --accent-soft: rgba(139, 209, 124, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 180ms ease;
  /* Pre-computed color-mix fallbacks for Samsung browser compatibility */
  --surface-header: rgba(15, 18, 22, 0.82);
  --card-alpha: rgba(23, 27, 33, 0.92);
  --card-hover-alpha: rgba(28, 34, 43, 0.92);
  --surface-2-alpha: rgba(20, 25, 32, 0.80);
  --central-bg: rgba(23, 27, 33, 0.85);
  --card-soft: rgba(23, 27, 33, 0.94);
}

[data-theme="light"] {
  --bg: #F7F7F2;
  --surface: #FCFCF8;
  --surface-2: #F0F2EC;
  --card: #FFFFFF;
  --card-hover: #FEFFFB;
  --text: #1B1F24;
  --text-secondary: #4F5A55;
  --text-muted: #748077;
  --border: #D8DDD2;
  --border-strong: #C8D0C3;
  --primary: #1565C0;
  --primary-strong: #0D47A1;
  --primary-soft: rgba(21, 101, 192, 0.11);
  --accent: #1F7A4C;
  --accent-soft: rgba(31, 122, 76, 0.1);
  --shadow: 0 18px 44px rgba(33, 41, 31, 0.1);
  --surface-header: rgba(247, 247, 242, 0.82);
  --card-alpha: rgba(255, 255, 255, 0.92);
  --card-hover-alpha: rgba(254, 255, 251, 0.92);
  --surface-2-alpha: rgba(240, 242, 236, 0.80);
  --central-bg: rgba(255, 255, 255, 0.85);
  --card-soft: rgba(255, 255, 255, 0.94);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(33, 150, 243, 0.14), transparent 34rem),
    linear-gradient(180deg, var(--surface) 0%, var(--bg) 42rem);
  color: var(--text);
  line-height: 1.5;
  transition: background var(--transition), color var(--transition);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 16px clamp(20px, 5vw, 64px);
  background: var(--surface-header);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.96rem;
  font-weight: 800;
}

.logo,
.text-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  border: 1px solid var(--border-strong);
  color: var(--primary);
  font-weight: 900;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 650;
  padding: 8px 10px;
  border-radius: var(--radius);
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.theme-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.theme-toggle svg {
  position: absolute;
  transition: opacity var(--transition), transform var(--transition);
}

[data-theme="dark"] .sun-icon,
:root:not([data-theme]) .sun-icon {
  opacity: 1;
  transform: rotate(0deg);
}

[data-theme="dark"] .moon-icon,
:root:not([data-theme]) .moon-icon {
  opacity: 0;
  transform: rotate(90deg);
}

[data-theme="light"] .sun-icon {
  opacity: 0;
  transform: rotate(-90deg);
}

[data-theme="light"] .moon-icon {
  opacity: 1;
  transform: rotate(0deg);
}

.main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 40px;
}

.hero {
  min-height: 320px;
}

.hero-copy {
  padding: clamp(32px, 6vw, 64px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-alpha);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.tagline {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

/* ===== Graph Section ===== */

.graph-section {
  padding-top: 48px;
}

.graph-container {
  position: relative;
  width: 100%;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.graph-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.graph-line {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}

.graph-dot {
  fill: var(--primary);
  opacity: 0.6;
}

.graph-node {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-soft);
  box-shadow: var(--shadow);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.graph-node.central {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  padding: 24px 36px;
  border-color: var(--primary-soft);
  background: var(--central-bg);
}

.graph-node.central .node-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  border: 1px solid var(--border-strong);
  color: var(--primary);
  font-weight: 900;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.graph-node.central .node-name {
  font-size: 1.2rem;
  font-weight: 800;
}

.graph-node.central .node-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.graph-node.app {
  bottom: 0;
  width: 220px;
  padding: 20px;
}

.graph-node.app:first-of-type {
  left: 5%;
}

.graph-node.app:last-of-type {
  right: 5%;
}

.graph-node.app:hover {
  transform: translateY(-3px);
  border-color: var(--primary-soft);
  background: var(--card-hover);
}

.graph-node.app.coming {
  opacity: 0.7;
  cursor: default;
}

.graph-node.app.coming:hover {
  transform: none;
  border-color: var(--border);
  background: var(--card-soft);
}

.node-icon {
  margin-bottom: 10px;
}

.node-icon img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.node-icon.plus {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-2);
}

.node-name {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.node-status {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.node-status.available {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(139, 209, 124, 0.3);
}

.node-status.coming-soon {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(33, 150, 243, 0.3);
}

.node-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-bottom: 10px;
}

.platform-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.node-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.node-cta {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 4px;
}

.node-tagline.strip {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 6px;
}

/* ===== Sections ===== */

.section {
  padding-top: 72px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  margin-bottom: 0;
  max-width: 720px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: 0;
}

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

.principles article {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-alpha);
  box-shadow: var(--shadow);
}

.principles h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.principles p {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 72px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.footer a {
  color: var(--text-secondary);
  font-weight: 750;
}

.footer-locales {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-locales-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.footer-locales-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.footer-locales-links a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition);
}

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

/* ===== Responsive ===== */

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
  }

  .site-nav {
    display: none;
  }

  .main {
    width: min(100% - 28px, 1120px);
    padding-top: 36px;
  }

  .graph-container {
    min-height: 600px;
    flex-direction: column;
    gap: 16px;
  }

  .graph-svg {
    display: none;
  }

  .graph-node {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: 320px;
  }

  .graph-node.central {
    top: auto;
    left: auto;
    transform: none;
  }

  .graph-node.app:first-of-type,
  .graph-node.app:last-of-type {
    left: auto;
    right: auto;
  }

  .principle-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .site-header {
    padding: 12px 14px;
  }

  .hero-copy,
  .principles article {
    padding: 20px;
  }

  .graph-node {
    padding: 16px;
  }

  .graph-node.central {
    padding: 20px 24px;
  }

  .footer {
    flex-direction: column;
  }
}