/* ========================================
   Baku San Studios — Global Styles
   ======================================== */

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

:root {
  --color-bg: #faf9f7;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b6b;
  --color-accent: #2d2d2d;
  --color-accent-hover: #444444;
  --color-border: #e8e6e3;
  --color-highlight: #e8f0fe;
  --color-focus: #4a90d9;

  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "Outfit", system-ui, -apple-system, sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 6rem;
  --space-2xl: 9rem;

  --max-width: 72rem;
  --nav-height: 4rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --color-bg: #131311;
  --color-surface: #1b1b18;
  --color-text: #e8e6e3;
  --color-text-muted: #8a8884;
  --color-accent: #e8e6e3;
  --color-accent-hover: #d0cec9;
  --color-border: #2c2b28;
  --color-highlight: #1e2a3a;
  --color-focus: #6eaaef;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.4s var(--ease-out), color 0.3s var(--ease-out);
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  background: var(--color-accent);
  color: var(--color-bg);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 0 0 6px 6px;
  font-size: 0.875rem;
  text-decoration: none;
  z-index: 1000;
  transition: top 0.2s var(--ease-out);
}

.skip-link:focus {
  top: 0;
  outline: none;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
  max-width: 38em;
  color: var(--color-text-muted);
}

a {
  color: var(--color-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease-out);
}

a:hover {
  color: var(--color-accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.section {
  padding-block: var(--space-xl);
}

.section--alt {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section__label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background-color 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}

[data-theme="dark"] .nav {
  background: rgba(19, 19, 17, 0.92);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--color-text);
  white-space: nowrap;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav__links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
  align-items: center;
}

.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color 0.2s var(--ease-out);
  padding: var(--space-xs) 0;
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--color-text);
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  color: var(--color-text);
}

.nav__toggle svg {
  display: block;
  width: 22px;
  height: 22px;
}

@media (max-width: 640px) {
  .nav__toggle {
    display: block;
  }

  .nav__links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(250, 249, 247, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-sm) var(--space-md) var(--space-md);
    gap: 0;
    display: none;
  }

  [data-theme="dark"] .nav__links {
    background: rgba(19, 19, 17, 0.98);
  }

  .nav__links.is-open {
    display: flex;
  }

  .nav__links a {
    padding: 0.75rem 0;
    font-size: 1rem;
    display: block;
    width: 100%;
  }

  .nav__links li + li {
    border-top: 1px solid var(--color-border);
  }
}

/* --- Theme Toggle (iOS switch) --- */
.theme-toggle {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-toggle__track {
  position: absolute;
  inset: 0;
  background: #d1d1d1;
  border-radius: 999px;
  transition: background 0.3s var(--ease-out);
}

[data-theme="dark"] .theme-toggle__track {
  background: #4a4a42;
}

.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle input:checked + .theme-toggle__track .theme-toggle__thumb {
  transform: translateX(18px);
}

.theme-toggle__icon {
  width: 12px;
  height: 12px;
}

.theme-toggle__icon--sun  { color: #f5a623; }
.theme-toggle__icon--moon { color: #8b8baa; display: none; }

.theme-toggle input:checked + .theme-toggle__track .theme-toggle__icon--sun  { display: none; }
.theme-toggle input:checked + .theme-toggle__track .theme-toggle__icon--moon { display: block; }

.theme-toggle input:focus-visible + .theme-toggle__track {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 999px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.75em 1.75em;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition:
    background-color 0.25s var(--ease-out),
    transform 0.15s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

.btn--primary:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn--secondary:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* --- Hero --- */
.hero {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-xl);
  text-align: center;
}

.hero h1 {
  margin-bottom: var(--space-sm);
}

.hero__tagline {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--color-text-muted);
  margin-inline: auto;
  margin-bottom: var(--space-lg);
  max-width: 32em;
}

.hero__actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- App Card --- */
.apps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

@media (min-width: 640px) {
  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.app-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: var(--space-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  transition: box-shadow 0.3s var(--ease-out), transform 0.2s var(--ease-out);
}

.app-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

[data-theme="dark"] .app-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.app-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.85);
}

.app-card:nth-child(1) .app-card__icon { background: linear-gradient(135deg, #7a9b8a, #5a7d6a); }
.app-card:nth-child(2) .app-card__icon { background: linear-gradient(135deg, #a08e7a, #7d6e5c); }
.app-card:nth-child(3) .app-card__icon { background: linear-gradient(135deg, #8593a3, #5f7085); }
.app-card:nth-child(4) .app-card__icon { background: linear-gradient(135deg, #b09880, #8a7460); }

[data-theme="dark"] .app-card:nth-child(1) .app-card__icon { background: linear-gradient(135deg, #5a7d6a, #3e5c4a); }
[data-theme="dark"] .app-card:nth-child(2) .app-card__icon { background: linear-gradient(135deg, #7d6e5c, #5c4f3e); }
[data-theme="dark"] .app-card:nth-child(3) .app-card__icon { background: linear-gradient(135deg, #5f7085, #445060); }
[data-theme="dark"] .app-card:nth-child(4) .app-card__icon { background: linear-gradient(135deg, #8a7460, #6a5642); }

.app-card__body h3 {
  margin-bottom: 0.25rem;
}

.app-card__body p {
  font-size: 0.9375rem;
  line-height: 1.6;
}

.app-card__badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: var(--color-border);
  padding: 0.2em 0.65em;
  border-radius: 5px;
  margin-top: 0.625rem;
}

/* --- Values --- */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.value-item {
  max-width: 28rem;
}

.value-item__number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.value-item h3 {
  margin-bottom: 0.5rem;
}

.value-item p {
  font-size: 0.9375rem;
}

/* --- Updates / CTA Banner --- */
.updates {
  text-align: center;
  padding-block: var(--space-xl);
}

.updates p {
  margin-inline: auto;
  margin-bottom: var(--space-md);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-lg);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
}

.footer__copy {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.footer__note {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  opacity: 0.6;
}

.footer__left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer__links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.footer__links a {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

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

/* --- Inner Pages (Privacy, Support) --- */
.page-header {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.page-header p {
  margin-top: var(--space-sm);
}

.page-content {
  padding-block: var(--space-lg);
}

.page-content h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.page-content h2:first-child {
  margin-top: 0;
}

.page-content p {
  margin-bottom: var(--space-sm);
}

.page-content ul,
.page-content ol {
  padding-left: 1.25em;
  margin-bottom: var(--space-sm);
  color: var(--color-text-muted);
  max-width: 38em;
}

.page-content li {
  margin-bottom: 0.5em;
}

.page-content li::marker {
  color: var(--color-border);
}

/* --- Animations --- */
@media (prefers-reduced-motion: no-preference) {
  .fade-in {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeUp 0.6s var(--ease-out) forwards;
  }

  .fade-in:nth-child(2) { animation-delay: 0.08s; }
  .fade-in:nth-child(3) { animation-delay: 0.16s; }
  .fade-in:nth-child(4) { animation-delay: 0.24s; }

  @keyframes fadeUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Scroll reveal */
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
  .reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.08s; }
  .reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.16s; }
  .reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.24s; }
}

/* --- Print --- */
@media print {
  .nav, .skip-link, .hero__actions, .updates {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }
}
