:root {
  --red: #e31b2f;
  --red-dark: #9c1020;
  --ink: #111318;
  --muted: #6b7280;
  --line: #e5e7eb;
  --paper: #f7f7f5;
  --white: #ffffff;
  --steel: #d7dde5;
  --blue: #2870c7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

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

/* ---------- Header / nav ---------- */
.page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  color: var(--white);
  background: linear-gradient(180deg, rgba(7, 9, 13, 0.86), rgba(7, 9, 13, 0));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.page-header nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 600;
}

.page-header nav a:hover,
.page-header nav button:hover {
  color: var(--white);
}

.page-header nav button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.page-header nav button.active {
  position: relative;
  color: var(--white);
}

.page-header nav button.active::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  content: "";
  background: var(--red);
}

.nav-item {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  display: grid;
  min-width: 180px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 15, 20, 0.96);
  opacity: 0;
  transform: translateX(-50%) translateY(-6px);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.dropdown-menu a {
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
}

.dropdown-menu a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ---------- Project hero ---------- */
.project-hero {
  position: relative;
  padding: clamp(120px, 13vw, 176px) clamp(18px, 6vw, 88px) clamp(40px, 5vw, 64px);
  color: var(--white);
  overflow: hidden;
  background:
    linear-gradient(135deg, #0c1017 0%, #07090d 60%, #05070a 100%);
}

.project-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
  pointer-events: none;
}

/* All project detail pages use the same quiet, solid hero surface. */
.project-hero {
  background: #171b20;
  border-bottom: 1px solid #30353a;
}

.project-hero::before {
  content: none;
}

.project-hero > .hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-hero h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(40px, 6.4vw, 84px);
  line-height: 0.96;
  font-weight: 800;
  text-transform: uppercase;
}

.project-hero h1::after {
  display: block;
  width: 110px;
  height: 5px;
  margin-top: 22px;
  content: "";
  background: var(--red);
}

.project-tagline {
  max-width: 640px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(19px, 2vw, 26px);
  line-height: 1.4;
  font-weight: 600;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Project body ---------- */
.project-section {
  padding: clamp(48px, 6vw, 80px) clamp(18px, 6vw, 88px) clamp(56px, 7vw, 96px);
}

.project-section > .body-wrap {
  max-width: 980px;
  margin: 0 auto;
}

.overview {
  max-width: 760px;
  color: #343944;
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.7;
}

.overview p {
  margin: 0 0 18px;
}

.overview p:last-child {
  margin-bottom: 0;
}

.focus-head {
  margin: clamp(48px, 6vw, 72px) 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.focus-head h2 {
  margin: 0;
  font-size: clamp(24px, 2.8vw, 36px);
  text-transform: uppercase;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.focus {
  position: relative;
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--white);
}

.focus::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  content: "";
  background: var(--red);
  transform: scaleX(0.4);
  transform-origin: left;
  transition: transform 220ms ease;
}

.focus:hover::before {
  transform: scaleX(1);
}

.focus h3 {
  margin: 0 0 10px;
  font-size: 18px;
  text-transform: uppercase;
}

.focus p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- Links block (open source / deployment) ---------- */
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
  padding: 28px;
  border: 1px solid rgba(227, 27, 47, 0.2);
  background:
    radial-gradient(circle at 90% 10%, rgba(227, 27, 47, 0.08), transparent 40%),
    linear-gradient(135deg, #14181f, #0a0d12);
  color: var(--white);
}

.project-links .links-copy {
  flex: 1 1 280px;
}

.project-links .links-copy .kicker {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.project-links .links-copy h3 {
  margin: 0 0 6px;
  color: var(--white);
  font-size: 20px;
  text-transform: uppercase;
}

.project-links .links-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  line-height: 1.5;
}

.links-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

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

.button.primary {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.button.primary:hover {
  background: #f02238;
}

.button.ghost {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ---------- Back link ---------- */
.back-bar {
  max-width: 980px;
  margin: 0 auto;
  padding-top: 8px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--red);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.back-link:hover {
  color: var(--red);
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 6vw, 88px) 36px;
  color: rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(90deg, rgba(227, 27, 47, 0.08), rgba(7, 9, 13, 0) 34%),
    linear-gradient(180deg, #11151d 0%, #07090d 74%),
    #07090d;
}

.footer::before {
  position: absolute;
  top: 0;
  left: clamp(18px, 6vw, 88px);
  width: 72px;
  height: 3px;
  content: "";
  background: var(--red);
}

.footer strong,
.footer span {
  display: block;
}

.footer strong {
  color: var(--white);
  margin-bottom: 6px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  font-weight: 700;
}

.footer-links a.footer-mail {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-bottom: 2px solid rgba(227, 27, 47, 0.65);
  color: rgba(255, 255, 255, 0.88);
  transition: border-color 160ms ease, color 160ms ease;
}

.footer-links a.footer-mail:hover {
  color: var(--white);
  border-color: var(--red);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-header nav {
    display: none;
  }

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

@media (max-width: 520px) {
  .button {
    width: 100%;
  }
}
