/* Ilia Tivin — CV Website — Edgy, Clean, Cyber */

:root {
  --bg: #08080c;
  --bg-elevated: #0e0e14;
  --bg-card: #12121a;
  --text: #e8e8ef;
  --text-muted: #8a8a9a;
  --accent: #00d4aa;
  --accent-dim: rgba(0, 212, 170, 0.15);
  --accent-glow: rgba(0, 212, 170, 0.4);
  --border: #1e1e2a;
  --danger: #ff4757;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  --max-width: 720px;
  --radius: 4px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  font-weight: 400;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle noise texture overlay */
.noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(8, 8, 12, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

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

.nav-logo:hover {
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

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

.nav-links a {
  transition: color 0.2s;
}

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

/* Nav toggle (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.nav-toggle:hover {
  border-color: var(--accent);
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-muted);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Monospace utility */
.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: 0.02em;
}

/* Main content */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem 4rem;
  padding-top: 96px;
}

/* Hero */
.hero {
  padding: 4rem 0 5rem;
  border-bottom: 1px solid var(--border);
}

.hero-label {
  margin-bottom: 1rem;
}

.hero-label .mono {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: lowercase;
}

.hero-title {
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero-title .line {
  display: block;
}

.hero-title .accent {
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow);
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.hero-location {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-summary {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 540px;
}

.hero-summary .motto {
  color: var(--accent);
  font-style: italic;
}

/* Sections */
.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 2.5rem 0;
}

.section-title .mono {
  color: var(--accent);
  margin-right: 0.5rem;
}

/* Timeline */
.timeline {
  position: relative;
  padding: 0 1rem;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--border);
  border-radius: 1px;
  z-index: 0;
}

.timeline-line-progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: var(--timeline-progress, 0%);
  background: var(--accent);
  border-radius: 1px;
  opacity: 0.5;
  transition: height 0.2s ease-out;
}

