:root {
  --paper: #f8f7f4;
  --ink: #151515;
  --muted: #6d6a66;
  --line: #d8d4cd;
  --soft: #ece8df;
  --red: #ef3d35;
  --yellow: #e4b12f;
  --shadow: 0 24px 70px rgba(17, 17, 17, 0.12);
}

body.dark-mode {
  --paper: #10100f;
  --ink: #f5f1e8;
  --muted: #bab2a7;
  --line: #393732;
  --soft: #1b1a18;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, Arial, sans-serif;
  letter-spacing: 0;
}

body,
.site-header,
.project-card,
.skill-grid article,
.button,
.hello,
.theme-toggle,
.hero-bottom p,
.mini-logos span,
.certs span {
  transition: background 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

body.nav-open {
  overflow: hidden;
}

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

button {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 64px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(18px);
}

.logo {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 0.78;
  font-weight: 900;
}

.logo::before {
  content: "";
  position: absolute;
  left: 3px;
  top: -13px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--yellow);
  border-radius: 50%;
}

.logo-dot {
  color: var(--red);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 52px);
  color: var(--ink);
  font-size: 0.82rem;
}

.site-nav a:not(.hello) {
  position: relative;
}

.site-nav a:not(.hello)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hello {
  display: inline-flex;
  align-items: center;
  min-height: 45px;
  padding: 0 18px;
  border-radius: 4px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.14);
}

.theme-toggle {
  position: relative;
  width: 58px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d7d7d7;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
  cursor: pointer;
}

.theme-toggle span {
  position: absolute;
  left: 31px;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

body.dark-mode .theme-toggle {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

body.dark-mode .theme-toggle span {
  transform: translateX(-28px);
  background: #1f1b1c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: transparent;
}

.nav-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
}

.hero {
  position: relative;
  min-height: 100svh;
  padding: 68px clamp(20px, 6vw, 78px) 18px;
  display: grid;
  align-content: start;
  overflow: hidden;
  scroll-snap-align: start;
}

.intro-line {
  position: relative;
  z-index: 6;
  margin: 0 auto 6px;
  color: var(--ink);
  font-size: clamp(0.92rem, 1.45vw, 1.12rem);
  text-align: center;
}

.intro-line::before {
  content: "👋";
  margin-right: 6px;
}

.hero-title-wrap {
  position: relative;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding-bottom: clamp(292px, 29vw, 350px);
  text-align: center;
  transform: translateY(26px);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
.outline-title,
.section h2,
.contact h2 {
  font-family: "Archivo Black", Impact, "Arial Black", sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
}

h1 {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: clamp(3.55rem, 10.4vw, 9.35rem);
  line-height: 0.84;
  white-space: nowrap;
}

.outline-title {
  position: relative;
  z-index: 2;
  margin: -0.02em 0 0;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  font-size: clamp(2.95rem, 8.15vw, 7.25rem);
  line-height: 0.86;
  white-space: nowrap;
}

.portrait {
  position: absolute;
  left: 50%;
  top: clamp(76px, 9vw, 112px);
  z-index: 5;
  width: clamp(230px, 25.5vw, 348px);
  height: auto;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 0;
  transform: translateX(-50%);
  pointer-events: none;
  filter: grayscale(1) contrast(1.06);
}

.hero-bottom {
  position: relative;
  z-index: 7;
  width: min(1120px, 100%);
  margin: -24px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.hero-bottom p {
  margin: 0;
  padding: 4px 8px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  backdrop-filter: blur(6px);
  font-size: clamp(0.95rem, 1.45vw, 1.12rem);
}

.mini-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  max-width: 500px;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 0.8rem;
  font-style: italic;
}

.mini-logos span {
  padding: 3px 5px;
  background: color-mix(in srgb, var(--paper) 62%, transparent);
}

.hero-actions {
  position: relative;
  z-index: 7;
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 0;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-size: 0.86rem;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.button.dark {
  color: var(--paper);
  background: var(--ink);
}

.button.light {
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  backdrop-filter: blur(8px);
}

.section {
  min-height: 100svh;
  padding: clamp(68px, 9vw, 118px) clamp(20px, 6vw, 78px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 0;
  scroll-snap-align: start;
}

.section-label {
  width: min(1120px, 100%);
  margin: 0 auto 30px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.section-head,
.skill-hero {
  width: min(1120px, 100%);
  margin: 0 auto clamp(36px, 6vw, 68px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.5fr);
  gap: clamp(24px, 6vw, 72px);
  align-items: end;
}

.section h2,
.contact h2 {
  margin: 0;
  font-size: clamp(2.35rem, 5.6vw, 5.4rem);
  line-height: 0.92;
}

.section-head p,
.skill-hero p,
.about-copy p {
  color: var(--muted);
  line-height: 1.75;
}

.about {
  display: grid;
  align-content: center;
}

.about-page-grid {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.85fr);
  gap: clamp(28px, 6vw, 76px);
  align-items: start;
}

.about-copy {
  margin: 0;
}

.about-copy h2 {
  max-width: 650px;
  margin-bottom: 22px;
}

.info-list {
  display: grid;
  margin-top: 30px;
  border-top: 1px solid var(--line);
}

.info-list div {
  display: grid;
  gap: 6px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.info-list span {
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.info-list strong {
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.25;
}

.education-panel h3 {
  margin: 0 0 18px;
  font-family: "Archivo Black", Impact, "Arial Black", sans-serif;
  font-size: clamp(1.8rem, 3.4vw, 3.4rem);
  line-height: 0.95;
}

.project-list {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.project-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 0.75fr) minmax(280px, 0.75fr) minmax(180px, 0.45fr);
  gap: 22px;
  align-items: center;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 72%, white 28%);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.project-card:hover {
  transform: translateX(8px);
  border-color: var(--ink);
  background: color-mix(in srgb, var(--paper) 82%, white 18%);
}

.project-card span {
  color: var(--red);
  font-weight: 900;
}

.project-card h3 {
  margin: 0;
  font-size: clamp(1.18rem, 1.8vw, 1.9rem);
  line-height: 1.05;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.project-meta b,
.project-meta small {
  display: block;
}

.project-meta b {
  margin-bottom: 8px;
  font-size: 0.94rem;
}

.project-meta small {
  color: var(--muted);
  line-height: 1.45;
}

.skills {
  background: var(--soft);
}

.skill-grid {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.skill-grid article {
  min-height: 205px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--paper);
}

.skill-grid span {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.skill-grid strong {
  font-size: clamp(1.05rem, 1.55vw, 1.45rem);
  line-height: 1.12;
}

.timeline {
  width: 100%;
  margin: 0;
  display: grid;
  border-top: 1px solid var(--line);
}

.timeline article {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

time {
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 900;
}

.timeline h3 {
  margin: 0;
  line-height: 1.08;
}

.timeline h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.15;
}

.timeline p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.certs {
  width: 100%;
  margin: 20px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.certs span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.78rem;
  font-weight: 700;
}

.contact {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 88px clamp(20px, 6vw, 78px);
  border-top: 1px solid var(--line);
  scroll-snap-align: start;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
}

.contact-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.54fr);
  gap: clamp(36px, 8vw, 110px);
  align-items: center;
}

.contact-kicker,
.contact-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contact-copy h2 {
  width: min(820px, 100%);
  margin: 8px 0 22px;
  font-family: "Archivo Black", Impact, "Arial Black", sans-serif;
  font-size: clamp(3.2rem, 7.4vw, 7.8rem);
  line-height: 0.86;
  text-transform: uppercase;
}

.contact-copy p {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.32rem);
  line-height: 1.55;
}

.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.social-icons a {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 88%, var(--ink) 12%);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.social-icons a:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
}

.social-icons svg {
  width: 23px;
  height: 23px;
  fill: var(--ink);
}

.contact-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper) 86%, var(--ink) 14%);
  box-shadow: var(--shadow);
}

