/* ═══════════════════════════════════════════════════════════════════════
   Fyodor Amanov — Personal Website
   Google-inspired clean, minimalistic light theme
   ═══════════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:         #ffffff;
  --bg-alt:     #f8f9fa;
  --bg-card:    #ffffff;
  --surface:    #f1f3f4;
  --border:     #e0e0e0;
  --border-l:   #dadce0;
  --text:       #202124;
  --text-sec:   #5f6368;
  --text-dim:   #80868b;
  --accent:     #1a73e8;
  --accent-h:   #1557b0;
  --accent-bg:  #e8f0fe;
  --accent2:    #8430ce;
  --accent3:    #1e8e3e;
  --red:        #d93025;
  --font:       'Google Sans', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:       'JetBrains Mono', 'Roboto Mono', monospace;
  --max-w:      1140px;
  --max-w-n:    960px;
  --radius:     8px;
  --radius-l:   12px;
  --shadow-1:   0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --shadow-2:   0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
  --shadow-3:   0 4px 8px 0 rgba(60,64,67,.3), 0 8px 16px 4px rgba(60,64,67,.15);
  --transition: 200ms cubic-bezier(.4,0,.2,1);
}

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

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

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-h); }

::selection {
  background: var(--accent-bg);
  color: var(--accent);
}

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

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

/* ── Navbar ───────────────────────────────────────────────────────── */
#navbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

#navbar.scrolled {
  box-shadow: var(--shadow-1);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--accent); }

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

.nav-links a {
  display: block;
  padding: 8px 16px;
  color: var(--text-sec);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 100px;
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover {
  background: var(--surface);
  color: var(--text);
}
.nav-links a.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-sec);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background var(--transition);
}
.nav-toggle:hover { background: var(--surface); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.08;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 120px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-text {
  max-width: 540px;
}

.hero-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-text h1 span {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-sec);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 480px;
}

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

.hero-image {
  position: relative;
}
.hero-image img {
  width: 100%;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-2);
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-h);
  color: #fff;
  box-shadow: 0 1px 3px rgba(26,115,232,.4);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-l);
}
.btn-outline:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}

.btn-text {
  background: transparent;
  color: var(--accent);
  padding: 10px 12px;
}
.btn-text:hover {
  background: var(--accent-bg);
}

/* ── Section Layout ───────────────────────────────────────────────── */
.section {
  padding: 80px 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section-header {
  margin-bottom: 48px;
}

.section-header h1,
.section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.section-header p {
  font-size: 1rem;
  color: var(--text-sec);
  max-width: 600px;
}

.section-overline {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ── Fade-in animation ────────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ── Stats Row ────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 48px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Project Cards ────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.project-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

.card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--surface);
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.project-card:hover .card-img-wrap img {
  transform: scale(1.03);
}

.card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.card-body {
  padding: 24px;
}

.card-body h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.card-body p {
  font-size: 0.875rem;
  color: var(--text-sec);
  margin-bottom: 16px;
  line-height: 1.6;
}

.card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.card-tech span {
  background: var(--surface);
  color: var(--text-sec);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-family: var(--mono);
  font-weight: 500;
}

.card-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}
.card-link:hover { text-decoration: underline; }

/* ── Feature cards (wide) ─────────────────────────────────────────── */
.feature-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
  margin-bottom: 24px;
  transition: box-shadow var(--transition);
}
.feature-card:hover {
  box-shadow: var(--shadow-2);
}
.feature-card--reverse {
  direction: rtl;
}
.feature-card--reverse > * {
  direction: ltr;
}

.feature-card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--surface);
}
.feature-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-card-body {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.feature-card-body h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.feature-card-body p {
  font-size: 0.9rem;
  color: var(--text-sec);
  line-height: 1.65;
  margin-bottom: 20px;
}

/* ── Timeline ─────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 32px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 32px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -29px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.timeline-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.timeline-role {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 6px;
}

.timeline-content p:last-child {
  color: var(--text-sec);
  font-size: 0.875rem;
}

.timeline-content ul {
  padding-left: 18px;
  margin-top: 6px;
}
.timeline-content ul li {
  color: var(--text-sec);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

/* ── Education / Experience grid ──────────────────────────────────── */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.exp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow var(--transition);
}
.exp-card:hover {
  box-shadow: var(--shadow-1);
}

.exp-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.exp-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.exp-card > p:last-child {
  font-size: 0.85rem;
  color: var(--text-sec);
}

/* ── Awards Cards ─────────────────────────────────────────────────── */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.award-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow var(--transition);
}
.award-card:hover {
  box-shadow: var(--shadow-1);
}
.award-card.highlight {
  border-left: 3px solid var(--accent);
}

.award-year {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 6px;
}

.award-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.award-card p {
  font-size: 0.85rem;
  color: var(--text-sec);
}

/* ── Publications ─────────────────────────────────────────────────── */
.pub-list {
  list-style: none;
}

.pub-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  align-items: baseline;
}
.pub-list li:last-child { border-bottom: none; }

.pub-year {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
  min-width: 40px;
}

.pub-list strong {
  color: var(--text);
  font-weight: 600;
}

.pub-list li span:not(.pub-year) {
  font-size: 0.875rem;
  color: var(--text-sec);
}

/* ── Skills ───────────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 32px;
}

.skill-group h3 {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tags span {
  background: var(--surface);
  color: var(--text-sec);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  transition: background var(--transition), color var(--transition);
}
.skill-tags span:hover {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ── CV Table ─────────────────────────────────────────────────────── */
.cv-section {
  margin-bottom: 48px;
}

.cv-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 20px;
}

.cv-entry {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.cv-entry:last-child { border-bottom: none; }

.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.cv-entry-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.cv-entry-header .cv-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.cv-entry-sub {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 6px;
}

.cv-entry ul {
  padding-left: 18px;
  margin-top: 6px;
}
.cv-entry ul li {
  font-size: 0.85rem;
  color: var(--text-sec);
  margin-bottom: 4px;
}

.cv-entry p {
  font-size: 0.85rem;
  color: var(--text-sec);
}

/* ── Photo Gallery ────────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery-grid img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform 0.3s ease;
}
.gallery-grid img:hover {
  transform: scale(1.02);
}

/* ── Contact ──────────────────────────────────────────────────────── */
.contact-inner {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-inner p {
  color: var(--text-sec);
  margin-bottom: 32px;
  font-size: 1.05rem;
}

.contact-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Footer ───────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

footer a { color: var(--text-sec); }
footer a:hover { color: var(--accent); }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-image { max-width: 480px; }
  .feature-card { grid-template-columns: 1fr; }
  .feature-card--reverse { direction: ltr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    padding: 12px 24px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-1);
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }

  .projects-grid,
  .exp-grid,
  .awards-grid { grid-template-columns: 1fr; }

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

  .pub-list li { flex-direction: column; gap: 4px; }

  .section { padding: 56px 0; }
}

@media (max-width: 480px) {
  .hero-text h1 { font-size: 2rem; }
  .section-header h1, .section-header h2 { font-size: 1.5rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .gallery-grid { grid-template-columns: 1fr; }
}
