/* ==========================================
   sitw.dev — Евгений Айгаров
   ========================================== */

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

:root {
  --bg:          #FAFAF8;
  --bg-card:     #FFFFFF;
  --bg-section:  #F3F4F6;
  --text:        #1A1A1A;
  --text-muted:  #6B7280;
  --navy:        #1B3A5C;
  --orange:      #E8734A;
  --border:      #E5E7EB;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow:      0 2px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg:   0 4px 20px rgba(0,0,0,0.12), 0 16px 48px rgba(0,0,0,0.08);
  --radius:      12px;
  --radius-lg:   20px;
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --max-w:       1100px;
  --nav-h:       64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ==========================================
   Layout
   ========================================== */

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

section { padding: 80px 0; }

/* ==========================================
   Header / Nav
   ========================================== */

.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background 0.3s, box-shadow 0.3s;
}

.header.scrolled {
  background: rgba(250, 250, 248, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--navy);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ==========================================
   Hero
   ========================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%; right: -10%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(27,58,92,0.07) 0%, transparent 65%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -10%; left: -5%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(232,115,74,0.07) 0%, transparent 65%);
  pointer-events: none;
}

.hero-content { max-width: 680px; }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 28px;
}

.hero-tag::before {
  content: '';
  display: block;
  width: 28px; height: 1px;
  background: var(--orange);
}

.hero-name {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--navy);
  margin-bottom: 16px;
}

.hero-slogan {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.hero-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 52px;
}

.role-tag {
  display: inline-block;
  padding: 7px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: all 0.2s;
}

.role-tag:hover {
  border-color: var(--navy);
  color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ==========================================
   Buttons
   ========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: var(--font);
}

.btn-primary {
  background: var(--navy);
  color: white;
}

.btn-primary:hover {
  background: #152e4a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27,58,92,0.28);
}

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

.btn-secondary:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

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

.btn-outline:hover {
  background: var(--orange);
  color: white;
  transform: translateY(-2px);
}

/* ==========================================
   Section header
   ========================================== */

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--navy);
}

.section-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--orange);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
  white-space: nowrap;
}

.section-link:hover { gap: 10px; }

/* ==========================================
   Cards Grid
   ========================================== */

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

.cards-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: block;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card-thumb {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.card-thumb-inner {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease;
}

.card:hover .card-thumb-inner {
  transform: scale(1.04);
}

.card-thumb-icon {
  font-size: 3.5rem;
  opacity: 0.85;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
}

/* Project card thumb colors */
.thumb-tracker { background: linear-gradient(135deg, #0F7860 0%, #34D399 100%); }
.thumb-solar   { background: linear-gradient(135deg, #0F1B35 0%, #1B3A5C 50%, #2563EB 100%); }
.thumb-cowboy  { background: linear-gradient(135deg, #7C3B00 0%, #D97706 100%); }
.thumb-language { background: linear-gradient(135deg, #4C1D95 0%, #7C3AED 100%); }

/* Life card thumb colors */
.thumb-moto    { background: linear-gradient(135deg, #7C2D12 0%, #EA580C 100%); }
.thumb-yacht   { background: linear-gradient(135deg, #0C4A6E 0%, #0EA5E9 100%); }
.thumb-travel  { background: linear-gradient(135deg, #1B3A5C 0%, #7C3AED 50%, #E8734A 100%); }

.card-body { padding: 24px; }

.card-category {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.73rem;
  padding: 3px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  font-weight: 500;
}

.card-arrow {
  font-size: 1.1rem;
  color: var(--navy);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.card:hover .card-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* ==========================================
   Page hero (inner pages)
   ========================================== */

.page-hero {
  padding: calc(var(--nav-h) + 64px) 0 56px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.page-hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.page-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--navy);
  margin-bottom: 16px;
  line-height: 1.1;
}

.page-hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
}

/* ==========================================
   Article page
   ========================================== */

.article-layout {
  padding: 60px 0 80px;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 40px;
  transition: color 0.2s, gap 0.2s;
}

.article-back:hover {
  color: var(--navy);
  gap: 10px;
}

.article-hero-thumb {
  height: 360px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 48px;
}

.article-hero-thumb .card-thumb-inner {
  height: 100%;
  font-size: 6rem;
}

.article-content {
  max-width: 680px;
}

.article-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.meta-item {}

.meta-label {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.meta-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
}

.meta-value a {
  color: var(--orange);
  transition: opacity 0.2s;
}

.meta-value a:hover { opacity: 0.75; }

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin: 40px 0 16px;
  letter-spacing: -0.02em;
}

.article-content p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 18px;
  font-size: 1rem;
}

.article-content ul {
  margin: 0 0 18px 20px;
  color: var(--text-muted);
  line-height: 1.8;
}

.article-content li { margin-bottom: 6px; }

/* ==========================================
   About page
   ========================================== */

.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 64px;
  align-items: start;
  padding: calc(var(--nav-h) + 56px) 0 80px;
}

.about-avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--navy) 0%, #2563EB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.about-text h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin: 40px 0 14px;
  letter-spacing: -0.02em;
}

.about-text h2:first-child { margin-top: 0; }

.about-text p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
  font-size: 1rem;
}

.interests-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.interest-card {
  padding: 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.interest-card:hover {
  border-color: var(--navy);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.interest-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.interest-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 4px;
}

.interest-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.contact-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ==========================================
   Footer
   ========================================== */

.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

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

.footer-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--navy); }

/* ==========================================
   Scroll animations
   ========================================== */

.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* ==========================================
   Responsive
   ========================================== */

@media (min-width: 901px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .cards-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-avatar { max-width: 180px; position: static; }
}

@media (max-width: 768px) {
  section { padding: 60px 0; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(250, 250, 248, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }

  .cards-grid,
  .cards-grid-3 { grid-template-columns: 1fr; }

  .section-header { flex-direction: column; gap: 10px; }

  .interests-grid { grid-template-columns: 1fr; }

  .article-meta { gap: 20px; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}
