:root {
  --bg-color: #080909;
  --hero-bg: linear-gradient(180deg, #18201f 0%, #080909 100%);
  --accent-rgb: 145 170 166;
  --accent-color: rgb(var(--accent-rgb));
  --text-primary: rgba(255, 255, 255, 0.9);
  --text-secondary: rgba(255, 255, 255, 0.58);
  --card-bg: #111313;
  --pill-bg: rgba(255, 255, 255, 0.1);
  --font-main: -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
}

body.theme-home {
  --accent-rgb: 145 170 166;
}

body.theme-app {
  --accent-rgb: 139 161 184;
}

body.theme-support {
  --accent-rgb: 134 168 154;
}

body.theme-journal {
  --accent-rgb: 160 145 170;
}

body.theme-trademark {
  --accent-rgb: 174 160 132;
}

body.theme-privacy {
  --accent-rgb: 142 142 147; /* grey */
}

body.theme-terms {
  --accent-rgb: 145 170 166;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  font-family: var(--font-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* Prevent horizontal scroll from any overflow */
}

/* Nav */
nav.pill-nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  background: rgba(16, 18, 18, 0.62);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 6px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

nav.pill-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 18px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: none;
}

nav.pill-nav a.active, nav.pill-nav a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

/* Hero */
.hero {
  min-height: 720px;
  width: 100%;
  background: var(--hero-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 10%;
  position: relative;
}

.hero-content {
  max-width: 560px;
}

.hero-label {
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 14px;
  opacity: 0.65;
}

.hero h1 {
  font-size: 3.25rem;
  font-weight: 650;
  line-height: 1.08;
  margin-bottom: 18px;
  letter-spacing: 0;
}

.hero p {
  font-size: 1.06rem;
  color: var(--text-secondary);
  margin-bottom: 26px;
}

.hero-logo {
  width: 108px;
  margin-bottom: 18px;
  filter: drop-shadow(0 30px 25px rgba(0, 0, 0, 0.25));
}

/* Main Content */
main {
  padding: 96px 10%;
  background: #080909;
  max-width: 960px;
  margin: 0 auto;
}

main section {
  margin-bottom: 72px;
}

main section h2 {
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 18px;
}

main section p {
  margin-bottom: 15px;
  max-width: 760px;
  color: var(--text-secondary);
}

main section ul {
  margin-bottom: 15px;
  padding-left: 20px;
  max-width: 760px;
}

main section li {
  margin-bottom: 10px;
  color: var(--text-secondary);
}

body.theme-terms main {
  max-width: 820px;
  padding-top: 108px;
  padding-bottom: 108px;
}

body.theme-terms main section {
  margin-bottom: 78px;
}

body.theme-terms main section p {
  font-size: 1rem;
  line-height: 1.72;
}

h2 {
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Code Blocks */
pre {
  background-color: rgba(255, 255, 255, 0.028);
  padding: 22px 24px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  margin: 18px 0;
  max-width: 720px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  white-space: pre-wrap;
  word-break: break-word;
}

code {
  color: #d6e2df;
}

main section p a,
.hero p a,
.subtext a {
  color: var(--accent-color);
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-rgb), 0.45);
  text-underline-offset: 3px;
}

main section p a:hover,
.hero p a:hover,
.subtext a:hover {
  color: var(--text-primary);
  text-decoration-color: rgba(255, 255, 255, 0.7);
}



/* Tables */
.table {
  width: 100%;
  max-width: 960px;
  border-collapse: collapse;
  margin-top: 15px;
  border: none;
}

.table th,
.table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border: none;
}

.table thead th {
  border-top: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.04);
}

