@import url('https://fonts.googleapis.com/css2?family=Chivo:wght@500;600;700;800;900&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: oklch(13% 0.018 170);
  --bg-2: oklch(17% 0.016 165);
  --surface: oklch(20% 0.012 170);
  --surface-strong: oklch(24% 0.014 165);
  --line: oklch(34% 0.018 160);
  --line-soft: oklch(28% 0.014 160);
  --text: oklch(92% 0.018 95);
  --muted: oklch(72% 0.018 105);
  --quiet: oklch(58% 0.016 115);
  --accent: oklch(74% 0.13 150);
  --accent-ink: oklch(16% 0.026 158);
  --danger: oklch(68% 0.16 25);
  --shadow: 0 24px 70px oklch(8% 0.02 170 / 0.42);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
  --scroll-progress: 0%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(90deg, oklch(100% 0 0 / 0.025) 1px, transparent 1px),
    linear-gradient(180deg, oklch(100% 0 0 / 0.02) 1px, transparent 1px),
    var(--bg);
  background-size: 72px 72px, 72px 72px, auto;
  color: var(--text);
  font-family: 'Work Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  content: '';
  opacity: 0.18;
  background-image:
    linear-gradient(115deg, transparent 0 42%, oklch(74% 0.13 150 / 0.08) 42% 43%, transparent 43% 100%),
    repeating-linear-gradient(0deg, oklch(100% 0 0 / 0.02) 0 1px, transparent 1px 4px);
  mix-blend-mode: soft-light;
}

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

button,
a,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

::-webkit-scrollbar {
  width: 11px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border: 3px solid var(--bg);
  border-radius: 999px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.8rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  transform: translateY(-140%);
  transition: transform 180ms var(--ease-out);
}

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

.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 80;
  width: var(--scroll-progress);
  height: 3px;
  background: var(--accent);
  transition: width 120ms var(--ease-out);
}

.site-header {
  position: fixed;
  inset: 14px 0 auto;
  z-index: 50;
}

.nav-shell {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: clamp(0.6rem, 2vw, 1rem);
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 0.45rem;
  border: 1px solid oklch(90% 0.02 120 / 0.12);
  border-radius: 999px;
  background: oklch(15% 0.018 170 / 0.78);
  box-shadow: 0 18px 50px oklch(8% 0.02 170 / 0.35);
  backdrop-filter: blur(18px);
}

.site-header.is-scrolled .nav-shell {
  background: oklch(15% 0.018 170 / 0.92);
}

.brand-mark {
  display: inline-flex;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: oklch(100% 0 0 / 0.035);
  color: var(--text);
  font-family: 'Chivo', sans-serif;
  padding: 0.35rem;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0;
  transition:
    transform 150ms var(--ease-out),
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out);
}

.brand-initials {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: #07110e;
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.brand-mark:hover {
  border-color: oklch(74% 0.13 150 / 0.58);
  background: oklch(74% 0.13 150 / 0.07);
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.1rem, 1vw, 0.35rem);
}

.desktop-nav button,
.mobile-panel button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 0.95rem;
  transition: color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.desktop-nav button:hover,
.mobile-panel button:hover {
  background: oklch(100% 0 0 / 0.05);
  color: var(--text);
}

.nav-cta,
.button,
.project-actions a,
.contact-methods a,
.social-links a,
.site-footer button {
  outline: none;
}

.nav-cta:focus-visible,
.button:focus-visible,
.brand-mark:focus-visible,
.desktop-nav button:focus-visible,
.mobile-panel button:focus-visible,
.menu-button:focus-visible,
.project-actions a:focus-visible,
.contact-methods a:focus-visible,
.social-links a:focus-visible,
.site-footer button:focus-visible,
.field-group input:focus-visible,
.field-group textarea:focus-visible,
.filter-bar button:focus-visible {
  outline: 3px solid oklch(74% 0.13 150 / 0.55);
  outline-offset: 3px;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0 1.05rem;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  text-decoration: none;
  transition: transform 150ms var(--ease-out), background-color 160ms var(--ease-out);
}

