/* ── CSS Custom Properties ── */
:root {
  --color-bg:       #0D0D0D;
  --color-surface:  #151515;
  --color-card:     #1A1A1A;
  --color-border:   #2A2A2A;
  --color-text:     #E4E4E4;
  --color-muted:    #888888;
  --color-accent:   #C41E3A;
  --color-accent-glow: rgba(196, 30, 58, 0.25);
  --font-heading:   'Unbounded', sans-serif;
  --font-body:      'Nunito', sans-serif;
  --container:      1080px;
  --radius:         2px;
  --radius-lg:      6px;
  --transition:     250ms ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

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

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

/* ── Grain Texture ── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ── Font scale ── */
h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; }

/* ── Header ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 24px;
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav__logo {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 22px;
  color: var(--color-accent);
  letter-spacing: 2px;
  transition: opacity var(--transition);
  cursor: pointer;
}
.nav__logo:hover { opacity: 0.7; }

.nav__list {
  display: flex;
  gap: 28px;
}

.nav__link {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-muted);
  transition: color var(--transition);
  cursor: pointer;
}
.nav__link:hover,
.nav__link:focus-visible {
  color: var(--color-accent);
  outline: none;
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px 24px 40px;
  position: relative;
}

.hero__inner {
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: center;
}

.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero__frame {
  position: relative;
  display: inline-block;
  padding: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
}

.hero__frame-decor {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--color-accent);
  border-style: solid;
}
.hero__frame-decor--tl { top: -4px; left: -4px; border-width: 2px 0 0 2px; }
.hero__frame-decor--tr { top: -4px; right: -4px; border-width: 2px 2px 0 0; }
.hero__frame-decor--bl { bottom: -4px; left: -4px; border-width: 0 0 2px 2px; }
.hero__frame-decor--br { bottom: -4px; right: -4px; border-width: 0 2px 2px 0; }

.hero__avatar {
  width: 100%;
  max-width: 360px;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  filter: contrast(1.05) saturate(0.85);
  display: block;
}

.hero__crown {
  position: absolute;
  top: -30px;
  font-size: 40px;
  color: var(--color-accent);
  text-shadow: 0 0 30px var(--color-accent-glow);
  animation: crownBounce 3s ease-in-out infinite;
}

@keyframes crownBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero__greeting {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.hero__name {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--color-text);
}

.hero__name-accent {
  display: block;
  color: var(--color-accent);
}

.hero__role {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(18px, 2.5vw, 24px);
  color: var(--color-text);
  letter-spacing: 2px;
}

.hero__subtitle {
  font-size: 16px;
  color: var(--color-muted);
  max-width: 420px;
  line-height: 1.6;
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  display: inline-block;
  padding: 4px 14px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  background: var(--color-surface);
}
.tag--sm {
  font-size: 10px;
  padding: 3px 10px;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  padding: 14px 36px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  background: var(--color-accent);
  border: none;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  align-self: flex-start;
}
.hero__cta:hover {
  background: #a01830;
  box-shadow: 0 0 40px var(--color-accent-glow);
}
.hero__cta:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.hero__scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
}

.hero__scroll-line {
  display: block;
  width: 1px;
  height: 40px;
  background: var(--color-muted);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.2; transform: scaleY(0.5); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ── Section Title ── */
.section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 48px;
  letter-spacing: 1px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-title__num {
  font-weight: 300;
  font-size: 14px;
  color: var(--color-accent);
  letter-spacing: 2px;
  opacity: 0.6;
}

/* ── About ── */
.about {
  padding: 100px 0 80px;
}

.about__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
}

.about__card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  padding: 36px;
}

.about__card--bio p {
  margin-bottom: 16px;
  color: var(--color-text);
  line-height: 1.8;
}
.about__card--bio p:last-child { margin-bottom: 0; }

.about__lead {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.6;
  color: #fff !important;
  border-left: 3px solid var(--color-accent);
  padding-left: 16px;
}

/* Facts */
.facts {
  display: grid;
  gap: 0;
}

.facts__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px dashed var(--color-border);
}
.facts__item:last-child { border-bottom: none; }

.facts__icon {
  color: var(--color-accent);
  font-size: 10px;
  opacity: 0.7;
}

