:root {
  color-scheme: light;
  --page: #f7f7f4;
  --surface: #ffffff;
  --surface-alt: #f1f3f5;
  --ink: #101828;
  --body: #475467;
  --muted: #667085;
  --line: #dfe3e8;
  --line-strong: #cbd1d8;
  --accent: #174ea6;
  --accent-dark: #103d84;
  --contact: #111827;
  --radius: 14px;
  --shadow: 0 12px 30px rgba(16, 24, 40, .07);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 84px; }

body {
  min-height: 100%;
  background: var(--page) !important;
  color: var(--ink) !important;
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
  line-height: 1.5;
}

::selection {
  background: var(--accent) !important;
  color: #fff !important;
}

a,
button,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 78, 166, .32) !important;
  outline-offset: 3px !important;
}

button:disabled {
  cursor: not-allowed !important;
  opacity: .65 !important;
}

.portfolio-shell,
.project-shell {
  color: var(--ink);
}

/* Navigation */
.portfolio-shell > nav,
.project-shell > nav {
  position: sticky !important;
  top: 0 !important;
  width: 100% !important;
  min-height: 72px;
  margin: 0 !important;
  padding: 15px max(24px, calc((100vw - 1180px) / 2)) !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(203, 209, 216, .85) !important;
  border-radius: 0 !important;
  background: rgba(247, 247, 244, .94) !important;
  box-shadow: none !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

.portfolio-shell > nav > a:first-child span:first-child,
.project-shell > nav > a:last-child span:last-child {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  background: var(--ink) !important;
  color: #fff !important;
  font-family: "Newsreader", serif !important;
  box-shadow: none !important;
}

.portfolio-shell > nav a,
.project-shell > nav a {
  color: #344054 !important;
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}

.portfolio-shell > nav a:hover,
.project-shell > nav a:hover {
  color: var(--accent) !important;
}

#nav-links {
  gap: 28px !important;
}

#nav-links a {
  padding: 6px 0 !important;
  border-radius: 0 !important;
  border-bottom: 2px solid transparent;
}

#nav-links a:hover {
  background: transparent !important;
  border-bottom-color: var(--accent);
}

#nav-links a span {
  display: none;
}

/* Hero */
.portfolio-shell header {
  min-height: min(800px, calc(100svh - 72px)) !important;
  max-width: 1180px !important;
  padding: clamp(84px, 11vw, 140px) 24px clamp(74px, 9vw, 116px) !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  position: relative;
}

.portfolio-shell header::after {
  content: "";
  position: absolute;
  top: clamp(90px, 14vw, 160px);
  right: 24px;
  width: 96px;
  height: 4px;
  background: var(--accent);
}

.portfolio-shell header > p:first-child {
  color: var(--accent) !important;
  font-family: "JetBrains Mono", monospace !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: .12em !important;
}

.portfolio-shell header h1 {
  max-width: 980px;
  color: var(--ink) !important;
  font-family: "Newsreader", Georgia, serif !important;
  font-size: clamp(64px, 11vw, 144px) !important;
  font-weight: 500 !important;
  line-height: .86 !important;
  letter-spacing: -.055em !important;
  text-wrap: balance;
}

.portfolio-shell header h1 + p {
  max-width: 22ch !important;
  color: #25324a !important;
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: -.025em !important;
}

.portfolio-shell em {
  color: var(--accent) !important;
  font-style: normal !important;
}

.portfolio-shell header h1 + p + p {
  max-width: 60ch !important;
  color: var(--body) !important;
}

.portfolio-shell header a {
  min-height: 44px;
  padding: 11px 18px !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 8px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #344054 !important;
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
  font-weight: 650 !important;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease !important;
}

.portfolio-shell header a[href="#contact"] {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: #fff !important;
}

.portfolio-shell header a:hover {
  border-color: var(--ink) !important;
  transform: translateY(-2px);
}

.portfolio-shell header a[href="#contact"]:hover {
  border-color: var(--accent-dark) !important;
  background: var(--accent-dark) !important;
}

