/* ============================================================
   Ivan Glushchenko — personal site
   Dark modern theme, mobile-first, zero external dependencies.
   ============================================================ */

:root {
  --bg: #0d0f14;
  --bg-elev: #141821;
  --bg-muted: #10131a;
  --fg: #e8ecf4;
  --fg-muted: #9aa3b2;
  --fg-dim: #6b7280;
  --accent: #ff7a3d;
  --accent-soft: #ff7a3d26;
  --border: #1f2430;
  --border-strong: #2a3140;
  --radius: 14px;
  --radius-sm: 8px;
  --max-w: 1080px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  color: #ffa473;
}

code {
  font-family: var(--font-mono);
  background: var(--bg-elev);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.92em;
}

/* ---------------- Nav ---------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(13, 15, 20, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav__brand {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
  color: var(--fg);
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.nav__brand:hover {
  color: var(--fg);
  background: var(--bg-elev);
}

.nav__links {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
}

.nav__links a {
  color: var(--fg-muted);
  font-size: 15px;
  font-weight: 500;
}

.nav__links a:hover {
  color: var(--fg);
}

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

.hero {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 80px 24px 60px;
  text-align: center;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 122, 61, 0.14), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(100, 150, 255, 0.08), transparent 60%),
    var(--bg);
}

.hero__inner {
  max-width: 760px;
}

.hero__eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 13px;
  margin: 0 0 18px;
}

.hero__title {
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.05;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #c6ccd8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__tagline {
  font-size: clamp(17px, 2.2vw, 22px);
  color: var(--fg-muted);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.5;
}

.dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--fg-dim);
  margin: 0 10px;
  vertical-align: middle;
}

.hero__actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn--primary {
  background: var(--accent);
  color: #1a0d04;
}

.btn--primary:hover {
  background: #ffa473;
  color: #1a0d04;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn--ghost {
  color: var(--fg);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  background: var(--bg-elev);
  color: var(--fg);
}

.hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--fg-dim);
  font-size: 20px;
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 6px); }
}

/* ---------------- Section layout ---------------- */

.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 90px 24px;
}

.section--muted {
  background: var(--bg-muted);
  max-width: none;
  padding-left: 24px;
  padding-right: 24px;
}

.section--muted > * {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
}

.section__title {
  font-size: clamp(28px, 4vw, 38px);
  margin: 0 0 36px;
  letter-spacing: -0.015em;
}

.section__title::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 2px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 14px;
  transform: translateY(-6px);
}

/* ---------------- About ---------------- */

.about__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 36px;
  align-items: start;
}

@media (max-width: 760px) {
  .about__grid { grid-template-columns: 1fr; }
}

.about__text p {
  margin: 0 0 16px;
  color: var(--fg);
}

.about__card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.facts {
  margin: 0;
}

.facts__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.facts__row:last-child { border-bottom: none; }

.facts dt {
  color: var(--fg-muted);
  font-size: 14px;
}

.facts dd {
  margin: 0;
  color: var(--fg);
  font-weight: 500;
  text-align: right;
}

/* ---------------- Interest cards ---------------- */

.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.card__icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.card__title {
  margin: 0 0 8px;
  font-size: 18px;
}

.card__body {
  margin: 0;
  color: var(--fg-muted);
  font-size: 15px;
}

/* ---------------- Projects ---------------- */

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

.project {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.project:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tag {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tag--muted {
  background: var(--bg-muted);
  color: var(--fg-muted);
}

.project__title {
  margin: 0 0 10px;
  font-size: 22px;
}

.project__body {
  margin: 0 0 14px;
  color: var(--fg-muted);
  font-size: 15.5px;
}

.project__link {
  font-weight: 600;
  font-size: 14px;
}

/* ---------------- Contact ---------------- */

.contact__blurb {
  color: var(--fg-muted);
  max-width: 560px;
  margin: 0 0 28px;
}

.contact__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.contact__item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "icon label"
    "icon value";
  column-gap: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--fg);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.contact__item:hover {
  border-color: var(--accent);
  color: var(--fg);
  transform: translateY(-2px);
}

.contact__icon {
  grid-area: icon;
  font-size: 22px;
  align-self: center;
}

.contact__label {
  grid-area: label;
  color: var(--fg-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.contact__value {
  grid-area: value;
  font-weight: 500;
}

/* ---------------- Footer ---------------- */

.footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--fg-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
