:root {
  --ink: #142033;
  --body: #435168;
  --muted: #66758c;
  --line: #dbe3ee;
  --paper: #ffffff;
  --mist: #f4f8fb;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --gold: #c48222;
  --rose: #b8445b;
  --night: #101827;
  --shadow: 0 18px 45px rgba(18, 32, 51, 0.12);
}

* {
  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", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 14px;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 5vw, 68px);
  color: #fff;
  transition: background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.site-header.is-scrolled,
.site-header.is-open {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(17, 29, 43, 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: 38px;
  height: 38px;
  color: #fff;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  font-size: 0.92rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 700;
  font-size: 0.91rem;
}

.site-nav a {
  color: inherit;
  text-decoration: none;
  opacity: 0.86;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.is-active {
  opacity: 1;
  color: var(--gold);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
}

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 88vh;
  padding: 124px clamp(20px, 6vw, 76px) 64px;
  color: #fff;
  overflow: hidden;
}

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

.hero-bg {
  background-image: url("../img/trackforge-pro.png");
  background-size: cover;
  background-position: center top;
  transform: scale(1.03);
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(10, 18, 31, 0.92) 0%, rgba(10, 18, 31, 0.76) 46%, rgba(10, 18, 31, 0.32) 100%),
    linear-gradient(0deg, rgba(10, 18, 31, 0.62), rgba(10, 18, 31, 0.16));
}

.hero-content {
  position: relative;
  width: min(760px, 100%);
  min-width: 0;
}

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

.hero h1,
.section-heading h2,
.contact-section h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 880px;
  font-size: clamp(3.1rem, 8vw, 7.2rem);
}

.hero h1 span {
  display: block;
}

.hero-lede {
  width: min(720px, 100%);
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.08rem, 2vw, 1.36rem);
  overflow-wrap: anywhere;
}

.hero-lede span {
  display: block;
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.button.primary {
  color: #fff;
  background: var(--accent);
}

.button.secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
}

.contact-section .button.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: var(--paper);
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.proof-strip div {
  padding: 24px clamp(18px, 3vw, 34px);
  background: var(--paper);
}

.proof-strip strong,
.proof-strip span {
  display: block;
}

.proof-strip strong {
  margin-bottom: 4px;
  color: var(--accent-strong);
  font-size: 1.1rem;
}

.proof-strip span {
  color: var(--body);
  font-size: 0.95rem;
}

.section,
.contact-section {
  padding: 84px clamp(20px, 6vw, 76px);
}

.surface {
  background: var(--mist);
}

.section-heading {
  width: min(860px, 100%);
  margin-bottom: 34px;
}

.section-heading h2,
.contact-section h2 {
  font-size: clamp(2rem, 4vw, 3.45rem);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.75fr);
  gap: 34px;
  align-items: start;
}

.about-copy {
  color: var(--body);
  font-size: 1.08rem;
}

.about-copy p:first-child {
  margin-top: 0;
}

.about-panel,
.skill-card,
.service-card,
.project-card,
.proof-links a {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.about-panel {
  padding: 24px;
  box-shadow: var(--shadow);
}

.about-panel h3,
.skill-card h3,
.service-card h3,
.project-body h3,
.timeline-item h3 {
  margin: 0 0 10px;
  line-height: 1.2;
  letter-spacing: 0;
}

.about-panel ul {
  margin: 0;
  padding-left: 20px;
  color: var(--body);
}

.about-panel li + li {
  margin-top: 8px;
}

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

.skill-card,
.service-card {
  padding: 22px;
}

.skill-card h3 {
  color: var(--accent-strong);
}

.skill-card p,
.service-card p,
.project-body p,
.timeline-item p,
.contact-section p {
  color: var(--body);
}

.service-card {
  min-height: 230px;
}

.service-index {
  display: inline-block;
  margin-bottom: 26px;
  color: var(--rose);
  font-weight: 900;
}

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

.project-card {
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(18, 32, 51, 0.08);
}

.project-card.featured {
  grid-column: span 3;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(320px, 0.78fr);
}

.project-media {
  display: block;
  position: relative;
  min-height: 230px;
  color: inherit;
  background: var(--night);
  overflow: hidden;
}

.project-card.featured .project-media {
  min-height: 390px;
}

.project-media img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  object-position: top center;
  transition: transform 360ms ease;
}