.menu-button {
  display: none;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
}

.menu-button span {
  grid-area: 1 / 1;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms var(--ease-out);
}

.menu-button span:first-child {
  transform: translateY(-4px);
}

.menu-button span:last-child {
  transform: translateY(4px);
}

.menu-button.is-open span:first-child {
  transform: rotate(45deg);
}

.menu-button.is-open span:last-child {
  transform: rotate(-45deg);
}

.mobile-panel {
  display: none;
  width: min(1180px, calc(100% - 24px));
  margin: 0.5rem auto 0;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 24px;
  background: transparent;
  backdrop-filter: blur(18px);
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
  transition:
    grid-template-rows 220ms var(--ease-out),
    opacity 160ms var(--ease-out);
}

.mobile-panel > div {
  display: grid;
  min-height: 0;
  padding: 0.5rem;
}

.mobile-panel.is-open {
  grid-template-rows: 1fr;
  border-color: var(--line-soft);
  background: oklch(15% 0.018 170 / 0.95);
  opacity: 1;
  pointer-events: auto;
}

.section-pad {
  padding: clamp(5.5rem, 9vw, 9rem) 0;
}

.page-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-section {
  display: grid;
  align-items: center;
  padding-top: clamp(7rem, 10vw, 9rem);
  padding-bottom: clamp(4rem, 7vw, 6rem);
  border-bottom: 1px solid var(--line-soft);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(310px, 0.72fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-title,
.section-heading h2,
.contact-copy h2 {
  margin: 0;
  color: var(--text);
  font-family: 'Chivo', sans-serif;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.94;
}

.hero-title {
  max-width: 15.5ch;
  font-size: clamp(3.3rem, 7.2vw, 7.2rem);
}

.hero-lede {
  max-width: 62ch;
  margin: clamp(1.4rem, 3vw, 2.2rem) 0 0;
  color: var(--muted);
  font-size: clamp(1.03rem, 1.8vw, 1.24rem);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2.2rem;
}

.button {
  position: relative;
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.95rem 1.25rem;
  text-decoration: none;
  transition:
    transform 150ms var(--ease-out),
    background-color 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    color 180ms var(--ease-out);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}

.button.secondary {
  border-color: var(--line);
  background: oklch(100% 0 0 / 0.03);
  color: var(--text);
}

.profile-panel {
  align-self: stretch;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), oklch(16% 0.012 170));
  box-shadow: var(--shadow);
}

.profile-media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.profile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.06);
  transition: transform 360ms var(--ease-out), filter 360ms var(--ease-out);
}

.profile-panel:hover .profile-media img {
  transform: scale(1.018);
  filter: saturate(1) contrast(1.08);
}

.profile-notes {
  display: grid;
}

.profile-notes div {
  display: grid;
  grid-template-columns: 0.55fr 1fr;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
}

.profile-notes div:last-child {
  border-bottom: 0;
}

.profile-notes span,
.project-meta,
.project-index,
.cluster-heading span {
  color: var(--quiet);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 0.76rem;
}

.about-section,
.projects-section {
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
}

.about-section {
  padding-top: clamp(3rem, 6vw, 5rem);
}

.section-heading {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto clamp(2rem, 5vw, 4rem);
}

.section-heading.narrow {
  width: min(860px, calc(100% - 32px));
  margin-left: max(16px, calc((100% - 1180px) / 2));
}

