/* ==========================================================================
   APATIYM STUDIO — LIGHT & DARK THEME UTILITARIAN ARCHITECTURE
   ========================================================================== */

/* 1. Default Light Theme (Белая тема по умолчанию) */
:root, [data-theme="light"] {
  --bg-canvas: #FBFBFA;
  --surface-1: #FFFFFF;
  --surface-2: #F7F6F3;
  --surface-3: #EAEAEA;

  --text-main: #111111;
  --text-body: #2F3437;
  --text-secondary: #787774;
  --text-muted: #94938F;

  --border-subtle: #EAEAEA;
  --border-active: #111111;

  --btn-bg: #111111;
  --btn-text: #FFFFFF;
  --btn-hover: #333333;

  /* Muted Pastels for Light Theme */
  --status-green-bg: #EDF3EC;
  --status-green-text: #346538;
  --status-green-border: #CBE3C9;

  --status-blue-bg: #E1F3FE;
  --status-blue-text: #1F6C9F;
  --status-blue-border: #BCE3FD;

  --status-amber-bg: #FBF3DB;
  --status-amber-text: #956400;
  --status-amber-border: #F6E6B8;

  --win-dot-color: #D1D1D1;

  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. Dark Theme (Тёмная тема) */
[data-theme="dark"] {
  --bg-canvas: #0D1117;
  --surface-1: #161B22;
  --surface-2: #21262D;
  --surface-3: #30363D;

  --text-main: #FFFFFF;
  --text-body: #E6EDF3;
  --text-secondary: #8B949E;
  --text-muted: #6E7681;

  --border-subtle: rgba(240, 246, 252, 0.1);
  --border-active: #58A6FF;

  --btn-bg: #FFFFFF;
  --btn-text: #0D1117;
  --btn-hover: #E6EDF3;

  /* Desaturated Pastels for Dark Theme */
  --status-green-bg: rgba(46, 160, 67, 0.15);
  --status-green-text: #56D364;
  --status-green-border: rgba(46, 160, 67, 0.3);

  --status-blue-bg: rgba(56, 139, 253, 0.15);
  --status-blue-text: #58A6FF;
  --status-blue-border: rgba(56, 139, 253, 0.3);

  --status-amber-bg: rgba(210, 153, 34, 0.15);
  --status-amber-text: #E3B341;
  --status-amber-border: rgba(210, 153, 34, 0.3);

  --win-dot-color: #484F58;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body.editorial-app {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-body);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  color: var(--text-main);
  line-height: 1.15;
}

h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.03em;
}

h2, h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.max-w-4xl {
  max-width: 860px;
}

.font-mono {
  font-family: var(--font-mono);
}

.mt-64 {
  margin-top: 64px;
}

/* Primary Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-smooth);
}

.btn-primary:hover {
  background: var(--btn-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-full {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
}

.btn-primary:disabled,
.btn-primary.btn-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

/* Header Component */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-canvas);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
  transition: background var(--transition-smooth), border-color var(--transition-smooth);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-mark {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
}

.nav-menu {
  display: flex;
  gap: 28px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-smooth);
}

.nav-link:hover {
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition-smooth);
}

.theme-toggle-btn:hover {
  background: var(--surface-3);
}

.sun-icon {
  width: 16px;
  height: 16px;
  display: block;
}

.moon-icon {
  width: 16px;
  height: 16px;
  display: none;
}

[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="dark"] .moon-icon {
  display: block;
}

.theme-toggle-text {
  font-size: 0.8rem;
}