/* Sections */
.portfolio-shell section {
  width: 100% !important;
  margin: 0 !important;
  padding: clamp(76px, 9vw, 124px) 24px !important;
  border: 0 !important;
  border-top: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: var(--page) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: hidden;
}

.portfolio-shell section > div {
  max-width: 1180px !important;
  margin-inline: auto !important;
}

.portfolio-shell #do {
  background: var(--surface-alt) !important;
}

.portfolio-shell section > div > div:first-child > span:first-child {
  display: grid !important;
  place-items: center !important;
  width: 38px !important;
  height: 38px !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--accent) !important;
  font-family: "JetBrains Mono", monospace !important;
  font-size: 12px !important;
  font-style: normal !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

.portfolio-shell section > div > div:first-child > span:last-child,
.portfolio-shell section > div > p:first-of-type,
.project-shell h2 {
  color: var(--muted) !important;
  font-family: "JetBrains Mono", monospace !important;
  font-weight: 500 !important;
  letter-spacing: .1em !important;
}

.portfolio-shell h2,
.portfolio-shell h3,
.project-shell h1,
.project-shell h3,
.project-shell p[style*="Newsreader"] {
  color: var(--ink) !important;
  font-family: "Newsreader", Georgia, serif !important;
}

.portfolio-shell p {
  color: var(--body);
}

/* About cards */
.portfolio-shell section div[style*="border:1px solid rgba(27,26,22,0.14)"] {
  padding: 26px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}

/* Statistics */
.portfolio-shell .stats-panel {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  overflow: hidden;
}

.portfolio-shell .stat-card {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px !important;
  border: 0 !important;
  border-left: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.portfolio-shell .stat-card:first-child {
  border-left: 0 !important;
}

.portfolio-shell .stat-number {
  margin: 0 !important;
  color: var(--ink) !important;
  font-family: "Newsreader", Georgia, serif !important;
  font-size: clamp(42px, 5vw, 58px) !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  letter-spacing: -.045em !important;
}

.portfolio-shell .stat-label {
  margin: 20px 0 0 !important;
  color: var(--muted) !important;
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}

/* Experience */
.portfolio-shell #do button {
  border-radius: 0 !important;
  transition: color .2s ease, padding .2s ease !important;
}

.portfolio-shell #do button:hover {
  padding-inline: 8px !important;
  background: transparent !important;
  color: var(--accent) !important;
  transform: none !important;
}

.portfolio-shell span[style*="background:rgba(27,58,107,0.07)"],
.project-shell span[style*="background:rgba(27,58,107,0.07)"] {
  padding: 6px 10px !important;
  border: 1px solid var(--line) !important;
  border-radius: 6px !important;
  background: var(--surface) !important;
  color: #344054 !important;
  box-shadow: none !important;
}

/* Project cards */
.portfolio-shell a[data-reveal] {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease !important;
}

.portfolio-shell a[data-reveal]:hover {
  border-color: #b7c0ca !important;
  box-shadow: var(--shadow) !important;
  transform: translateY(-4px) !important;
}

.portfolio-shell a[data-reveal] div[role="img"],
.portfolio-shell a[data-reveal] iframe,
.project-shell figure div[role="img"],
.project-shell figure iframe {
  border-color: var(--line) !important;
  background-color: #eef1f4 !important;
}

/* Contact */
.portfolio-shell #contact {
  background: var(--contact) !important;
  color: #fff !important;
  border-top: 0 !important;
}

#contact h2,
#contact h3,
#contact p,
#contact a {
  color: #fff !important;
}

#contact a {
  min-height: 44px;
  align-items: center;
}

#contact > div > div:first-child > span:last-child {
  color: #98a2b3 !important;
}

#contact input,
#contact textarea {
  border: 1px solid #344054 !important;
  border-radius: 8px !important;
  background: #1d2939 !important;
  box-shadow: none !important;
}