.section-heading h2,
.contact-copy h2 {
  max-width: 13ch;
  font-size: clamp(2.4rem, 5.8vw, 5.4rem);
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(320px, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.about-story {
  display: grid;
  gap: 1.1rem;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  line-height: 1.82;
}

.about-story p {
  margin: 0;
}

.about-highlight {
  border: 1px solid oklch(74% 0.13 150 / 0.34);
  background:
    linear-gradient(135deg, oklch(74% 0.13 150 / 0.11), transparent 58%),
    oklch(100% 0 0 / 0.025);
  color: var(--text) !important;
  padding: 1.15rem 1.2rem;
  line-height: 1.7;
}

.about-highlight::before {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
  content: 'Destaque';
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.process-board {
  display: grid;
  border-top: 1px solid var(--line);
}

.process-board article {
  display: grid;
  grid-template-columns: 52px 0.45fr 1fr;
  gap: clamp(0.8rem, 2vw, 1.5rem);
  align-items: baseline;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}

.process-board span {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 0.82rem;
}

.process-board h3 {
  margin: 0;
  font-family: 'Chivo', sans-serif;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
}

.process-board p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.skills-section {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background:
    linear-gradient(135deg, oklch(74% 0.13 150 / 0.08), transparent 35%),
    var(--bg);
}

.skill-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.skill-cluster {
  display: flex;
  min-height: 360px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  background: oklch(18% 0.014 170 / 0.82);
  padding: clamp(1rem, 2vw, 1.45rem);
}

.skill-cluster:nth-child(2) {
  margin-top: 0;
}

.cluster-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.cluster-heading h3 {
  margin: 0;
  font-family: 'Chivo', sans-serif;
  font-size: clamp(1.65rem, 3vw, 2.8rem);
  line-height: 1;
}

.skill-cluster p {
  margin: 1rem 0 1.4rem;
  color: var(--muted);
  line-height: 1.62;
}

.skill-tags,
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.skill-tags span,
.tech-stack span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: oklch(100% 0 0 / 0.035);
  color: var(--muted);
  padding: 0.42rem 0.7rem;
  font-size: 0.82rem;
}

.skill-tags i {
  color: var(--accent);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 1.5rem;
  gap: 0.55rem;
}

.filter-bar button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 1rem;
  transition:
    background-color 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    transform 150ms var(--ease-out);
}

.filter-bar button:hover,
.filter-bar button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.project-list {
  display: grid;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.project-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 0.86fr) minmax(280px, 0.95fr) auto;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  padding: clamp(1.2rem, 3vw, 2rem) 0;
  border-bottom: 1px solid var(--line);
}

.project-index {
  align-self: start;
  padding-top: 0.35rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.project-copy h3 {
  margin: 0;
  font-family: 'Chivo', sans-serif;
  font-size: clamp(1.6rem, 3vw, 3.2rem);
  line-height: 1;
}

.project-copy p {
  max-width: 62ch;
  margin: 0.9rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.project-signal {
  color: var(--text) !important;
}

.tech-stack {
  margin-top: 1rem;
}

.project-preview {
  aspect-ratio: 16 / 9;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 42px oklch(8% 0.02 170 / 0.22);
  transition: transform 240ms var(--ease-out), border-color 180ms var(--ease-out);
}

.project-row:hover .project-preview {
  border-color: oklch(74% 0.13 150 / 0.68);
  transform: translateY(-3px);
}

.browser-bar {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  height: 34px;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 0.75rem;
  background: oklch(16% 0.012 170);
}

.browser-bar span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}

.browser-bar span:first-child {
  background: var(--danger);
}

.browser-bar span:nth-child(2) {
  background: oklch(76% 0.12 85);
}

.browser-bar span:last-child {
  background: var(--accent);
}

.project-preview iframe {
  width: 100%;
  height: calc(100% - 34px);
  border: 0;
  background: var(--bg-2);
  pointer-events: none;
}

.project-actions {
  display: grid;
  gap: 0.6rem;
  justify-items: end;
}

.project-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  padding: 0 0.9rem;
  text-decoration: none;
  transition:
    transform 150ms var(--ease-out),
    border-color 160ms var(--ease-out),
    color 160ms var(--ease-out);
}

