/* ============================================================
   Александр Подставкин — личный сайт
   Стиль: тёмно-синяя классика + серебро. Строго, спокойно, дорого.
   ============================================================ */

:root {
  --navy-deep: #0a1526;
  --navy: #0f1e33;
  --navy-soft: #16304f;
  --ink: #1b2a3d;
  --ink-soft: #46566c;
  --paper: #f7f8fa;
  --white: #ffffff;
  --line: #d8dee7;
  --line-soft: #e7ebf0;
  --silver: #93a1b3;
  --silver-light: #c9d2dd;
  --silver-faint: rgba(201, 210, 221, 0.55);
  --accent: #3d6291;
  --accent-soft: #5f7fa8;
  --ok: #2f6b4f;
  --err: #8c3a3a;
  --font-serif: 'Source Serif 4', Georgia, 'PT Serif', 'Times New Roman', serif;
  --font-sans: 'Inter', 'PT Sans', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--navy); color: var(--paper); }

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--navy); }

.container { width: min(1080px, 100% - 48px); margin-inline: auto; }
.container.narrow { width: min(780px, 100% - 48px); }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: #fff; padding: 0.6rem 1.2rem; z-index: 200;
}
.skip:focus { left: 12px; top: 12px; color: #fff; }

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

/* ---------- Верхняя панель ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 248, 250, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-in {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; position: relative;
}

.brand { display: inline-flex; align-items: center; gap: 0.8rem; color: var(--ink); }
.brand:hover { color: var(--navy); }

.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  background: var(--navy); color: var(--silver-light);
  font-family: var(--font-serif); font-size: 1rem; font-weight: 600;
  border-radius: 4px; letter-spacing: 0.02em;
}
.brand-mark.small { width: 30px; height: 30px; font-size: 0.85rem; }

.brand-name {
  font-family: var(--font-serif); font-weight: 600; font-size: 1.08rem;
  letter-spacing: 0.01em; white-space: nowrap;
}

.menu {
  display: flex; align-items: center; gap: 1.9rem; list-style: none;
}
.menu a {
  color: var(--ink-soft); font-size: 0.93rem; font-weight: 500;
  letter-spacing: 0.02em; padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}
.menu a:hover { color: var(--navy); }
.menu a.active { color: var(--navy); border-bottom-color: var(--accent); }
.menu a.menu-cta {
  color: var(--paper); background: var(--navy);
  padding: 0.5rem 1.1rem; border-radius: 3px; border-bottom: none;
}
.menu a.menu-cta:hover { background: var(--navy-soft); color: #fff; }
.menu a.menu-cta.active { background: var(--navy-soft); color: #fff; }

.burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 9px;
  background: none; border: 1px solid var(--line); border-radius: 4px;
  cursor: pointer;
}
.burger span { display: block; height: 2px; background: var(--navy); transition: transform 0.25s, opacity 0.25s; }
body.nav-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .burger span:nth-child(2) { opacity: 0; }
body.nav-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Герой ---------- */
.hero {
  background:
    radial-gradient(900px 480px at 82% -10%, rgba(147, 161, 179, 0.14), transparent 65%),
    linear-gradient(165deg, #0c1a2e 0%, #122844 55%, #0c1a2e 100%);
  color: #e9edf3;
  border-bottom: 3px double var(--silver-faint);
}

.hero-in {
  display: grid; grid-template-columns: 1.12fr 0.88fr;
  gap: 56px; align-items: center;
  padding: 96px 0 104px;
}

.eyebrow {
  text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 0.78rem; font-weight: 500; color: var(--silver);
  margin-bottom: 1.4rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5.4vw, 3.9rem);
  font-weight: 600; line-height: 1.12; letter-spacing: -0.01em;
  color: #f2f5f9; text-wrap: balance;
}

.rule {
  width: 76px; margin: 1.6rem 0 1.4rem;
  border-top: 1px solid var(--silver-faint);
  border-bottom: 3px double var(--silver-faint);
  height: 5px;
}

.tagline {
  font-family: var(--font-serif); font-style: italic;
  font-size: 1.35rem; color: var(--silver-light); margin-bottom: 1.1rem;
}

.lead { color: rgba(233, 237, 243, 0.82); max-width: 46ch; font-size: 1.06rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.2rem; }

.hero-figure { position: relative; isolation: isolate; }
.hero-figure img {
  width: 100%; height: auto; border-radius: 4px;
  border: 1px solid rgba(201, 210, 221, 0.35);
  box-shadow: 0 24px 60px rgba(4, 10, 20, 0.45);
}
.hero-figure::after {
  content: ''; position: absolute; inset: 0;
  transform: translate(16px, 16px);
  border: 1px solid rgba(201, 210, 221, 0.28);
  border-radius: 4px; z-index: -1;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85rem 1.7rem; border-radius: 3px; border: 1px solid transparent;
  font-family: var(--font-sans); font-size: 0.97rem; font-weight: 600;
  letter-spacing: 0.03em; cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-navy { background: var(--navy); color: var(--paper); }
.btn-navy:hover { background: var(--navy-soft); color: #fff; }

.btn-light { background: var(--silver-light); color: var(--navy-deep); }
.btn-light:hover { background: #fff; color: var(--navy-deep); }

.btn-ghost { background: transparent; color: var(--silver-light); border-color: rgba(201, 210, 221, 0.45); }
.btn-ghost:hover { border-color: var(--silver-light); color: #fff; background: rgba(201, 210, 221, 0.08); }

/* ---------- Секции ---------- */
.section { padding: 96px 0; background: var(--white); }
.section.alt { background: var(--paper); }
.section.dark {
  background:
    linear-gradient(rgba(10, 21, 38, 0.9), rgba(10, 21, 38, 0.94)),
    url('../img/hero.jpg') center / cover no-repeat;
  color: rgba(233, 237, 243, 0.85);
  border-block: 1px solid rgba(201, 210, 221, 0.18);
}

section[id] { scroll-margin-top: 84px; }

.kicker {
  text-transform: uppercase; letter-spacing: 0.2em;
  font-size: 0.76rem; font-weight: 600; color: var(--accent);
  margin-bottom: 1rem;
}
.kicker::before {
  content: ''; display: inline-block; width: 28px;
  border-top: 1px solid currentColor; vertical-align: middle;
  margin-right: 12px;
}
.dark .kicker { color: var(--silver); }

.section h2 {
  font-family: var(--font-serif); font-weight: 600;
  font-size: clamp(1.65rem, 3.4vw, 2.3rem); line-height: 1.25;
  color: var(--ink); margin-bottom: 1.4rem; text-wrap: balance;
}
.dark h2 { color: #eef2f7; }

.section p { color: var(--ink-soft); max-width: 68ch; }
.section p + p { margin-top: 1rem; }
.dark p { color: rgba(233, 237, 243, 0.78); }

.muted { color: var(--ink-soft); }
.tiny { font-size: 0.82rem; color: var(--silver); letter-spacing: 0.02em; }

/* ---------- Компетенции ---------- */
.skills-groups {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 40px 56px; margin-top: 2.6rem;
}

.group h3 {
  font-family: var(--font-sans); font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-soft);
  padding-bottom: 0.7rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; list-style: none; }
.chips li {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 3px; padding: 0.45rem 0.95rem;
  font-size: 0.93rem; color: var(--ink-soft);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.chips li:hover { border-color: var(--accent-soft); color: var(--ink); transform: translateY(-1px); }

/* ---------- Проекты ---------- */
.link-card {
  display: flex; align-items: center; gap: 1.2rem;
  margin-top: 2.2rem; padding: 1.25rem 1.5rem;
  background: var(--white); border: 1px solid var(--line); border-radius: 4px;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.link-card:hover {
  border-color: var(--accent-soft); color: var(--ink);
  box-shadow: 0 10px 28px rgba(15, 30, 51, 0.08);
}
.link-card-title { font-family: var(--font-serif); font-weight: 600; font-size: 1.12rem; }
.link-card-meta { color: var(--ink-soft); font-size: 0.93rem; flex: 1; }
.link-card .arrow { color: var(--accent); font-size: 1.2rem; transition: transform 0.2s ease; }
.link-card:hover .arrow { transform: translateX(5px); }

/* ---------- Домашняя лаборатория ---------- */
.spec { list-style: none; margin: 2.4rem 0 0; }
.spec li {
  display: grid; grid-template-columns: 240px 1fr; gap: 24px;
  padding: 1rem 0.2rem; align-items: baseline;
  border-bottom: 1px solid rgba(201, 210, 221, 0.16);
}
.spec li:first-child { border-top: 1px solid rgba(201, 210, 221, 0.16); }
.spec b {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.95rem;
  color: var(--silver-light); letter-spacing: 0.02em;
}
.spec span { color: rgba(233, 237, 243, 0.72); font-size: 0.98rem; }

/* ---------- Обратная связь ---------- */
.feedback-in {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start;
}

.feedback-info .tiny { margin-top: 1.6rem; }

.form-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 4px;
  padding: 2.2rem 2rem; box-shadow: 0 14px 40px rgba(15, 30, 51, 0.06);
}

.field { margin-bottom: 1.2rem; }
.field label {
  display: block; font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.04em; color: var(--ink); margin-bottom: 0.45rem;
}
.field input,
.field textarea {
  width: 100%; font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 3px;
  padding: 0.75rem 0.9rem; transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 98, 145, 0.14);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--silver); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-card .btn { width: 100%; }
.form-card .btn:disabled { opacity: 0.6; cursor: wait; }

.form-status { margin-top: 0.9rem; font-size: 0.92rem; min-height: 1.2em; }
.form-status.err { color: var(--err); }

.success { border-color: var(--ok); }
.success h3 { font-family: var(--font-serif); color: var(--ok); font-size: 1.3rem; margin-bottom: 0.5rem; }
.success p { color: var(--ink-soft); }

.hidden { display: none; }

/* ---------- Футер ---------- */
.footer { background: var(--navy-deep); color: var(--silver); padding: 56px 0 32px; }

.footer-in {
  display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 40px;
  padding-bottom: 36px; border-bottom: 1px solid rgba(201, 210, 221, 0.15);
}

.footer-brand { display: flex; gap: 0.9rem; align-items: flex-start; }
.footer-brand p { font-size: 0.95rem; line-height: 1.6; color: var(--silver); }

.footer-nav { display: grid; gap: 0.45rem; justify-items: start; }
.footer-nav a, .footer-links a { color: var(--silver); font-size: 0.92rem; }
.footer-nav a:hover, .footer-links a:hover { color: #fff; }

.footer-links { display: grid; gap: 0.45rem; justify-items: start; }

.footer-note { margin-top: 1.4rem; color: rgba(147, 161, 179, 0.75); }

/* ---------- Появление секций ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 404 ---------- */
.page-404 { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.page-404 h1 { font-family: var(--font-serif); font-size: 4rem; color: var(--navy); }
.page-404 p { color: var(--ink-soft); margin: 0.8rem 0 1.8rem; }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; gap: 44px; padding: 64px 0 72px; }
  .hero-figure { max-width: 420px; }
  .skills-groups { grid-template-columns: 1fr; gap: 32px; }
  .feedback-in { grid-template-columns: 1fr; gap: 40px; }
  .footer-in { grid-template-columns: 1fr; gap: 28px; }
  .spec li { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 760px) {
  .section { padding: 68px 0; }
  .burger { display: flex; }
  .menu {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px 24px 20px; box-shadow: 0 18px 30px rgba(15, 30, 51, 0.08);
  }
  body.nav-open .menu { display: flex; }
  .menu li { width: 100%; }
  .menu a { display: block; padding: 0.8rem 0; border-bottom: 1px solid var(--line-soft); }
  .menu a.active { border-bottom-color: var(--line-soft); color: var(--accent); }
  .menu a.menu-cta { margin-top: 0.9rem; display: inline-block; padding: 0.6rem 1.3rem; border-bottom: none; }
  .brand-name { display: none; }
}

@media (max-width: 480px) {
  .container { width: calc(100% - 36px); }
  .form-card { padding: 1.6rem 1.3rem; }
  .hero-actions .btn { width: 100%; }
}

/* ---------- Уважение к настройкам движения ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Печать ---------- */
@media print {
  .topbar, .hero-figure, .feedback-form-wrap, .footer-nav, .footer-links, .burger { display: none !important; }
  body { background: #fff; }
  .hero, .section.dark { background: #fff; color: #000; border: none; }
  .hero h1, .section h2, .dark h2 { color: #000; }
  .lead, .section p, .dark p, .spec span { color: #333; }
}