.timeline-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  gap: 0;
  margin-bottom: 2.5rem;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item.reveal {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item:hover {
  cursor: default;
}

.timeline-item--right .timeline-content {
  grid-column: 1;
  text-align: left;
  padding-right: 2rem;
}

.timeline-item--right .timeline-node {
  grid-column: 2;
}

.timeline-item--right .timeline-spacer {
  grid-column: 3;
}

.timeline-item--left .timeline-spacer {
  grid-column: 1;
}

.timeline-item--left .timeline-node {
  grid-column: 2;
}

.timeline-item--left .timeline-content {
  grid-column: 3;
  padding-left: 2rem;
}

.timeline-node {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.5rem;
}

.timeline-spacer {
  min-width: 0;
}

.timeline-item:hover .timeline-marker {
  transform: rotate(45deg) scale(1.2);
  box-shadow: 0 0 20px var(--accent-glow);
}

.timeline-item.is-active .timeline-marker {
  transform: rotate(45deg) scale(1.15);
  box-shadow: 0 0 18px var(--accent-glow);
}

.timeline-item.is-active .timeline-content {
  box-shadow: inset 0 0 0 2px var(--accent-dim);
  border-radius: var(--radius);
}

.timeline-item--right.is-active .timeline-content {
  margin-right: -0.25rem;
  padding-right: 2.25rem;
}

.timeline-item--left.is-active .timeline-content {
  margin-left: -0.25rem;
  padding-left: 2.25rem;
}

.timeline-marker {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  background: var(--accent);
  border-radius: 2px;
  transform: rotate(45deg);
  box-shadow: 0 0 12px var(--accent-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-content {
  min-width: 0;
}

.timeline-header {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  position: relative;
  color: var(--text);
}

.timeline-header .timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
  display: block;
}

.timeline-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.timeline-header .timeline-company {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.timeline-detail {
  margin-top: 0.75rem;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

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

.timeline-company {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.timeline-content ul {
  margin-top: 0;
  padding-left: 1.25rem;
}

.timeline-item--right .timeline-content ul {
  padding-left: 1.25rem;
  padding-right: 0;
  list-style-position: outside;
}

.timeline-item--right .timeline-content li {
  text-align: left;
}

.timeline-content li {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  line-height: 1.55;
}

/* Skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s ease;
  text-align: left;
}

.skill-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-dim);
}

.skill-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.skill-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.skill-card li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
  text-align: left;
}

.skill-card li:last-child {
  border-bottom: none;
}

.certifications-list a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  display: inline-block;
}

.certifications-list a:hover {
  color: var(--accent);
}

.skill-card--full {
  grid-column: 1 / -1;
}

/* Websites card */
.websites-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2rem;
  text-align: left;
}

.websites-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.websites-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.websites-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.websites-list li:last-child {
  border-bottom: none;
}

.websites-list a {
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.websites-list a:hover {
  color: var(--accent);
}

.websites-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Education */
.education-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.edu-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 2rem;
  align-items: start;
  text-align: left;
}

.edu-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.edu-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.edu-school {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Contact */
.contact-section {
  padding-bottom: 3rem;
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
}

.contact-link-wrapper {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.contact-link-wrapper .contact-link {
  border-radius: var(--radius) 0 0 var(--radius);
  justify-content: flex-start;
  padding-left: 1.25rem;
  text-align: left;
}

.contact-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-height: 48px;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.contact-copy:hover {
  color: var(--accent);
  background: var(--bg-elevated);
}

.contact-copy.copied {
  color: var(--accent);
  border-color: var(--accent);
}

.contact-copy-icon {
  font-size: 1.1rem;
  font-family: var(--font-mono);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  min-height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
  text-align: left;
}

.contact-link.copied {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 20px var(--accent-dim);
}

.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 20px var(--accent-dim);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
}

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

/* Responsive — tablet */
@media (max-width: 768px) {
  .nav {
    padding: 0 1.25rem;
  }

  .nav-links {
    gap: 1.5rem;
  }

  main {
    padding: 0 1.5rem 3rem;
    padding-top: 88px;
  }

  .hero {
    padding: 3rem 0 4rem;
  }

  .section {
    padding: 3rem 0;
  }

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

  .education-list {
    gap: 1.5rem;
  }

  .edu-item {
    gap: 1.5rem;
  }

  /* Timeline: stack on one side on tablet */
  .timeline {
    padding: 0;
  }

  .timeline-line {
    left: 11px;
    margin-left: 0;
  }

  .timeline-item {
    grid-template-columns: 24px 1fr;
    grid-template-rows: auto;
    gap: 1rem;
    align-items: start;
  }

  .timeline-item--right .timeline-content,
  .timeline-item--left .timeline-content {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
    padding: 0 0 0 1rem;
  }

  .timeline-item--right .timeline-content ul,
  .timeline-item--left .timeline-content ul {
    padding-left: 1.25rem;
    padding-right: 0;
    list-style-position: outside;
    text-align: left;
  }

  .timeline-item--right .timeline-chevron,
  .timeline-item--left .timeline-chevron {
    right: 0;
    left: auto;
  }

  .timeline-item--right .timeline-node,
  .timeline-item--left .timeline-node {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  .timeline-item--right .timeline-spacer,
  .timeline-item--left .timeline-spacer {
    display: none;
  }

  .timeline-item--right.is-active .timeline-content,
  .timeline-item--left.is-active .timeline-content {
    margin: 0;
    padding-left: 1.25rem;
  }
}

/* Responsive — mobile */
@media (max-width: 640px) {
  .nav {
    height: 56px;
    padding: 0 1rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    background: rgba(8, 8, 12, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: none;
    z-index: 99;
  }

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

  .nav-links a {
    padding: 1rem 1.25rem;
    font-size: 1rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  main {
    padding: 0 1.25rem 3rem;
    padding-top: 72px;
  }

  body {
    font-size: 16px;
  }

  .hero {
    padding: 2rem 0 2.5rem;
  }

  .hero-title {
    font-size: clamp(2.25rem, 12vw, 2.75rem);
  }

  .hero-summary {
    font-size: 1rem;
  }

  .section {
    padding: 2rem 0;
  }

  .section-title {
    margin-bottom: 1.5rem;
  }

  .timeline-line {
    left: 6px;
    margin-left: -1px;
    width: 2px;
  }

  .timeline-item {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: flex-start;
  }

  .timeline-item--right .timeline-content,
  .timeline-item--left .timeline-content {
    flex: 1;
    min-width: 0;
    order: 2;
    text-align: left;
    padding-left: 1rem;
  }

  .timeline-item--right .timeline-node,
  .timeline-item--left .timeline-node {
    flex-shrink: 0;
    width: 12px;
    order: 1;
  }

  .timeline-node {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 0.5rem;
  }

  .timeline-marker {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
  }

  .timeline-content h3 {
    font-size: 1.05rem;
  }

  .edu-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .contact-grid {
    flex-direction: column;
    gap: 0.75rem;
  }

  .contact-link-wrapper {
    width: 100%;
  }

  .contact-link-wrapper .contact-link {
    flex: 1;
    min-width: 0;
  }

  .contact-link {
    text-align: left;
    justify-content: flex-start;
    padding-left: 1.25rem;
  }

  .footer {
    padding: 1.5rem;
  }
}

/* Responsive — extra small */
@media (max-width: 380px) {
  .hero-title {
    font-size: 2rem;
  }

  .nav-logo {
    font-size: 0.9rem;
  }
}

/* Selection */
::selection {
  background: var(--accent-dim);
  color: var(--accent);
}
