:root {
  --ink: #151b23;
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --muted: #626762;
  --line: #c9c7bf;
  --blue: #315ee7;
  --blue-dark: #2447b9;
  --white: #ffffff;
  --shell: 1240px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.shell {
  width: min(calc(100% - 3rem), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 20;
  padding: .7rem 1rem;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(21, 27, 35, .18);
  background: rgba(244, 241, 234, .92);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  align-items: center;
  gap: 2rem;
  min-height: 5rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: .75rem;
  width: fit-content;
  font-weight: 750;
  text-decoration: none;
}

.brand-tag {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.8rem;
}

.nav a {
  position: relative;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
}

.nav a::after {
  position: absolute;
  right: 0;
  bottom: -.38rem;
  left: 0;
  height: 1px;
  background: var(--ink);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .2s ease;
}

.nav a:hover::after,
.nav a:focus-visible::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .7rem;
}

.language {
  display: grid;
  width: 2.75rem;
  min-height: 2.75rem;
  place-items: center;
  border: 1px solid var(--line);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}

.language:hover,
.language:focus-visible { background: var(--surface); }

.github-button {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  padding: .55rem .9rem;
  color: var(--white);
  background: #24292f;
  border: 1px solid #24292f;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}

.github-button svg { width: 1.15rem; height: 1.15rem; }
.github-button:hover,
.github-button:focus-visible { background: #000; transform: translateY(-1px); }

.hero {
  min-height: calc(100vh - 5rem);
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.hero-layout {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) minmax(190px, .32fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: end;
  padding-block: clamp(5rem, 10vw, 9rem);
}

.hero-index,
.section-number,
.kicker,
.experience-type,
.project-meta {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: .76rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.hero-index { margin: 0 0 .45rem; color: var(--muted); }
.kicker { margin: 0 0 1.5rem; color: var(--blue-dark); font-weight: 700; }

h1,
h2,
h3 { margin-top: 0; line-height: 1.05; }

h1 {
  max-width: 1000px;
  margin-bottom: 2rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.2rem, 7.1vw, 7.2rem);
  font-weight: 500;
  letter-spacing: -.055em;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 5vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -.045em;
}

h3 { margin-bottom: .8rem; font-size: 1.28rem; }
p { margin: 0 0 1rem; }

.hero-intro {
  max-width: 690px;
  color: #494e50;
  font-size: clamp(1.06rem, 1.7vw, 1.32rem);
}

.hero-links,
.project-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-top: 2.3rem;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  min-height: 3.15rem;
  padding: .75rem 1.15rem;
  color: var(--white);
  background: var(--blue);
  border: 1px solid var(--blue);
  font-weight: 700;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}

.primary-link:hover,
.primary-link:focus-visible { background: var(--blue-dark); transform: translateY(-2px); }
.primary-link.dark { background: var(--ink); border-color: var(--ink); }
.primary-link.dark:hover,
.primary-link.dark:focus-visible { background: #000; }

.plain-link {
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: .32rem;
}

.hero-aside {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-content: end;
}

.hero-aside span {
  padding: .35rem .6rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.28);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: .73rem;
}

.section { padding: clamp(5rem, 10vw, 9rem) 0; }
.about { background: var(--surface); }

.split-layout {
  display: grid;
  grid-template-columns: minmax(220px, .52fr) minmax(0, 1fr);
  gap: clamp(3rem, 8vw, 9rem);
}

.section-number { margin: 0 0 1rem; color: var(--blue-dark); font-weight: 700; }
.section-heading { position: sticky; top: 8rem; align-self: start; }
.about-copy { max-width: 820px; }

.large-copy {
  margin-bottom: 2rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  line-height: 1.3;
  letter-spacing: -.025em;
}

.experience-list { margin-top: 4rem; border-top: 1px solid var(--line); }

.experience-list article {
  display: grid;
  grid-template-columns: minmax(160px, .65fr) minmax(200px, .8fr) minmax(0, 1.25fr);
  gap: 1.4rem;
  padding: 1.7rem 0;
  border-bottom: 1px solid var(--line);
}

.experience-type { color: var(--blue-dark); }
.experience-list h3,
.experience-list p { margin-bottom: 0; }
.experience-list p { color: #555b5d; }
.privacy-note { margin-top: 1.3rem; color: var(--muted); font-size: .9rem; }

.projects { color: var(--white); background: var(--ink); }
.projects h2 { color: var(--white); }

.projects-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 3rem;
  margin-bottom: 4rem;
}

.projects-heading > p { max-width: 360px; color: #afb3b4; }
.projects .section-number { color: #88a6ff; }

.project-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}

.project-visual {
  position: relative;
  min-height: 460px;
  padding: clamp(1.25rem, 4vw, 3rem);
  overflow: hidden;
  background: #dfe5ed;
}

.project-visual > img:first-child {
  width: 85%;
  border: 1px solid rgba(21, 27, 35, .16);
  box-shadow: 0 25px 60px rgba(21, 27, 35, .22);
  transform: rotate(-1deg);
}

.project-visual-secondary {
  position: absolute;
  right: 5%;
  bottom: -12%;
  width: 29%;
  border: 1px solid rgba(21, 27, 35, .16);
  box-shadow: 0 18px 45px rgba(21, 27, 35, .28);
  transform: rotate(3deg);
  transition: transform .35s ease;
}

.project-feature:hover .project-visual-secondary { transform: rotate(1deg) translateY(-8px); }
.project-meta { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; color: #aeb4ba; }
.project-copy h3 { margin-bottom: 1.4rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.4rem, 4vw, 4.2rem); font-weight: 500; }
.project-copy > p { color: #c8cccf; }
.project-facts { margin: 1.5rem 0 0; padding-left: 1.15rem; color: #c8cccf; }
.project-facts li + li { margin-top: .55rem; }
.project-copy .plain-link { color: var(--white); }

.contact-strip { border-bottom: 1px solid var(--line); background: var(--blue); color: var(--white); }
.contact-strip-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 9rem; }
.contact-strip p { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.45rem, 3vw, 2.4rem); }
.contact-strip a { font-weight: 750; text-underline-offset: .32rem; }

.site-footer { padding: 1.6rem 0; color: var(--muted); font-size: .86rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1.5rem; }

.contact-page { min-height: calc(100vh - 9rem); display: grid; align-items: center; padding: clamp(5rem, 11vw, 10rem) 0; }
.contact-page-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(430px, 1fr); gap: clamp(3rem, 8vw, 8rem); align-items: start; }
.contact-page h1 { font-size: clamp(3rem, 6.4vw, 6.7rem); }
.contact-details { padding-top: 3rem; }
.contact-details > p { color: #555b5d; font-size: 1.1rem; }
.contact-methods { display: grid; grid-template-columns: 1fr; gap: .8rem; margin: 2rem 0 3rem; }
.contact-method { display: flex; justify-content: space-between; flex-direction: column; gap: 1.4rem; min-height: 7.5rem; padding: 1.2rem; text-decoration: none; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.contact-method span { font-family: ui-monospace, "Cascadia Code", monospace; font-size: .73rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.contact-method strong { font-size: clamp(1rem, 1.45vw, 1.25rem); line-height: 1.3; overflow-wrap: anywhere; }
.contact-method-email { color: var(--blue-dark); border: 1px solid var(--line); background: var(--surface); }
.contact-method-email span { color: var(--muted); }
.contact-method-phone { color: var(--white); border: 1px solid var(--ink); background: var(--ink); }
.contact-method-phone span { color: #bfc3c5; }
.contact-method:hover,
.contact-method:focus-visible { transform: translateY(-3px); }
.contact-method-email:hover,
.contact-method-email:focus-visible { border-color: var(--blue); }
.contact-method-phone:hover,
.contact-method-phone:focus-visible { background: #000; }
.contact-details dl { margin: 0; border-top: 1px solid var(--line); }
.contact-details dl div { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.contact-details dt { color: var(--muted); }
.contact-details dd { margin: 0; font-weight: 600; }

:focus-visible { outline: 3px solid #7b9cff; outline-offset: 3px; }

@media (max-width: 980px) {
  .header-inner { grid-template-columns: 1fr auto; gap: .8rem 1.5rem; padding: .8rem 0; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .hero { min-height: auto; }
  .hero-layout { grid-template-columns: 60px 1fr; }
  .hero-aside { grid-column: 2; }
  .project-feature { grid-template-columns: 1fr; }
  .project-visual { min-height: 400px; }
  .contact-page-layout { grid-template-columns: 1fr; }
  .contact-details { max-width: 720px; padding-top: 0; }
}

@media (max-width: 720px) {
  .shell { width: min(calc(100% - 1.5rem), var(--shell)); }
  .site-header { position: static; }
  .header-inner { grid-template-columns: 1fr auto; }
  .brand { align-items: flex-start; flex-direction: column; gap: 0; }
  .nav { flex-wrap: wrap; gap: .65rem 1rem; overflow: visible; }
  .github-button { padding-inline: .7rem; }
  .github-button svg { margin: 0; }
  .hero-layout { grid-template-columns: 1fr; gap: 1.5rem; padding-block: 4.5rem; }
  .hero-index { display: none; }
  .hero-aside { grid-column: 1; }
  h1 { font-size: clamp(3rem, 14vw, 4.7rem); }
  .split-layout { grid-template-columns: 1fr; }
  .section-heading { position: static; }
  .experience-list article { grid-template-columns: 1fr; gap: .65rem; }
  .projects-heading { align-items: flex-start; flex-direction: column; gap: 1.5rem; }
  .project-visual { min-height: 285px; padding: 1rem; }
  .project-visual > img:first-child { width: 92%; }
  .project-visual-secondary { width: 31%; }
  .contact-strip-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 2rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: .3rem; }
  .contact-details dl div { grid-template-columns: 1fr; gap: .2rem; }
  .contact-method { min-height: 7rem; }
}

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