.project-card:hover .project-media img {
  transform: scale(1.035);
}

.project-body {
  padding: 24px;
}

.project-type {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.77rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.tags span {
  padding: 5px 9px;
  color: var(--accent-strong);
  background: #e7f4f2;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.text-link {
  color: var(--accent-strong);
  font-weight: 900;
  text-decoration: none;
}

.text-link:hover {
  color: var(--rose);
}

.theme-preview {
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(135deg, #f8fbfd 0%, #eef7f6 52%, #f8efe1 100%);
}

.mini-browser {
  width: min(360px, 100%);
  overflow: hidden;
  background: #121a28;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(16, 24, 39, 0.28);
}

.mini-topbar {
  height: 32px;
  background:
    radial-gradient(circle at 18px 16px, #ff6868 0 5px, transparent 6px),
    radial-gradient(circle at 38px 16px, #ffc65c 0 5px, transparent 6px),
    radial-gradient(circle at 58px 16px, #55d27d 0 5px, transparent 6px),
    #202b3d;
}

.mini-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 150px;
  padding: 22px;
  color: #fff;
}

.mini-label {
  display: block;
  margin-bottom: 8px;
  color: #9fb0c8;
  font-size: 0.78rem;
}

.mini-content strong {
  display: block;
  max-width: 190px;
  line-height: 1.2;
}

.toggle-visual {
  position: relative;
  flex: 0 0 auto;
  width: 76px;
  height: 38px;
  background: #f1c15b;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.toggle-visual::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 37px;
  width: 28px;
  height: 28px;
  background: #fff;
  border-radius: 50%;
  box-shadow: -9px 1px 0 #dbe3ee;
}

.timeline {
  display: grid;
  gap: 18px;
  max-width: 980px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.timeline-date {
  color: var(--rose);
  font-weight: 900;
}

.proof-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.proof-links a {
  display: block;
  padding: 22px;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.proof-links a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.proof-links span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.proof-links strong {
  display: block;
  overflow-wrap: anywhere;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  color: #fff;
  background: var(--night);
}

.contact-section p {
  max-width: 780px;
  color: rgba(255, 255, 255, 0.78);
}

.site-footer {
  padding: 24px clamp(20px, 6vw, 76px);
  color: var(--muted);
  background: #f7f9fb;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1060px) {
  .proof-strip,
  .skills-grid,
  .services-grid,
  .proof-links {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card.featured {
    grid-column: span 2;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header {
    min-height: 66px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: 66px 14px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 13px 12px;
  }

  .hero {
    min-height: 84vh;
    padding-top: 104px;
    padding-bottom: 46px;
  }

  .hero-overlay {
    background: linear-gradient(0deg, rgba(10, 18, 31, 0.88), rgba(10, 18, 31, 0.58));
  }

  .proof-strip,
  .about-grid,
  .skills-grid,
  .services-grid,
  .project-grid,
  .proof-links,
  .contact-section {
    grid-template-columns: 1fr;
  }

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

  .project-card.featured .project-media,
  .project-media {
    min-height: 240px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .section,
  .contact-section {
    padding-top: 64px;
    padding-bottom: 64px;
  }
}

@media (max-width: 460px) {
  .hero h1 {
    font-size: 2.7rem;
    max-width: 8ch;
  }

  .hero-content {
    width: 100%;
    max-width: calc(100vw - 56px);
  }

  .hero-lede {
    max-width: 315px;
    font-size: 1rem;
  }

  .hero-actions,
  .contact-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .project-body,
  .skill-card,
  .service-card,
  .about-panel,
  .proof-links a {
    padding: 19px;
  }
}

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