.table tbody td {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Links & Buttons */
.btn-primary {
  display: inline-block;
  color: var(--text-primary);
  text-decoration: none;
  padding: 7px 0;
  font-weight: 500;
  font-size: 0.9rem;
  transition: none;
  border-bottom: 1px solid var(--text-secondary);
}

.btn-primary:hover {
  border-bottom: 1px solid var(--text-primary);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 12px;
  font-weight: 500;
  font-size: 0.85rem;
  transition: none;
  border-bottom: 1px solid transparent;
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-bottom: 1px solid var(--text-secondary);
}

.card-actions {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.link-list li {
  list-style: none;
  margin-bottom: 15px;
  max-width: 760px;
}

.link-list a {
  display: flex;
  align-items: center;
  background-color: transparent;
  padding: 8px 0;
  border-radius: 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: none;
}

.link-list a:hover {
  background-color: transparent;
  color: var(--text-primary);
}

/* Inline links inside card copy */
.inline-link {
  color: var(--accent-color);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 3px;
}

.inline-link:hover {
  text-decoration-color: rgba(255, 255, 255, 0.7);
}

footer {
  padding: 44px 10%;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Utility Classes */
.subtext {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 10px;
}

.hero .subtext {
  margin-top: 24px;
  max-width: 420px;
  line-height: 1.65;
}

.card-subtext {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 10px;
}

.card-span-2 {
  grid-column: span 2;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.text-small {
  font-size: 0.75rem;
}

.text-small-margin-top {
  font-size: 0.75rem;
  margin-top: 5px;
}

.section-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, 1fr);
  max-width: 760px;
}



.content-centered {
  position: relative;
  text-align: center;
  padding-top: 100px;
}

.doodle-positioned {
  position: absolute;
  bottom: 50px;
  right: 50px;
  width: 150px;
}

.hero-blue {
  background: linear-gradient(180deg, #17202a 0%, #080909 100%);
}

.hero-purple {
  background: linear-gradient(180deg, #201923 0%, #080909 100%);
}

.hero-teal {
  background: linear-gradient(180deg, #172420 0%, #080909 100%);
}

.hero-orange {
  background: linear-gradient(180deg, #242016 0%, #080909 100%);
}

.hero-cyan {
  background: linear-gradient(180deg, #1c1d1f 0%, #080909 100%);
}

.link-disabled {
  opacity: 0.6;
  cursor: default;
}

/* Mobile Navigation Toggle */
.nav-links-container {
  display: flex;
  gap: 0;
}

.mobile-menu-toggle {
  display: none; /* Hidden on desktop by default */
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: 10px;
}

.dots-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 14px;
  height: 14px;
}

.dots-icon span {
  position: absolute;
  width: 14px;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.48);
  transition: none;
  left: 0;
}

.dots-icon span:nth-child(1) { top: 3px; }
.dots-icon span:nth-child(2) { top: 7px; }
.dots-icon span:nth-child(3) { top: 11px; }

.mobile-menu-toggle:hover .dots-icon span {
  background-color: rgba(255, 255, 255, 0.66);
}

.mobile-menu-toggle.active .dots-icon span:nth-child(1) {
  top: 3px;
  transform: none;
}

.mobile-menu-toggle.active .dots-icon span:nth-child(2) {
  opacity: 1;
}

.mobile-menu-toggle.active .dots-icon span:nth-child(3) {
  top: 11px;
  transform: none;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .hero { padding: 0 5%; min-height: 560px; padding-top: 100px; padding-bottom: 56px; }
  main { padding: 52px 5%; }

  /* Adjust sections for mobile */
  main section {
    margin-bottom: 44px;
  }

  body.theme-terms main {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  body.theme-terms main section {
    margin-bottom: 48px;
  }

  main section h2 {
    font-size: 1.4rem;
  }

  main section ul {
    padding-left: 15px;
  }

  /* Stack table columns on mobile */
  .table {
    min-width: auto;
    width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table thead {
    display: none;
  }

  .table tbody {
    display: block;
    width: 100%;
  }

  .table tr {
    display: block;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.018);
  }

  .table td {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 6px 0;
    border: none;
    position: relative;
    white-space: normal;
    font-size: 0.85rem;
  }

  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: none;
    margin-bottom: 4px;
  }

  .table td code {
    font-size: 0.75rem;
    word-break: break-all;
  }

  /* Adjust code blocks for mobile */
  pre {
    padding: 16px;
    font-size: 0.74rem;
    overflow-x: auto;
  }

  /* Adjust footer for mobile */
  footer {
    padding: 30px 5%;
  }

  /* Adjust link lists for mobile */
  .link-list a {
    padding: 12px 16px;
  }

  /* Adjust hero content for mobile */
  .hero-content {
    max-width: 100%;
  }

  .hero-logo {
    width: 92px;
  }

  /* Adjust buttons for mobile */
  .btn-primary {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .btn-secondary {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  /* Mobile Navigation */
  nav.pill-nav {
    position: fixed;
    width: auto;
    max-width: none;
    justify-content: flex-end;
    padding: 0;
    background: none;
    border: none;
    top: 20px;
    right: 20px;
    left: auto;
    transform: none;
  }

  /* Hide the desktop links container on mobile */
  .nav-links-container {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(16, 18, 18, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    min-width: 150px;
    z-index: 1001;
    width: max-content;
    display: none;
    pointer-events: auto;
  }

  .nav-links-container.active {
    display: flex;
  }

  .nav-links-container a {
    padding: 10px 15px;
    text-align: center;
    border-radius: 12px;
    font-size: 1rem;
  }

  .mobile-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(16, 18, 18, 0.68) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.055) !important;
    border-radius: 14px;
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0;
    z-index: 1002;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    box-shadow: none;
  }

  .mobile-menu-toggle.active {
    background: rgba(255, 255, 255, 0.065) !important;
  }

  .section-grid {
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
  }

  .section-grid.max-2 {
    grid-template-columns: 1fr !important;
  }

  .section-grid.max-2 section {
    grid-column: span 1;
  }
}
