:root {
  color-scheme: dark;
  --bg: #08090b;
  --bg-soft: #101215;
  --bg-elevated: rgba(255, 255, 255, 0.055);
  --text: #f5f5f0;
  --text-muted: #8e9399;
  --text-subtle: #5d6269;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --accent: #ffffff;
  --accent-text: #08090b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 28px;
  --radius-sm: 16px;
  --max: 1180px;
  --header-h: 72px;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f3ee;
  --bg-soft: #ffffff;
  --bg-elevated: rgba(10, 12, 15, 0.055);
  --text: #111317;
  --text-muted: #59606a;
  --text-subtle: #858b93;
  --line: rgba(0, 0, 0, 0.11);
  --line-strong: rgba(0, 0, 0, 0.2);
  --surface: rgba(0, 0, 0, 0.045);
  --surface-strong: rgba(0, 0, 0, 0.08);
  --accent: #111317;
  --accent-text: #ffffff;
  --shadow: 0 24px 70px rgba(35, 32, 25, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.055), transparent 30rem),
    radial-gradient(circle at 78% 4%, rgba(255, 255, 255, 0.045), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

body.no-scroll {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(circle at center, #000 0 18%, transparent 75%);
  opacity: 0.18;
  pointer-events: none;
}

img {
  display: block;
  max-width: 100%;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: var(--accent-text);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.26;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.cursor-glow {
  position: fixed;
  z-index: -2;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 62%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.container {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: 150px 0;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(20px);
}

.brand {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2vw, 32px);
}

.nav-link {
  position: relative;
  padding: 27px 0 25px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 17px;
  height: 2px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

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

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-button,
.lang-button,
.nav-toggle,
.back-to-top,
.modal-close {
  border: 0;
  color: var(--text);
  background: transparent;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.theme-toggle .moon {
  display: none;
}

html[data-theme="light"] .theme-toggle .sun {
  display: none;
}

html[data-theme="light"] .theme-toggle .moon {
  display: inline;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-button {
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: background 0.25s ease, color 0.25s ease;
}

.lang-button.is-active {
  background: var(--accent);
  color: var(--accent-text);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s ease;
}

.hero {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 13% 6%;
  border: 1px solid var(--line);
  opacity: 0.22;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 80%, transparent);
}

.hero-grid::before,
.hero-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
}

.hero-orb {
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.18;
}

.hero-orb--one {
  left: 12%;
  top: 22%;
  background: #9da7ff;
}

.hero-orb--two {
  right: 8%;
  bottom: 6%;
  background: #ffffff;
}

.hero-container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  align-items: center;
  gap: clamp(56px, 7vw, 110px);
}

.eyebrow,
.hero-kicker {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero .eyebrow {
  margin-top: 28px;
}

.eyebrow span:first-child {
  color: var(--text);
}

.hero-kicker {
  margin-bottom: 8px;
}

.hero-title {
  max-width: 850px;
  margin: 0;
  font-size: clamp(5rem, 11vw, 11.5rem);
  line-height: 0.78;
  letter-spacing: -0.095em;
  text-transform: uppercase;
}

.hero-title span {
  display: block;
}

.hero-title span:last-child {
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--text) 34%, transparent);
  text-stroke: 1px color-mix(in srgb, var(--text) 34%, transparent);
}

.hero-subtitle {
  margin: 32px 0 0;
  color: var(--text-muted);
  font-size: clamp(0.9rem, 1vw, 1.02rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-description {
  max-width: 610px;
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

.button {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 28px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: transform 0.25s var(--ease), background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.button:hover {
  transform: translateY(-3px);
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.button-secondary:hover {
  background: var(--surface-strong);
}

.social-list {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
}

.social-list a {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 900;
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease);
}

.social-list a:hover {
  color: var(--text);
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.hero-visual {
  position: relative;
  min-height: 520px;
}

.hero-card {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(100%, 520px);
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-strong), transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.code-window {
  background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
}

.window-bar {
  display: flex;
  gap: 7px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.window-bar span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--line-strong);
}

.code-window pre {
  margin: 0;
  padding: clamp(22px, 4vw, 36px);
  color: var(--text-muted);
  font-size: clamp(0.78rem, 1.5vw, 1rem);
  line-height: 1.9;
  overflow: auto;
}

.metric-card {
  position: absolute;
  z-index: 2;
  width: 180px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg) 66%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.metric-card strong {
  display: block;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -0.07em;
}

.metric-card span {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.metric-card--top {
  top: 32px;
  right: 2px;
}

.metric-card--bottom {
  bottom: 44px;
  left: 2px;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 32px;
  z-index: 3;
  width: 30px;
  height: 48px;
  display: grid;
  place-items: start center;
  padding-top: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transform: translateX(-50%);
}

.scroll-hint span {
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: var(--text-muted);
  animation: wheel 1.4s ease-in-out infinite;
}

@keyframes wheel {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50% { transform: translateY(12px); opacity: 1; }
}

.split-layout {
  display: grid;
  grid-template-columns: 0.45fr 0.58fr 1fr;
  align-items: center;
  gap: clamp(32px, 5vw, 82px);
}

.section-marker {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.portrait-card {
  position: relative;
  padding: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.6s var(--ease), border-color 0.35s ease, box-shadow 0.35s ease;
}

.portrait-card:hover {
  transform: scale(1.02);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.portrait-card::after {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  z-index: -1;
  border: 1px solid var(--line);
}

.portrait-card img {
  width: 210px;
  aspect-ratio: 1;
  object-fit: cover;
}

.about h2,
.section-heading h2,
.contact h2 {
  margin: 0;
  font-size: clamp(2.8rem, 5.5vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.about h2 span:first-child {
  color: var(--text);
}

.section-lead {
  margin: 8px 0 22px;
  color: var(--text-muted);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
}

.about-content > p:not(.section-lead) {
  max-width: 720px;
  margin: 0;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.pill-row span,
.tech-tag,
.project-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
}

.pinned-story {
  position: relative;
  min-height: 100svh;
  padding: 0;
}

.pin-inner {
  min-height: 100svh;
  display: grid;
  place-items: center;
  border-block: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, var(--surface), transparent);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.story-step {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.story-step span {
  color: var(--text-subtle);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.story-step h3 {
  margin: 16px 0 10px;
  font-size: clamp(1.6rem, 2.4vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.story-step p {
  margin: 0;
  color: var(--text-muted);
}

.section-heading {
  max-width: 640px;
}

.section-heading .muted {
  color: var(--text-subtle);
}

.section-heading p:last-child {
  margin: 24px 0 0;
  color: var(--text-muted);
  font-size: 1.03rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 58px 0 34px;
}

.filter-button {
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s var(--ease);
}

.filter-button:hover {
  transform: translateY(-2px);
  color: var(--text);
}

.filter-button.is-active {
  background: var(--accent);
  color: var(--accent-text);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.skill-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, var(--surface), transparent);
  transition: transform 0.35s var(--ease), border-color 0.35s ease, background 0.35s ease;
}

.skill-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.skill-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 900;
}

.skill-card h3 {
  margin: 0 0 5px;
  font-size: 1rem;
}

.skill-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.projects {
  overflow: hidden;
}

.projects-heading {
  margin-bottom: 58px;
}

.horizontal-wrapper {
  width: 100%;
  overflow: visible;
}

.projects-track {
  display: flex;
  gap: 28px;
  width: max-content;
  padding: 0 calc((100vw - min(var(--max), calc(100vw - 48px))) / 2) 18px;
}

.project-card {
  position: relative;
  flex: 0 0 auto;
  width: min(78vw, 850px);
  height: min(560px, calc(100svh - var(--header-h) - 96px));
  min-height: 460px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface-strong), var(--surface)) !important;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform 0.35s var(--ease), border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.project-card:hover {
  transform: translateY(-12px);
  border-color: var(--line-strong);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.project-image {
  position: relative;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: var(--bg-soft);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.project-card:hover .project-image img {
  transform: scale(1.055);
}

.project-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 12px 20px 0;
}

.project-year {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.project-card h3 {
  margin: 14px 0 14px;
  font-size: clamp(2rem, 3.3vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.project-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.project-link {
  display: inline-flex;
  gap: 8px;
  margin-top: 30px;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), transparent);
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  gap: clamp(40px, 8vw, 110px);
  align-items: start;
}

.contact-content > p:not(.eyebrow) {
  max-width: 560px;
  margin: 28px 0 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.contact-cards {
  display: grid;
  gap: 14px;
  margin-top: 42px;
}

.contact-card {
  display: grid;
  gap: 4px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 0.25s var(--ease), border-color 0.25s ease;
}

.contact-card:hover {
  transform: translateX(8px);
  border-color: var(--line-strong);
}

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

.contact-card strong {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.contact-form {
  display: grid;
  gap: 20px;
}

.contact-form label {
  display: grid;
  gap: 8px;
}

.contact-form label span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--text);
  outline: 0;
  padding: 18px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--line-strong);
  background: var(--bg-soft);
}

.contact-form textarea {
  resize: vertical;
  min-height: 160px;
}

.form-note {
  min-height: 20px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer .social-list {
  margin: 0;
}

.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 70;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  color: var(--text);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  backdrop-filter: blur(16px);
}

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

.project-modal {
  width: min(1040px, calc(100vw - 34px));
  max-height: min(820px, calc(100svh - 34px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: auto;
}

.project-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 0;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  font-size: 1.6rem;
  line-height: 1;
}

.modal-media {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 350px;
  max-height: 420px;
  background: var(--surface);
  overflow: hidden;
}

.modal-media img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
}

.modal-body {
  padding: clamp(28px, 4vw, 48px);
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.modal-meta span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.modal-body h3 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
}

.modal-body > p {
  margin: 22px 0;
  color: var(--text-muted);
}

.modal-section {
  margin-top: 26px;
}

.modal-section h4 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.modal-section ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.modal-section li + li {
  margin-top: 8px;
}

.tech-tags,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-actions {
  margin-top: 28px;
}

.modal-actions .button {
  min-height: 46px;
  padding: 0 18px;
}

[data-animate] {
  will-change: transform, opacity;
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .nav-toggle {
    display: grid;
    justify-self: end;
    grid-column: 2;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-h);
    left: 16px;
    right: 16px;
    display: grid;
    gap: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--bg-soft);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(-16px);
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  }

  .site-header.menu-open .nav-menu {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }

  .site-header.menu-open .nav-toggle span:first-child {
    transform: translateY(3px) rotate(45deg);
  }

  .site-header.menu-open .nav-toggle span:last-child {
    transform: translateY(-3px) rotate(-45deg);
  }

  .nav-link {
    padding: 16px 0;
  }

  .nav-link::after {
    bottom: 10px;
  }

  .header-actions {
    grid-column: 3;
  }

  .hero-container,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 440px;
  }

  .split-layout {
    grid-template-columns: 1fr 1fr;
  }

  .split-layout .section-marker {
    grid-column: 1 / -1;
  }

  .story-grid,
  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-card {
    width: min(86vw, 760px);
    grid-template-columns: minmax(0, 1.05fr) minmax(250px, 0.95fr);
  }

  .project-content {
    padding: 12px 4px 12px 0;
  }

  .project-image {
    min-height: 100%;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 66px;
  }

  .container {
    width: min(100% - 32px, var(--max));
  }

  .section {
    padding: 98px 0;
  }

  .site-header {
    padding-inline: 16px;
    gap: 10px;
  }

  .header-actions {
    gap: 8px;
  }

  .language-switcher {
    gap: 2px;
  }

  .lang-button {
    min-width: 30px;
    padding: 0 6px;
  }

  .hero-container {
    gap: 36px;
  }

  .hero-title {
    font-size: clamp(4.2rem, 22vw, 7rem);
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .hero-visual {
    min-height: 360px;
  }

  .metric-card {
    width: 150px;
    padding: 16px;
  }

  .metric-card strong {
    font-size: 2rem;
  }

  .metric-card--top {
    right: 0;
  }

  .metric-card--bottom {
    left: 0;
  }

  .split-layout,
  .story-grid,
  .skills-grid,
  .modal-content {
    grid-template-columns: 1fr;
  }

  .portrait-card img {
    width: 100%;
  }

  .story-step {
    min-height: 240px;
  }

  .projects-track {
    display: grid;
    gap: 22px;
    width: auto;
    padding-inline: 16px;
    transform: none !important;
  }

  .project-card {
    width: 100%;
    height: auto;
    min-height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .project-image {
    min-height: 260px;
  }

  .modal-media img {
    min-height: 260px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* Ajustes finais v3 */
.theme-toggle i {
  font-size: 0.92rem;
  line-height: 1;
}

.nav-toggle {
  align-content: center;
  justify-content: center;
}

.nav-toggle span {
  transform-origin: center;
}

.site-header.menu-open .nav-toggle span:first-child {
  transform: translateY(6px) rotate(45deg);
}

.site-header.menu-open .nav-toggle span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.site-header.menu-open .nav-toggle span:last-child {
  transform: translateY(-6px) rotate(-45deg);
}

.window-bar span:nth-child(1) { background: #ff5f57; }
.window-bar span:nth-child(2) { background: #ffbd2e; }
.window-bar span:nth-child(3) { background: #28c840; }

.metric-card--bottom,
.pinned-story {
  display: none !important;
}

.about-media {
  width: 100%;
}

.about-media .portrait-card {
  width: clamp(260px, 25vw, 380px);
  margin-inline: auto;
}

.portrait-card img {
  width: 100%;
}

.pill-row .about-pill,
.tech-tag,
.project-tag,
.modal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  line-height: 1;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  text-transform: none;
  font-family: inherit;
}

.pill-row .about-pill {
  padding-inline: 12px 14px;
}

.pill-icon,
.pill-fa,
.tech-tag img,
.project-tag img {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  object-fit: contain;
}

.pill-fa,
.tech-tag i,
.project-tag i {
  width: 16px;
  min-width: 16px;
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
}

.skill-icon i {
  font-size: 1.85rem;
  line-height: 1;
}

.skill-icon img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.skill-card h3,
.project-card h3,
.modal-body h3 {
  font-variation-settings: "wght" 780;
}

.projects {
  overflow: clip;
  padding-bottom: 120px;
}

.horizontal-wrapper {
  min-height: min(680px, calc(100svh - var(--header-h) - 48px));
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  will-change: transform;
}

.projects-track {
  display: flex;
  gap: 28px;
  width: max-content;
  align-items: center;
  padding: 0 calc((100vw - min(var(--max), calc(100vw - 48px))) / 2) 0;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 18px auto;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.project-image {
  box-shadow: inset 0 0 0 1px var(--line);
}

.project-tags,
.tech-tags {
  gap: 9px;
}

.project-tag,
.tech-tag {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border-color: color-mix(in srgb, var(--line) 80%, transparent);
  color: var(--text);
}

.project-tag i,
.tech-tag i {
  font-size: 1.02rem;
}

.contact-card {
  grid-template-columns: 22px 1fr;
  align-items: center;
  column-gap: 14px;
}

.contact-card > i {
  grid-row: 1 / 3;
  color: var(--text-muted);
  font-size: 1rem;
}

.social-list a {
  font-size: 0.92rem;
}

.project-modal {
  width: min(1160px, calc(100vw - 24px));
  max-height: min(860px, calc(100svh - 24px));
}

.image-modal {
  width: min(1200px, calc(100vw - 32px));
  max-height: 90svh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  overflow: hidden;
}

.image-modal::backdrop {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
}

.image-modal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.image-modal .modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  background: color-mix(in srgb, rgba(0, 0, 0, 0.5) 100%, transparent);
  border-color: var(--line-strong);
}

.modal-content {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}

.modal-media {
  display: flex;
  align-items: stretch;
  min-height: 100%;
}

.modal-gallery {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  align-content: start;
}

.modal-shot {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
}

.modal-shot img,
.modal-media .modal-shot img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.modal-body {
  padding: clamp(24px, 3.4vw, 42px);
}

.modal-meta span i {
  width: 14px;
  display: inline-grid;
  place-items: center;
  font-size: 0.82rem;
}

.modal-actions .button {
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 0.82rem;
}

@media (max-width: 1080px) {
  .site-header.menu-open .nav-toggle span:first-child {
    transform: translateY(6px) rotate(45deg);
  }

  .site-header.menu-open .nav-toggle span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .site-header.menu-open .nav-toggle span:last-child {
    transform: translateY(-6px) rotate(-45deg);
  }
}

@media (max-width: 760px) {
  .about-media .portrait-card {
    width: 100%;
  }

  .projects {
    padding-bottom: 98px;
  }

  .horizontal-wrapper {
    min-height: auto;
    display: block;
    overflow: visible;
  }

  .projects-track {
    display: grid;
    gap: 22px;
    width: auto;
    padding-inline: 16px;
    transform: none !important;
  }

  .project-card {
    width: 100%;
    height: auto;
    min-height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

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

  .modal-gallery {
    gap: 6px;
    padding: 6px;
  }

  .modal-shot {
    border-radius: 10px;
  }

  .modal-body {
    padding: 20px 16px 22px;
  }

  .modal-close {
    top: 10px;
    right: 10px;
  }

  .pill-row .about-pill,
  .tech-tag,
  .project-tag,
  .modal-meta span {
    font-size: 0.72rem;
  }
}

.pill-row .about-pill > span {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.devicon-express-original,
.devicon-nextjs-original,
.devicon-prisma-original {
  color: var(--text);
}
