:root {
  --bg: #0c0f14;
  --panel: #1b2330;
  --panel-2: #243044;
  --line: #334155;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --faint: #94a3b8;
  --accent: #5ee9c5;
  --accent-dim: rgba(94, 233, 197, 0.16);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(94, 233, 197, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: #a7f3e0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 15, 20, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.mark {
  color: var(--text);
  text-decoration: none;
  font-family: Syne, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}

.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  margin-left: auto;
}

.top nav a {
  color: var(--faint);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

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

main {
  width: min(860px, calc(100% - 2.4rem));
  margin: 0 auto;
  padding: 3rem 0 4.5rem;
}

.hero {
  display: grid;
  grid-template-columns: 11.5rem 1fr;
  gap: 2rem;
  align-items: center;
  padding: 0.4rem 0 0.8rem;
}

.photo {
  width: 11.5rem;
  height: 14.5rem;
  object-fit: cover;
  object-position: 50% 12%;
  border-radius: 1.25rem;
  border: 3px solid #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 0 6px var(--accent-dim);
  animation: pop-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-copy {
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.hero-actions {
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.role {
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn:hover {
  transform: scale(1.08);
}

.btn:active {
  transform: scale(1.03);
}

.btn-solid {
  background: var(--accent);
  color: #04251c;
}

.btn-solid:hover {
  background: #a7f3e0;
  color: #04251c;
}

.btn-ghost {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--panel-2);
  color: var(--text);
}

.block {
  margin-top: 4.2rem;
  scroll-margin-top: 5rem;
}

.block h2 {
  margin: 0 0 1.6rem;
  font-family: Syne, sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.project-group {
  margin-bottom: 1.8rem;
}

.project-group > h3 {
  margin: 0 0 0.85rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.skills-section {
  text-align: center;
  max-width: 53rem;
  margin-left: auto;
  margin-right: auto;
}

.skill-groups {
  display: grid;
  gap: 1.8rem;
}

.skill-group h3 {
  margin: 0 0 0.9rem;
  font-family: Syne, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--text);
}

.skill-group .skills {
  margin: 0;
  justify-content: center;
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 1.15rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: var(--line);
}

.tl-item {
  position: relative;
  padding-left: 4rem;
}

.tl-icon {
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #04251c;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px var(--bg);
}

.tl-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.tl-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1.2rem 1.35rem 1.3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.tl-card h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.tl-org {
  margin: 0.15rem 0 0.65rem;
  color: var(--accent);
  font-weight: 500;
}

.tl-card p:last-child {
  margin: 0;
  color: var(--muted);
}

.tl-item time {
  display: block;
  margin-top: 0.55rem;
  color: var(--faint);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
}

.projects {
  display: grid;
  gap: 1rem;
}

.project-org {
  margin: 0 0 0.35rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.project {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.3rem 1.4rem 1.2rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project:hover,
a.project:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--accent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  color: inherit;
}

.project h3 {
  margin: 0;
  font-family: Syne, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.project p {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.project ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.project li {
  background: #04251c;
  color: var(--accent);
  border: 1px solid rgba(94, 233, 197, 0.35);
  padding: 0.28rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills li {
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 0.8rem;
  padding: 0.75rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  cursor: default;
  opacity: 0;
  transform: translateY(64px);
  animation: skill-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-play-state: paused;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.skill-group.in-view li {
  animation-play-state: running;
}

.skills li:hover {
  transform: scale(1.08);
  border-color: #5ee9c5;
  color: #0f766e;
  box-shadow: 0 12px 24px rgba(94, 233, 197, 0.18);
}

.skill-group.in-view li {
  animation-play-state: running;
}

.skill-group li:nth-child(1) { animation-delay: 0.04s; }
.skill-group li:nth-child(2) { animation-delay: 0.08s; }
.skill-group li:nth-child(3) { animation-delay: 0.12s; }
.skill-group li:nth-child(4) { animation-delay: 0.16s; }
.skill-group li:nth-child(5) { animation-delay: 0.2s; }
.skill-group li:nth-child(6) { animation-delay: 0.24s; }
.skill-group li:nth-child(7) { animation-delay: 0.28s; }

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

.tl-item.in-view .tl-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes skill-in {
  to {
    opacity: 1;
    transform: none;
  }
}

.contact {
  text-align: center;
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
}

.contact p {
  margin: 0 0 1.4rem;
  color: var(--muted);
}

.contact a {
  color: var(--accent);
}

.contact form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: left;
}

.contact input,
.contact textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #f1f5f9;
  color: #0f172a;
  font: inherit;
  padding: 0 1.05rem;
}

.contact input {
  height: 3.5rem;
}

.contact textarea {
  min-height: 12.5rem;
  padding: 1rem 1.05rem;
  resize: vertical;
}

.contact input:focus,
.contact textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.send {
  align-self: center;
  margin-top: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 1rem 2rem;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
  background: linear-gradient(90deg, #14b8a6, #06b6d4);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.send:hover {
  transform: scale(1.12);
}

.send:active {
  transform: scale(0.96);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mail {
  display: none;
}

footer {
  width: min(860px, calc(100% - 2.4rem));
  margin: 0 auto;
  padding: 0 0 2.4rem;
  color: var(--faint);
  font-size: 0.88rem;
}

footer p {
  margin: 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 760px) {
  .timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }

  .tl-item {
    width: 50%;
    padding-left: 0;
    padding-right: 2.4rem;
  }

  .tl-item:nth-child(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: 2.4rem;
  }

  .tl-icon {
    left: auto;
    right: -1.2rem;
  }

  .tl-item:nth-child(even) .tl-icon {
    right: auto;
    left: -1.2rem;
  }

  .tl-item time {
    position: absolute;
    top: 1.2rem;
    right: -11.2rem;
    width: 8.6rem;
    margin: 0;
  }

  .tl-item:nth-child(even) time {
    right: auto;
    left: -11.2rem;
    text-align: right;
  }
}

@media (max-width: 640px) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .photo {
    width: 9.5rem;
    height: 12rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .photo,
  .hero-copy,
  .hero-actions,
  .skills li,
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .project,
  .tl-card,
  .skills li,
  .send {
    transition: none;
  }

  .skills li:hover,
  .send:hover {
    transform: none;
  }
}