/* Currency Toggle Bar */
.currency-toggle {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.curr-btn {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 4px;
}

.curr-btn:hover {
  color: var(--text-main);
}

.curr-btn.active {
  background: var(--surface-1);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.curr-symbol {
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Hero Section */
.hero-section {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--status-blue-bg);
  color: var(--status-blue-text);
  border: 1px solid var(--status-blue-border);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
}

.pulse-status {
  font-size: 0.6rem;
}

.hero-heading {
  font-size: 3.6rem;
  max-width: 900px;
  margin-bottom: 20px;
  color: var(--text-main);
}

.hero-heading em {
  font-style: italic;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 740px;
  margin-bottom: 32px;
}

.rate-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 780px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 12px;
}

.rate-currency {
  color: var(--text-main);
}

.hero-meta-row {
  display: flex;
  align-items: center;
  gap: 36px;
  width: 100%;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-val {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.meta-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.meta-divider {
  width: 1px;
  height: 36px;
  background: var(--border-subtle);
}

/* Controls Section (Search & Filter) */
.controls-section {
  position: sticky;
  top: 69px;
  z-index: 90;
  background: var(--bg-canvas);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
  transition: background var(--transition-smooth);
}

.controls-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 768px) {
  .controls-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.search-box input {
  width: 100%;
  padding: 9px 36px 9px 38px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.88rem;
  transition: all var(--transition-smooth);
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-active);
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 1.1rem;
  display: none;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-btn {
  white-space: nowrap;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition-smooth);
}

.filter-btn:hover {
  color: var(--text-main);
  background: var(--surface-2);
}

.filter-btn.active {
  background: var(--text-main);
  color: var(--bg-canvas);
  border-color: var(--text-main);
}

/* Service Grid Cards */
.main-services {
  padding: 64px 0 80px;
}

.block-header {
  margin-bottom: 28px;
}

.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.badge-prepay-55 {
  background: var(--status-green-bg);
  color: var(--status-green-text);
  border: 1px solid var(--status-green-border);
}

.badge-prepay-100 {
  background: var(--status-blue-bg);
  color: var(--status-blue-text);
  border: 1px solid var(--status-blue-border);
}

.badge-info {
  background: var(--status-amber-bg);
  color: var(--status-amber-text);
  border: 1px solid var(--status-amber-border);
}

.block-title {
  font-size: 1.6rem;
  margin-bottom: 4px;
  color: var(--text-main);
}

.block-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.cards-grid .surface-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-smooth);
}

.cards-grid .surface-card:hover {
  background: var(--surface-2);
  border-color: var(--border-active);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  margin-bottom: 16px;
}

.card-icon-box svg {
  width: 20px;
  height: 20px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.card-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  margin-top: auto;
}

.price-row {
  margin-bottom: 14px;
}

.price-amount {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.prepay-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.btn-card-add {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.82rem;
  transition: all var(--transition-smooth);
}

.btn-card-add:hover {
  background: var(--text-main);
  color: var(--bg-canvas);
  border-color: var(--text-main);
}

.btn-card-add.added {
  background: var(--text-main);
  color: var(--bg-canvas);
}

.btn-card-tg {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-smooth);
}

.btn-card-tg:hover {
  color: var(--text-main);
  background: var(--surface-3);
}

/* Calculator Window Chrome */
.calculator-section {
  padding: 60px 0 80px;
}

.window-chrome {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 20px;
}

.window-controls {
  display: flex;
  gap: 6px;
}

.win-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--win-dot-color);
}

.window-title {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.window-curr-pill {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.window-curr-pill strong {
  color: var(--text-main);
}

.window-body {
  padding: 32px;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100px;
  margin-bottom: 24px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px;
  text-align: center;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
}

.empty-icon {
  width: 28px;
  height: 28px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-text {
  font-weight: 600;
  color: var(--text-main);
}

.empty-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
}

.cart-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-item-ico {
  width: 16px;
  height: 16px;
  color: var(--text-main);
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}

.cart-item-price {
  color: var(--text-main);
  font-weight: 700;
}

.cart-item-remove {
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-left: 14px;
  transition: color var(--transition-smooth);
}

.cart-item-remove:hover {
  color: #9F2F2D;
}

.calc-summary {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.summary-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.prepay-line {
  border-top: 1px dashed var(--border-subtle);
  padding-top: 10px;
}

.prepay-val {
  color: var(--status-green-text);
}

.calc-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 14px 0 18px;
}

.notice-icon {
  width: 16px;
  height: 16px;
  color: var(--text-main);
  flex-shrink: 0;
}

/* FAQ Accordion */
.faq-section {
  padding: 60px 0 100px;
}

.faq-header {
  margin-bottom: 32px;
}

.faq-title {
  font-size: 2.2rem;
  margin-top: 6px;
  color: var(--text-main);
}

.accordion-list {
  display: flex;
  flex-direction: column;
}

.accordion-item {
  border-bottom: 1px solid var(--border-subtle);
}

.accordion-trigger {
  width: 100%;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: left;
  transition: color var(--transition-smooth);
}

.accordion-trigger:hover {
  color: var(--text-secondary);
}

.accordion-icon {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--text-secondary);
  transition: transform var(--transition-smooth);
}

.accordion-item.active .accordion-icon {
  transform: rotate(45deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.accordion-content p {
  padding-bottom: 20px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.text-link {
  color: var(--text-main);
  text-decoration: underline;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-1);
  padding: 36px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.footer-tg-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: underline;
}

/* Reveal Entry Animation */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Toast Container */
.toast-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

.toast {
  background: var(--text-main);
  color: var(--bg-canvas);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 900px) {
  .hero-heading {
    font-size: 2.6rem;
  }
  .nav-menu {
    display: none;
  }
  .hero-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .meta-divider {
    display: none;
  }
}

@media (max-width: 600px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .window-body {
    padding: 20px;
  }
}
