:root {
  --paper: #fbf7ef;
  --paper-strong: #f0eadf;
  --ink: #161616;
  --muted: #645f58;
  --line: rgba(22, 22, 22, 0.14);
  --teal: #0c6f68;
  --teal-dark: #07443f;
  --amber: #c4882b;
  --wine: #7a2638;
  --blue: #1c6e8c;
  --white: #ffffff;
  --shadow: 0 22px 70px rgba(28, 22, 14, 0.16);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.skip-link:focus {
  z-index: 100;
  width: auto;
  height: auto;
  clip: auto;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--white);
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 48px);
  color: var(--white);
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled {
  color: var(--ink);
  background: rgba(251, 247, 239, 0.92);
  box-shadow: 0 8px 34px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.82rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.94rem;
}

.nav a,
.mobile-nav a,
.footer a {
  text-decoration: none;
}

.nav a:hover,
.mobile-nav a:hover,
.footer a:hover {
  color: var(--amber);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: inherit;
  background: transparent;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
}

.mobile-nav {
  position: fixed;
  z-index: 19;
  top: 76px;
  left: 16px;
  right: 16px;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  background: rgba(251, 247, 239, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mobile-nav.is-open {
  display: grid;
}

.mobile-nav a {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.hero {
  position: relative;
  min-height: 96vh;
  display: grid;
  align-items: end;
  padding: 132px clamp(20px, 5vw, 72px) 36px;
  color: var(--white);
  overflow: hidden;
}

.hero-media,
.hero-media img,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 23%;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(12, 16, 18, 0.88) 0%, rgba(12, 16, 18, 0.62) 44%, rgba(12, 16, 18, 0.2) 100%),
    linear-gradient(0deg, rgba(12, 16, 18, 0.72), rgba(12, 16, 18, 0.05) 45%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 860px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 980px;
  margin-bottom: 18px;
  font-size: clamp(3.2rem, 9vw, 7.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4.8vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.18rem;
}

.hero-copy {
  max-width: 680px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.button,
.filter-button,
.quick-questions button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  font-weight: 800;
  text-decoration: none;
}

.button-primary {
  background: var(--amber);
  color: #18130b;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border-color: currentColor;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: var(--max);
  width: 100%;
  margin: 54px auto 0;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.hero-panel div {
  min-height: 124px;
  padding: 22px;
  background: rgba(17, 17, 17, 0.28);
}

.metric {
  display: block;
  margin-bottom: 8px;
  font-size: 2rem;
  font-weight: 900;
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 96px clamp(20px, 4vw, 36px);
}

.section-heading {
  max-width: 870px;
  margin-bottom: 38px;
}

.intro-grid,
.ai-layout,
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  align-items: stretch;
}

.intro-copy {
  padding: clamp(26px, 5vw, 52px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.intro-copy p {
  color: var(--muted);
  font-size: 1.08rem;
}

.profile-tags,
.tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-tags span,
.tech-row span {
  padding: 8px 10px;
  background: var(--paper-strong);
  border-radius: 999px;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.portrait-card {
  min-height: 520px;
  display: grid;
  align-content: end;
  overflow: hidden;
  background: var(--ink);
  border-radius: var(--radius);
  color: var(--white);
  box-shadow: var(--shadow);
}

.portrait-card img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.portrait-card div {
  padding: 24px;
  background: var(--teal-dark);
}

.portrait-card p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
}

.ai-section {
  max-width: none;
  background: #10100f;
  color: var(--white);
}

.ai-section > * {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.ai-layout {
  align-items: start;
}

.ai-card {
  padding: 22px;
  background: #191817;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.ai-topline {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.9rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #54c788;
  box-shadow: 0 0 0 6px rgba(84, 199, 136, 0.12);
}

.chat-window {
  height: 286px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #0c0c0b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
}

.message {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.9);
}

.message.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
}

.message.user {
  align-self: flex-end;
  background: var(--teal);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 10px;
  margin-top: 12px;
}

.chat-form input,
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}

.chat-form input {
  min-height: 48px;
  padding: 0 14px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: var(--radius);
  background: var(--amber);
  color: #1d1409;
  cursor: pointer;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-questions button {
  padding: 0 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.16);
}

.signal-list {
  display: grid;
  gap: 14px;
}

.signal-list article,
.skills-grid article {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.signal-list span {
  color: var(--amber);
  font-weight: 900;
}

.signal-list p,
.skills-grid p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
}

.project-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-button {
  padding: 0 14px;
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
  font-weight: 800;
}

.filter-button.active {
  background: var(--ink);
  color: var(--white);
}

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

.project-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 360px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.project-card.is-hidden {
  display: none;
}

.project-card.featured {
  grid-column: span 2;
  background: var(--teal-dark);
  color: var(--white);
}

.project-card.featured .tech-row span {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.project-card p,
.project-card li {
  color: var(--muted);
}

.project-card.featured p,
.project-card.featured li {
  color: rgba(255, 255, 255, 0.78);
}

.project-card ul {
  padding-left: 18px;
  margin: 0;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.visual-band {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: 72px clamp(20px, 6vw, 80px);
  background: var(--teal-dark);
  color: var(--white);
}

.visual-band img {
  width: 100%;
  height: min(620px, 70vh);
  object-fit: cover;
  border-radius: var(--radius);
}

.visual-band p:not(.eyebrow) {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.08rem;
}

.timeline {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.timeline article {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  padding: 26px;
  background: var(--white);
}

.timeline time {
  color: var(--wine);
  font-weight: 900;
}

.timeline p {
  margin-bottom: 0;
  color: var(--muted);
}

.skills-section {
  max-width: none;
  background: #2d2421;
  color: var(--white);
}

.skills-section > * {
  max-width: var(--max);
  margin-left: auto;
  margin-right: auto;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.skills-grid article {
  min-height: 280px;
}

.cv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.cv-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 190px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
}

.cv-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow);
}

.cv-card span {
  color: var(--wine);
  font-weight: 900;
}

.contact-section {
  padding-bottom: 70px;
}

.contact-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  align-content: start;
  padding: 22px;
  background: var(--ink);
  border-radius: var(--radius);
  color: var(--white);
}

.contact-card img {
  grid-row: span 3;
  width: 130px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
}

.contact-card p {
  margin-bottom: 2px;
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-card a,
.contact-card span {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
}

.contact-form {
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 800;
}

.contact-form input,
.contact-form textarea {
  padding: 13px 14px;
  color: var(--ink);
  background: var(--paper);
}

.contact-form textarea {
  resize: vertical;
}

.form-actions {
  justify-content: flex-end;
}

.contact-form .button-secondary {
  color: var(--teal-dark);
  border-color: var(--teal);
}

.form-note {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--teal-dark);
  font-weight: 800;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(20px, 5vw, 72px);
  color: var(--white);
  background: var(--ink);
}

.footer p {
  margin-bottom: 0;
}

.footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

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

  .nav-toggle {
    display: block;
  }

  .hero {
    min-height: 92vh;
  }

  .hero-panel,
  .intro-grid,
  .ai-layout,
  .visual-band,
  .contact-layout {
    grid-template-columns: 1fr;
  }

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

  .project-card.featured {
    grid-column: span 2;
  }
}

@media (max-width: 680px) {
  .site-header {
    padding: 14px 16px;
  }

  .hero {
    min-height: 100vh;
    padding: 112px 18px 24px;
  }

  .hero-media img {
    object-position: 61% 18%;
  }

  .hero-overlay {
    background:
      linear-gradient(0deg, rgba(10, 10, 10, 0.92), rgba(10, 10, 10, 0.42)),
      linear-gradient(90deg, rgba(10, 10, 10, 0.68), rgba(10, 10, 10, 0.14));
  }

  .hero-actions,
  .form-actions,
  .field-row,
  .footer {
    flex-direction: column;
    display: flex;
  }

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

  .hero-panel,
  .project-grid,
  .skills-grid,
  .cv-grid,
  .timeline article,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .hero-panel div {
    min-height: auto;
  }

  .project-card,
  .project-card.featured {
    grid-column: auto;
  }

  .visual-band {
    padding: 54px 18px;
  }

  .contact-card img {
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