.facts__label {
  font-size: 13px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.facts__value {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text);
  text-align: right;
}

/* ── Divider ── */
.divider {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  opacity: 0.25;
  user-select: none;
}

.divider__symbol {
  font-size: 18px;
  color: var(--color-accent);
}
.divider__symbol:nth-child(odd) { color: var(--color-muted); }

/* ── Experience / Timeline ── */
.experience {
  padding: 80px 0;
}

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    var(--color-border) 0px,
    var(--color-border) 6px,
    transparent 6px,
    transparent 12px
  );
}

.timeline__item {
  position: relative;
  padding-left: 32px;
  margin-bottom: 40px;
}
.timeline__item:last-child { margin-bottom: 0; }

.timeline__marker {
  position: absolute;
  left: -30px;
  top: 6px;
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border: 2px solid var(--color-bg);
  outline: 1px solid var(--color-accent);
  outline-offset: 2px;
  transform: rotate(45deg);
}

.timeline__card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  padding: 28px 32px;
}

.timeline__period {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.timeline__company {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  color: var(--color-text);
  margin-bottom: 4px;
}

.timeline__role {
  font-size: 15px;
  color: var(--color-muted);
  margin-bottom: 12px;
}

.timeline__achievements {
  list-style: none;
  display: grid;
  gap: 6px;
}

.timeline__achievements li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  color: #bbb;
  line-height: 1.6;
}

.timeline__achievements li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  opacity: 0.6;
}

/* ── Projects ── */
.projects {
  padding: 80px 0;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  perspective: 800px;
}

.project-card__inner {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  padding: 32px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.project-card__inner::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transition: left 400ms ease;
}

.project-card__inner:hover::after {
  left: 0;
}

.project-card__inner:hover {
  border-color: #333;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

.project-card__year {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--color-accent);
  text-transform: uppercase;
}

.project-card__title {
  font-size: 18px;
  color: #fff;
}

.project-card__desc {
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.7;
  flex: 1;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

/* ── Contacts ── */
.contacts {
  padding: 80px 0 120px;
}

.contacts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.contacts__card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  padding: 36px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color var(--transition);
}

.contacts__card:hover {
  border-color: #333;
}

.contacts__icon {
  font-size: 24px;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.contacts__label {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-muted);
}

.contacts__link {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 18px;
  color: var(--color-text);
  transition: color var(--transition);
  cursor: pointer;
  word-break: break-all;
}
.contacts__link:hover { color: var(--color-accent); }
.contacts__link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.contacts__text {
  font-size: 16px;
  color: var(--color-text);
}

.contacts__note {
  font-size: 13px;
  color: var(--color-muted);
  margin-top: 4px;
}

/* ── Footer ── */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer__copy {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 6px;
}

.footer__motto {
  font-family: var(--font-heading);
  font-weight: 300;
  font-size: 12px;
  color: #555;
  letter-spacing: 1px;
  font-style: italic;
}

/* ── Reveal Animation ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__crown { animation: none; }
  .hero__scroll-line { animation: none; }
  .hero__cta,
  .project-card__inner,
  .nav__logo,
  .nav__link,
  .contacts__link { transition: none; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero__text { align-items: center; }
  .hero__subtitle { max-width: 100%; }
  .hero__tags { justify-content: center; }
  .hero__cta { align-self: center; }
  .hero__avatar { max-width: 260px; }

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

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

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

  .nav__list {
    gap: 16px;
  }
  .nav__link {
    font-size: 11px;
    letter-spacing: 1px;
  }

  .timeline__card {
    padding: 20px 24px;
  }

  .section-title {
    margin-bottom: 32px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 12px 16px;
  }
  .nav__list {
    gap: 10px;
  }
  .nav__link {
    font-size: 10px;
  }
  .nav__logo {
    font-size: 18px;
  }

  .hero {
    padding: 80px 16px 40px;
  }
  .hero__avatar { max-width: 200px; }
  .hero__frame { padding: 6px; }
  .hero__crown { top: -20px; font-size: 28px; }

  .about,
  .experience,
  .projects,
  .contacts {
    padding: 60px 0;
  }
  .container {
    padding: 0 16px;
  }

  .hero__cta {
    padding: 12px 28px;
    font-size: 12px;
  }
}