.contact-section {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 0.72fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.contact-copy > p:not(.eyebrow) {
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.72;
}

.contact-methods {
  display: grid;
  gap: 0.75rem;
  margin: 2rem 0;
}

.contact-methods a,
.contact-methods span {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
  text-decoration: none;
}

.contact-methods i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
}

.social-links {
  display: flex;
  gap: 0.65rem;
}

.social-links a {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  transition:
    transform 150ms var(--ease-out),
    border-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    background-color 160ms var(--ease-out);
}

.contact-form {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--line);
  background: oklch(18% 0.014 170 / 0.88);
  padding: clamp(1rem, 2.4vw, 1.5rem);
  box-shadow: var(--shadow);
}

.field-group {
  display: grid;
  gap: 0.45rem;
}

.field-group label {
  color: var(--text);
  font-weight: 700;
}

.field-group input,
.field-group textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: oklch(13% 0.018 170 / 0.72);
  color: var(--text);
  padding: 0.9rem 0.95rem;
  transition:
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out);
}

.field-group textarea {
  resize: vertical;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
  color: var(--quiet);
}

.field-group input:hover,
.field-group textarea:hover,
.field-group input:focus,
.field-group textarea:focus {
  border-color: var(--accent);
  background: oklch(15% 0.018 170);
}

.field-group input[aria-invalid='true'],
.field-group textarea[aria-invalid='true'] {
  border-color: var(--danger);
}

.field-error {
  min-height: 1.1rem;
  margin: 0;
  color: var(--danger);
  font-size: 0.86rem;
}

.submit-button {
  width: 100%;
  border-radius: 0;
}

