:root {
  --wine: #26060d;
  --wine-deep: #140306;
  --wine-soft: #4a1018;
  --red-glow: #ff6b75;
  --rose: #ffd2d7;
  --cream: #fff6ee;
  --muted: rgba(255, 235, 231, 0.68);
  --ink: #1e0508;
  --nav-bg: rgba(255, 244, 238, 0.9);
  --nav-text: #26060d;
  --section-pad: clamp(88px, 12vw, 150px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(143, 31, 45, 0.38), transparent 34%),
    linear-gradient(135deg, var(--wine-deep), var(--wine) 48%, #3a0911);
  color: var(--cream);
  font-family: "Inter", system-ui, sans-serif;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 210px;
  height: 210px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 117, 126, 0.34), rgba(255, 117, 126, 0.16) 40%, transparent 72%);
  mix-blend-mode: screen;
  filter: blur(2px) saturate(1.35);
  transition: opacity 200ms ease, background 260ms ease, filter 260ms ease, mix-blend-mode 260ms ease;
}

body.theme-light .cursor-glow {
  background: radial-gradient(circle, rgba(255, 96, 108, 0.38), rgba(255, 96, 108, 0.18) 42%, transparent 72%);
  filter: blur(2px) saturate(1.45);
  mix-blend-mode: normal;
}

body.theme-dark .cursor-glow {
  background: radial-gradient(circle, rgba(255, 117, 126, 0.34), rgba(255, 117, 126, 0.16) 40%, transparent 72%);
  filter: blur(2px) saturate(1.35);
  mix-blend-mode: screen;
}

.site-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 18px;
  z-index: 20;
  padding: 0 clamp(16px, 4vw, 56px);
}

.navbar {
  display: flex;
  align-items: center;
  gap: clamp(24px, 7vw, 120px);
  min-height: 64px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: var(--nav-bg);
  color: var(--nav-text);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
  transition: background 260ms ease, color 260ms ease, border-color 260ms ease;
}

.site-header.is-dark .navbar {
  --nav-bg: rgba(255, 244, 238, 0.9);
  --nav-text: #26060d;
}

.site-header.is-light .navbar {
  --nav-bg: rgba(36, 5, 10, 0.86);
  --nav-text: #fff6ee;
  border-color: rgba(255, 255, 255, 0.08);
}

.brand {
  flex: 0 0 auto;
  font-weight: 800;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  gap: clamp(12px, 2.6vw, 34px);
  font-size: 0.92rem;
  font-weight: 700;
}

.nav-links a {
  position: relative;
  white-space: nowrap;
  opacity: 0.78;
  transition: opacity 180ms ease;
}

.nav-links a::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 2px;
  background: currentColor;
  content: "";
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 180ms ease, transform 180ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
}

.nav-links a.active::after,
.nav-links a:hover::after {
  opacity: 0.8;
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 21px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
}

.section {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: var(--section-pad) clamp(20px, 6vw, 88px);
  scroll-margin-top: 96px;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(470px, 0.98fr) minmax(360px, 0.78fr);
  align-items: center;
  gap: clamp(22px, 4vw, 58px);
  padding-top: 132px;
}