#contact input:focus,
#contact textarea:focus {
  border-color: #84adff !important;
  box-shadow: 0 0 0 3px rgba(132, 173, 255, .16) !important;
}

#contact input:focus-visible,
#contact textarea:focus-visible {
  outline-color: rgba(132, 173, 255, .38) !important;
}

#contact button {
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--ink) !important;
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
  font-weight: 700 !important;
  transition: background .2s ease !important;
}

#contact button:hover {
  background: #e4e7ec !important;
  transform: none !important;
}

.portfolio-shell > footer,
.project-shell > footer {
  border: 0 !important;
  background: var(--page);
  color: var(--muted) !important;
  padding: 36px max(24px, calc((100vw - 1180px) / 2)) !important;
}

/* Project detail pages */
.project-shell main {
  max-width: 1080px !important;
  padding-top: clamp(72px, 9vw, 110px) !important;
}

.project-shell main > p:first-child {
  color: var(--accent) !important;
  font-family: "JetBrains Mono", monospace !important;
  font-weight: 500 !important;
}

.project-shell h1 {
  color: var(--ink) !important;
  font-size: clamp(52px, 9vw, 104px) !important;
  font-weight: 500 !important;
  line-height: .94 !important;
  letter-spacing: -.045em !important;
}

.project-shell h1 + p {
  color: var(--body) !important;
  font-style: normal !important;
}

.project-shell main > section,
.project-shell main > a[data-reveal] {
  padding: clamp(24px, 4vw, 42px) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}

.project-shell main > div[style*="margin:clamp"] {
  padding: 10px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}

.project-shell figure > div,
.project-shell figure > iframe,
.project-shell main > div iframe {
  border-radius: 8px !important;
  overflow: hidden !important;
}

.project-shell main p {
  color: var(--body) !important;
}

.project-shell main section p[style*="color:#1B1A16"] {
  color: var(--ink) !important;
}

.project-shell main a[target="_blank"] {
  min-height: 44px;
  align-items: center;
  border: 1px solid var(--accent) !important;
  border-radius: 8px !important;
  background: var(--accent) !important;
  color: #fff !important;
  font-family: "Hanken Grotesk", system-ui, sans-serif !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.project-shell .project-metrics {
  padding: 0 !important;
  gap: 0 !important;
  background: var(--line) !important;
}

.project-shell .project-metrics > * > div,
.project-shell .project-metrics > div {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface) !important;
}

@media (max-width: 760px) {
  .portfolio-shell > nav,
  .project-shell > nav {
    min-height: 64px;
    padding: 12px 18px !important;
  }

  #nav-links {
    display: none !important;
  }

  .portfolio-shell header {
    min-height: auto !important;
    padding: 84px 20px 72px !important;
  }

  .portfolio-shell header::after {
    top: 62px;
    right: 20px;
    width: 56px;
  }

  .portfolio-shell header h1 {
    font-size: clamp(58px, 18vw, 86px) !important;
  }

  .portfolio-shell section {
    padding: 66px 20px !important;
  }

  .portfolio-shell section div[style*="display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr))"] {
    grid-template-columns: 1fr !important;
  }

  .portfolio-shell .stats-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .portfolio-shell .stat-card {
    min-height: 132px;
    padding: 20px !important;
  }

  .portfolio-shell .stat-card:nth-child(odd) {
    border-left: 0 !important;
  }

  .portfolio-shell .stat-card:nth-child(n+3) {
    border-top: 1px solid var(--line) !important;
  }

  .portfolio-shell #do button > span:first-child {
    width: 124px !important;
  }

  .project-shell main {
    padding-inline: 20px !important;
  }

  .project-shell .project-metrics {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 460px) {
  .portfolio-shell header > div {
    align-items: stretch !important;
  }

  .portfolio-shell header a {
    justify-content: center;
  }

  .portfolio-shell #do button {
    gap: 12px !important;
  }

  .portfolio-shell #do button > span:first-child {
    width: 96px !important;
  }

  .project-shell > nav > a:last-child > span:first-child {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}