.form-status {
  min-height: 1.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-status.success {
  color: var(--accent);
}

.form-status.error {
  color: var(--danger);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  color: var(--quiet);
}

.site-footer p {
  margin: 0;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-brand img {
  width: min(240px, 48vw);
  height: auto;
}

.site-footer button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 0 0.9rem;
}

.brand-mark:active,
.button:active,
.nav-cta:active,
.project-actions a:active,
.social-links a:active,
.site-footer button:active,
.filter-bar button:active {
  transform: scale(0.98);
  transition-duration: 110ms;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 340ms var(--ease-out),
    transform 340ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

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

@media (hover: hover) and (pointer: fine) {
  .brand-mark:hover,
  .nav-cta:hover,
  .button:hover,
  .project-actions a:hover,
  .social-links a:hover,
  .site-footer button:hover {
    transform: translateY(-2px);
  }

  .button.secondary:hover,
  .project-actions a:hover,
  .social-links a:hover,
  .site-footer button:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
}

@media (max-width: 960px) {
  .desktop-nav,
  .nav-cta {
    display: none;
  }

  .nav-shell {
    grid-template-columns: auto 1fr auto;
  }

  .menu-button,
  .mobile-panel {
    display: grid;
  }

  .hero-grid,
  .about-layout,
  .contact-layout,
  .skill-matrix {
    grid-template-columns: 1fr;
  }

  .hero-title {
    max-width: 12ch;
  }

  .profile-panel {
    max-width: 520px;
  }

  .skill-cluster:nth-child(2) {
    margin-top: 0;
  }

  .skill-cluster {
    min-height: auto;
  }

  .project-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .project-preview,
  .project-actions {
    grid-column: 2;
  }

  .project-actions {
    display: flex;
    justify-items: start;
  }
}

@media (max-width: 640px) {
  body {
    background-size: 48px 48px, 48px 48px, auto;
  }

  .section-pad {
    padding: 4.8rem 0;
  }

  .hero-section {
    padding-top: 6.6rem;
  }

  .hero-title {
    max-width: 100%;
    font-size: clamp(2.85rem, 13.5vw, 4.35rem);
  }

  .section-heading h2,
  .contact-copy h2 {
    max-width: 100%;
    font-size: clamp(2.25rem, 12vw, 3.8rem);
  }

  .hero-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .profile-panel {
    display: none;
  }

  .profile-notes div,
  .process-board article,
  .project-row {
    grid-template-columns: 1fr;
  }

  .project-preview,
  .project-actions {
    grid-column: auto;
  }

  .project-actions {
    justify-content: stretch;
  }

  .project-actions a {
    flex: 1;
  }

  .site-footer {
    align-items: stretch;
  }

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

  .site-footer button {
    justify-content: center;
    width: 100%;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Premium visual pass: uipro + impeccable + taste + Emil-style motion */
:root {
  --accent-2: oklch(82% 0.14 92);
  --electric: oklch(76% 0.15 205);
}

body {
  background:
    radial-gradient(900px 520px at 82% 12%, oklch(74% 0.13 150 / 0.13), transparent 62%),
    radial-gradient(760px 420px at 12% 4%, oklch(76% 0.15 205 / 0.08), transparent 64%),
    linear-gradient(90deg, oklch(100% 0 0 / 0.025) 1px, transparent 1px),
    linear-gradient(180deg, oklch(100% 0 0 / 0.02) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 72px 72px, 72px 72px, auto;
}

.ambient-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ambient-field::before {
  position: absolute;
  inset: -30% -20%;
  content: '';
  background:
    conic-gradient(from 140deg at 52% 48%, transparent 0 18%, oklch(74% 0.13 150 / 0.12) 22% 30%, transparent 34% 62%, oklch(76% 0.15 205 / 0.09) 68% 74%, transparent 80% 100%);
  filter: blur(48px);
  opacity: 0.72;
  transform: rotate(-7deg);
}

.ambient-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0 46%, oklch(100% 0 0 / 0.045) 47%, transparent 48% 100%);
  transform: translateX(-42%);
  animation: scanDrift 16s var(--ease-out) infinite;
}

.ambient-code {
  position: absolute;
  right: clamp(1rem, 5vw, 5rem);
  bottom: clamp(2rem, 6vw, 5rem);
  color: oklch(100% 0 0 / 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.75rem, 1.2vw, 0.95rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cursor-halo {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 59;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, oklch(74% 0.13 150 / 0.16), transparent 68%);
  transform: translate3d(calc(var(--cursor-x, -500px) - 50%), calc(var(--cursor-y, -500px) - 50%), 0);
  transition: opacity 180ms var(--ease-out);
  mix-blend-mode: screen;
}

body.has-pointer .cursor-halo {
  opacity: 1;
}

.hero-section {
  position: relative;
  min-height: 100dvh;
}

.hero-section::after {
  position: absolute;
  inset: auto 0 0;
  height: 32%;
  content: '';
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--bg));
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-copy::before {
  position: absolute;
  left: -1.4rem;
  top: 0.3rem;
  width: 3px;
  height: 84%;
  content: '';
  background: linear-gradient(180deg, var(--accent), transparent);
  transform: scaleY(0);
  transform-origin: top;
  animation: railGrow 900ms var(--ease-out) 250ms forwards;
}

.hero-title {
  text-wrap: balance;
  text-shadow: 0 20px 70px oklch(8% 0.02 170 / 0.5);
}

.hero-lede::after {
  display: block;
  width: min(100%, 520px);
  height: 1px;
  margin-top: 1.6rem;
  content: '';
  background: linear-gradient(90deg, var(--accent), transparent);
}

.button.primary {
  box-shadow: 0 18px 44px oklch(74% 0.13 150 / 0.18);
}

.nav-cta i,
.button i {
  transition: transform 180ms var(--ease-out);
}

.nav-cta:hover i,
.button:hover i {
  transform: translateX(3px);
}

.profile-panel {
  position: relative;
  z-index: 2;
  transform-style: preserve-3d;
  transition: transform 220ms var(--ease-out), border-color 160ms var(--ease-out);
}

.profile-panel::before,
.profile-panel::after {
  position: absolute;
  inset: -1px;
  z-index: -1;
  content: '';
  border: 1px solid oklch(74% 0.13 150 / 0.3);
  transform: translate(14px, 14px);
}

.profile-panel::after {
  border-color: oklch(76% 0.15 205 / 0.16);
  transform: translate(28px, 28px);
}

.profile-panel:hover {
  border-color: oklch(74% 0.13 150 / 0.65);
  transform: translateY(-3px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
}

.profile-code {
  position: absolute;
  right: -3.2rem;
  bottom: 2rem;
  width: min(300px, 76%);
  border: 1px solid oklch(74% 0.13 150 / 0.36);
  background: oklch(11% 0.018 170 / 0.86);
  box-shadow: 0 20px 58px oklch(8% 0.02 170 / 0.42);
  backdrop-filter: blur(14px);
  transform: translateZ(44px);
}

.profile-code span {
  display: block;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
}

.profile-code pre {
  margin: 0;
  padding: 0.85rem;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.66rem, 0.9vw, 0.82rem);
  line-height: 1.55;
}

.marquee-section {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: oklch(9% 0.018 170 / 0.72);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 42s linear infinite;
}

.marquee-track span {
  display: inline-flex;
  align-items: center;
  min-height: 74px;
  padding: 0 2rem;
  color: oklch(92% 0.018 95 / 0.8);
  font-family: 'Chivo', sans-serif;
  font-size: clamp(1.25rem, 2.5vw, 2.6rem);
  font-weight: 900;
  white-space: nowrap;
}

.marquee-track span:nth-child(odd) {
  color: transparent;
  -webkit-text-stroke: 1px oklch(92% 0.018 95 / 0.28);
}

.skill-cluster,
.project-row,
.contact-form {
  position: relative;
  overflow: hidden;
}

.skill-cluster {
  transition: transform 190ms var(--ease-out), border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.skill-cluster::before,
.contact-form::before {
  position: absolute;
  inset: 0;
  content: '';
  opacity: 0;
  background: radial-gradient(circle at 30% 20%, oklch(74% 0.13 150 / 0.18), transparent 46%);
  transition: opacity 180ms var(--ease-out);
  pointer-events: none;
}

.skill-cluster:hover {
  border-color: oklch(74% 0.13 150 / 0.5);
  transform: translateY(-3px);
}

.skill-cluster:hover::before,
.contact-form::before {
  opacity: 1;
}

.skill-cluster > *,
.contact-form > * {
  position: relative;
}

.project-row {
  isolation: isolate;
}

.project-row::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: '';
  opacity: 0;
  background:
    radial-gradient(460px circle at var(--spotlight-x, 50%) var(--spotlight-y, 50%), oklch(74% 0.13 150 / 0.14), transparent 54%),
    linear-gradient(90deg, oklch(100% 0 0 / 0.035), transparent);
  transition: opacity 180ms var(--ease-out);
}

.project-row:hover::before {
  opacity: 1;
}

.project-copy h3 {
  transition: color 170ms var(--ease-out), transform 170ms var(--ease-out);
}

.project-row:hover .project-copy h3 {
  color: var(--accent);
  transform: translateX(3px);
}

@media (max-width: 960px) {
  .profile-code {
    right: 1rem;
  }
}

@media (max-width: 640px) {
  .hero-section {
    min-height: auto;
  }

  .hero-copy::before,
  .cursor-halo,
  .ambient-code {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-scan,
  .marquee-track {
    animation: none;
  }
}

@keyframes scanDrift {
  0%, 100% {
    transform: translateX(-42%);
    opacity: 0;
  }
  35%, 62% {
    opacity: 1;
  }
  70% {
    transform: translateX(42%);
    opacity: 0;
  }
}

@keyframes railGrow {
  to {
    transform: scaleY(1);
  }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}