.content-section,
.project-section,
.achievement-section {
  background:
    radial-gradient(circle at 82% 18%, rgba(146, 19, 35, 0.2), transparent 34%),
    radial-gradient(circle at 12% 82%, rgba(92, 9, 21, 0.12), transparent 32%),
    linear-gradient(180deg, #f4d3ce 0%, #e9bbb4 52%, #e1aaa4 100%);
  color: var(--ink);
}

.skill-section,
.experience-section,
.contact-section {
  background:
    radial-gradient(circle at 72% 30%, rgba(255, 97, 108, 0.14), transparent 31%),
    linear-gradient(160deg, #1a0307, #350811 60%, #190407);
}

.section-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.section-kicker {
  margin: 0 0 18px;
  color: var(--red-glow);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  max-width: 830px;
  margin: 0 0 30px;
  font-size: clamp(2.1rem, 5vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.lead-copy {
  max-width: 860px;
  margin: 0;
  color: rgba(30, 5, 8, 0.74);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.8;
}

.hero-content {
  font-family: "JetBrains Mono", Consolas, monospace;
  min-width: 0;
}

.code-line {
  margin: 0;
  font-size: clamp(1.95rem, 5.1vw, 5.1rem);
  font-weight: 700;
  line-height: 1.18;
  color: #ffe8e1;
  text-shadow: 0 14px 48px rgba(255, 82, 94, 0.16);
  white-space: nowrap;
}

.role-line {
  color: #ff939b;
  font-size: clamp(1.8rem, 4.35vw, 4.45rem);
  min-height: 1.2em;
}

.type-cursor {
  display: inline-block;
  margin-left: 4px;
  color: #fff6ee;
  animation: blink 780ms steps(2, start) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.resume-button,
.project-link,
.close-button,
.certificate-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: #fff1eb;
  color: #2a060c;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.resume-button {
  margin-top: 34px;
  font-family: "Inter", system-ui, sans-serif;
}

.resume-button:hover,
.project-link:hover,
.close-button:hover,
.certificate-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(87, 4, 14, 0.24);
}

.hero-photo-wrap {
  align-self: center;
  justify-self: end;
  width: min(560px, 100%);
}

.photo-ring {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.hero-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}

.hero-photo.missing-photo {
  object-fit: contain;
}

.skills-list,
.timeline {
  display: grid;
  gap: 8px;
  margin-top: 40px;
}

.skill-item,
.timeline-item {
  display: grid;
  grid-template-columns: minmax(180px, 0.44fr) minmax(0, 1fr);
  gap: clamp(18px, 5vw, 72px);
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 246, 238, 0.46);
  transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.skill-item.is-active,
.timeline-item.is-active {
  color: rgba(255, 246, 238, 0.98);
  transform: translateX(8px);
}

.skill-name,
.timeline-date {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 800;
}

.timeline-date {
  display: block;
  padding-right: clamp(34px, 4vw, 62px);
  text-align: right;
}

.skill-desc,
.timeline-desc {
  margin: 0;
  font-size: clamp(1rem, 1.7vw, 1.22rem);
  line-height: 1.7;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 18px;
  margin-top: 42px;
}

.project-card {
  min-height: 215px;
  padding: 24px;
  border: 1px solid rgba(65, 8, 15, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 20px 50px rgba(73, 11, 18, 0.08);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.project-card:hover {
  transform: translateY(-7px);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 28px 70px rgba(73, 11, 18, 0.16);
}

.project-card h3 {
  margin: 0 0 18px;
  font-size: 1.34rem;
}

.project-card p {
  margin: 0;
  color: rgba(30, 5, 8, 0.68);
  line-height: 1.65;
}

.timeline {
  position: relative;
  --timeline-axis: clamp(270px, 30vw, 370px);
}

.timeline::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: var(--timeline-axis);
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
  content: "";
}

.timeline-item {
  position: relative;
  grid-template-columns: var(--timeline-axis) minmax(0, 1fr);
  gap: clamp(38px, 6vw, 92px);
}

.timeline-item::before {
  position: absolute;
  top: 34px;
  left: calc(var(--timeline-axis) - 6px);
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.achievement-list {
  display: grid;
  gap: 12px;
  margin-top: 40px;
}

.achievement-item {
  border: 1px solid rgba(65, 8, 15, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  overflow: hidden;
}

.achievement-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 20px 22px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.achievement-button strong {
  font-size: clamp(1.05rem, 2vw, 1.42rem);
}

.achievement-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #330811;
  color: #fff6ee;
  font-size: 1.4rem;
  line-height: 1;
}

.achievement-panel {
  max-height: 0;
  padding: 0 22px;
  overflow: hidden;
  transition: max-height 260ms ease, padding 260ms ease;
}

.achievement-item.is-open .achievement-panel {
  max-height: 280px;
  padding: 0 22px 22px;
}

.achievement-panel p {
  max-width: 760px;
  margin: 0 0 18px;
  color: rgba(30, 5, 8, 0.7);
  line-height: 1.65;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 40px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease;
}

.contact-link:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.12);
}

.contact-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 246, 238, 0.12);
  font-weight: 900;
}

.fixed-footer {
  position: fixed;
  left: 14px;
  bottom: 76px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: rgba(255, 246, 238, 0.34);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: none;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.18);
  transition: color 260ms ease, text-shadow 260ms ease;
}

.copyright-mark {
  display: inline-block;
  transform: rotate(90deg);
  transform-origin: center;
}

body.theme-light .fixed-footer {
  color: rgba(55, 6, 15, 0.82);
  text-shadow: 0 1px 18px rgba(255, 246, 238, 0.48);
}

body.theme-dark .fixed-footer {
  color: rgba(255, 246, 238, 0.34);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.18);
}

.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 19;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 246, 238, 0.9);
  color: #2b050b;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(13, 1, 4, 0.72);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.project-modal {
  width: min(940px, 100%);
  max-height: min(760px, 88vh);
  overflow: auto;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: linear-gradient(145deg, #fff8f1, #ffd9d8);
  color: var(--ink);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.44);
}

.modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 24px;
  align-items: center;
  margin-bottom: 26px;
}

.modal-head.no-image {
  grid-template-columns: 1fr;
  text-align: center;
}

.modal-head.no-image .modal-copy {
  justify-self: center;
}

.modal-head.no-image .modal-image-wrap {
  display: none;
}

.project-modal h3 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1.02;
}

.project-modal p {
  margin: 0;
  color: rgba(30, 5, 8, 0.72);
  font-size: 1.05rem;
  line-height: 1.75;
}

.modal-image-wrap {
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(57, 8, 14, 0.09);
}

.modal-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

.close-button {
  background: #330811;
  color: #fff6ee;
}

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.slide-up {
  transform: translateY(54px);
}

@media (max-width: 900px) {
  .site-header {
    top: 12px;
    padding: 0 12px;
  }

  .navbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 4px;
  }

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

  .nav-links a {
    padding: 12px 4px;
  }

  .nav-links a::after {
    display: none;
  }

  .hero-section {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 132px;
  }

  .hero-photo-wrap {
    justify-self: start;
    width: min(360px, 100%);
  }

  .skill-item,
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
    transform: none;
  }

  .skill-item.is-active,
  .timeline-item.is-active {
    transform: none;
  }

  .timeline::before,
  .timeline-item::before {
    display: none;
  }

  .modal-head {
    grid-template-columns: 1fr;
  }

  .modal-image-wrap {
    max-width: 340px;
  }
}

@media (max-width: 560px) {
  .section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .code-line {
    font-size: clamp(1.18rem, 6.4vw, 2.05rem);
  }

  .role-line {
    font-size: clamp(1.1rem, 5.7vw, 1.85rem);
  }

  .modal-actions {
    flex-direction: column;
  }

  .resume-button,
  .project-link,
  .close-button,
  .certificate-link {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
