/* ============================================================
   Стартовая страница timlun.ru — стили.
   Тёмная/светлая темы через токены: :root — светлая,
   [data-theme="dark"] — тёмная (тему всегда задаёт theme-init.js).
   Внешних ресурсов нет — совместимо с CSP default-src 'self'.
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #edf1f6;
  --text: #1d2530;
  --muted: #5d6c7c;
  --border: #dce3ec;
  --accent: #2e6fb4;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(46, 111, 180, 0.12);
  --live: #177a4c;
  --live-bg: rgba(23, 122, 76, 0.12);
  --soon: #8a6320;
  --soon-bg: rgba(138, 99, 32, 0.13);
  --shadow: 0 12px 32px rgba(24, 34, 48, 0.10);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e141b;
  --surface: #161e28;
  --surface-2: #1d2733;
  --text: #e7edf4;
  --muted: #94a4b6;
  --border: #27323f;
  --accent: #74b1ec;
  --accent-contrast: #0d1520;
  --accent-soft: rgba(116, 177, 236, 0.14);
  --live: #52c68f;
  --live-bg: rgba(82, 198, 143, 0.14);
  --soon: #d5ab59;
  --soon-bg: rgba(213, 171, 89, 0.14);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(640px 320px at 50% -80px, var(--accent-soft), transparent 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

[hidden] { display: none !important; }

.container {
  max-width: 780px;
  margin-inline: auto;
  padding-inline: 20px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-name {
  font-weight: 600;
  font-size: 0.95rem;
}

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

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  font: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

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

/* ---------- Выпадающий список «Проекты» ---------- */

.nav-dropdown { position: relative; }

.caret {
  width: 16px;
  height: 16px;
  transition: transform 0.18s;
}

.nav-dropdown.is-open .caret { transform: rotate(180deg); }
.nav-dropdown.is-open .nav-toggle {
  color: var(--text);
  background-color: var(--surface-2);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(24rem, calc(100vw - 2.5rem));
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 120;
}

.nav-dropdown.is-open .dropdown-menu { animation: menu-pop 0.16s ease; }

@keyframes menu-pop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dropdown-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background-color 0.14s;
}

a.dropdown-item:hover { background-color: var(--surface-2); }

.dropdown-item.is-placeholder { opacity: 0.72; }

.item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.item-arrow { color: var(--muted); }

.item-desc {
  margin-top: 2px;
  font-size: 0.84rem;
  color: var(--muted);
}

.status {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-live { background: var(--live-bg); color: var(--live); }
.status-soon { background: var(--soon-bg); color: var(--soon); }
.status-wip { background: var(--accent-soft); color: var(--accent); }
.status-frozen { background: var(--surface-2); color: var(--muted); }

/* ---------- Переключатель темы ---------- */

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

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

/* показываем иконку темы, НА которую переключимся */
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 40px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 10px auto 0;
  max-width: 34em;
  color: var(--muted);
  font-size: 1.02rem;
}

.clock { margin-top: 34px; }

.clock-time {
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  font-weight: 250;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.clock-date {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  text-transform: capitalize;
}

/* ---------- Секции ---------- */

.section { padding: 34px 0 10px; }

.section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section h2::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.about-text p { margin: 0 0 12px; }

/* ---------- Контакты ---------- */

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.contact-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.contact-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.contact-value {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact-arrow {
  margin-left: auto;
  color: var(--muted);
}

/* ---------- Подвал ---------- */

.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding-block: 22px;
  color: var(--muted);
  font-size: 0.86rem;
}

/* ---------- Прочее ---------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection { background: var(--accent-soft); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 600px) {
  .brand-name { display: none; }
  .nav-item { padding: 7px 9px; font-size: 0.9rem; }
  .hero { padding-top: 48px; }
  .footer-inner { flex-direction: column; }
}