.contact-card div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper) 92%, var(--ink) 8%);
}

.contact-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.35;
}

.contact-send {
  width: 100%;
  min-height: 54px;
  font-size: 0.96rem;
}

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

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

@media (min-width: 981px) {
  .hero {
    padding-top: 70px;
  }

  .hero-title-wrap {
    padding-bottom: clamp(260px, 25vw, 318px);
  }

  h1 {
    font-size: clamp(5.8rem, 9.2vw, 10.1rem);
  }

  .outline-title {
    font-size: clamp(4.7rem, 7.3vw, 8rem);
  }

  .portrait {
    top: clamp(62px, 6.8vw, 92px);
    width: clamp(300px, 20vw, 372px);
  }

  .hero-bottom {
    margin-top: -14px;
  }
}

@media (max-width: 980px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    left: 14px;
    right: 14px;
    top: 76px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  body.nav-open .site-nav {
    display: flex;
  }

  .site-nav a,
  .theme-toggle {
    padding: 14px 10px;
  }

  .theme-toggle {
    align-self: center;
    padding: 0;
  }

  .hello {
    justify-content: center;
    margin-top: 8px;
  }

  h1,
  .outline-title {
    white-space: normal;
  }

  .hero-bottom,
  .section-head,
  .skill-hero,
  .contact-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .about-page-grid {
    grid-template-columns: 1fr;
  }

  .hero-bottom {
    justify-items: center;
    text-align: center;
  }

  .mini-logos {
    justify-content: center;
  }

  .project-card {
    grid-template-columns: 48px 1fr;
  }

  .project-card p,
  .project-meta {
    grid-column: 2;
  }

  .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline article {
    grid-template-columns: 130px 1fr;
  }

  .timeline p {
    grid-column: 2;
  }
}

@media (max-width: 620px) {
  .site-header {
    height: 58px;
    padding: 0 16px;
  }

  .hero {
    padding-top: 68px;
    min-height: 100svh;
  }

  .intro-line {
    font-size: 0.9rem;
  }

  h1 {
    font-size: clamp(2.7rem, 13.5vw, 3.85rem);
  }

  .outline-title {
    font-size: clamp(2rem, 10.2vw, 2.95rem);
  }

  .portrait {
    top: 92px;
    width: clamp(190px, 52vw, 250px);
    opacity: 0.95;
  }

  .hero-title-wrap {
    padding-bottom: 280px;
  }

  .hero-bottom {
    margin-top: -10px;
  }

  .hero-actions {
    margin-top: 4px;
    gap: 8px;
  }

  .mini-logos {
    gap: 8px;
    font-size: 0.72rem;
  }

  .hero-actions,
  .contact {
    padding: 82px 18px 42px;
  }

  .contact-copy h2 {
    font-size: clamp(2.8rem, 15vw, 4.8rem);
  }

  .contact-copy p {
    font-size: 0.98rem;
  }

  .social-icons a {
    width: 52px;
    height: 52px;
  }

  .contact-card {
    padding: 14px;
  }

  .contact-card div {
    padding: 14px;
  }

  .button {
    width: 100%;
  }

  .section h2,
  .contact h2 {
    font-size: clamp(2.1rem, 10.5vw, 3.35rem);
  }

  .project-card,
  .timeline article {
    grid-template-columns: 1fr;
  }

  .project-card p,
  .project-meta,
  .timeline p {
    grid-column: auto;
  }

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