:root {
  --portfolio-red: #e52d2d;
  --portfolio-red-dark: #a91717;
  --portfolio-black: #050505;
  --portfolio-panel: #0b0b0c;
  --portfolio-border: #29292b;
  --portfolio-copy: #a7a7aa;
  --portfolio-white: #f5f5f3;
}

html, body { width: 100%; max-width: 100%; overflow-x: hidden; overflow-x: clip; }
body { min-width: 0; background: var(--portfolio-black); color: var(--portfolio-white); font-family: Roboto, sans-serif; }
main, section, header, footer { max-width: 100%; }
body > header { background: rgba(5, 5, 5, .96); border-color: var(--portfolio-border); }
body > header .container-narrow { max-width: 1920px; min-height: 50px; padding-inline: 24px; }
body > header img { height: 26px; width: auto; }
body > header nav a { border-radius: 0; background: transparent !important; color: #d2d2d3; font-size: .84rem; letter-spacing: .08em; text-transform: uppercase; }
body > header nav a:hover, body > header nav a[aria-current="page"] { color: var(--portfolio-red); }
body > header nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--portfolio-red); }

.portfolio-shell { width: min(100% - 128px, 1800px); margin-inline: auto; }
.portfolio-kicker { margin: 0; color: var(--portfolio-red); font-size: .82rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.portfolio-hero { min-height: clamp(560px, 50vw, 640px); position: relative; display: grid; align-items: stretch; overflow: hidden; border-bottom: 1px solid var(--portfolio-border); background: #050505; }
.portfolio-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #050505 0%, #050505 42%, rgba(5,5,5,.76) 58%, rgba(5,5,5,.18) 100%); }
.portfolio-hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: none; }
.portfolio-grid-lines { position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 90px 90px; mask-image: linear-gradient(90deg, transparent 25%, #000 70%); }
.portfolio-hero-content { position: relative; z-index: 1; padding-block: 48px 24px; display: grid; grid-template-rows: 1fr auto; }
.portfolio-hero-content > div:first-child { max-width: 640px; }
.portfolio-hero h1, .portfolio-page-hero h1 { margin: 16px 0; max-width: 680px; color: var(--portfolio-white); font-family: Roboto, sans-serif; font-size: clamp(4rem, 5.5vw, 6.2rem); font-weight: 900; line-height: .92; letter-spacing: .005em; text-transform: uppercase; }
.portfolio-hero h1 span { color: var(--portfolio-red); }
.portfolio-intro, .portfolio-page-hero p { max-width: 540px; color: var(--portfolio-copy); font-size: 1rem; line-height: 1.75; }
.portfolio-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.portfolio-button, .portfolio-text-link { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 20px; border: 1px solid #3a3a3c; padding: 0 26px; color: #fff; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; transition: border-color .2s, background-color .2s, transform .2s; }
.portfolio-button:hover, .portfolio-text-link:hover { border-color: var(--portfolio-red); color: #fff; transform: translateY(-2px); }
.portfolio-button.primary { border-color: #f04444; background: linear-gradient(135deg, var(--portfolio-red), var(--portfolio-red-dark)); }
.portfolio-button.primary:hover { background: #f03b3b; }
.portfolio-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 30px 0 0; padding: 24px 0 0; border-top: 1px solid var(--portfolio-border); }
.portfolio-stats div { display: grid; grid-template-columns: 50px 1fr; align-items: start; gap: 12px; padding: 0 24px; border-left: 1px solid #4a1c1c; }
.portfolio-stats div:first-child { padding-left: 0; border-left: 0; }
.portfolio-stats svg { width: 50px; height: 50px; margin-top: 1px; fill: none; stroke: var(--portfolio-red); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.portfolio-stats dt { color: #eee; font-size: 1.08rem; font-weight: 800; text-transform: capitalize; }
.portfolio-stats dd { margin: 4px 0 0; color: #aaa; font-size: .875rem; line-height: 1.4; }

.portfolio-section { padding-block: 42px; border-bottom: 1px solid var(--portfolio-border); background: radial-gradient(circle at 50% 0, #131313 0, #080808 48%, #050505 100%); }
.portfolio-section h2, .portfolio-cta h2 { margin: 5px 0 0; color: var(--portfolio-white); font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 850; line-height: 1.1; }
.portfolio-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.portfolio-text-link { min-height: 42px; }
.portfolio-project-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.portfolio-project-card { min-width: 0; overflow: hidden; border: 1px solid var(--portfolio-border); background: #0d0d0e; transition: transform .2s, border-color .2s; }
.portfolio-project-card:hover { border-color: #853232; transform: translateY(-3px); }
.portfolio-project-card a { color: inherit; text-decoration: none; }
.portfolio-project-image-link { display: block; overflow: hidden; }
.portfolio-project-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--portfolio-border); filter: saturate(.85) brightness(.8); }
.portfolio-project-card-body { padding: 11px 12px 13px; }
.portfolio-project-card h3 { display: flex; justify-content: space-between; gap: 8px; margin: 0; color: #f1f1f1; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.portfolio-project-card h3 span, .portfolio-project-type { color: var(--portfolio-red); }
.portfolio-project-card h3 > a:first-child:hover { color: var(--portfolio-red); }
.portfolio-external-link { flex: 0 0 auto; color: var(--portfolio-red) !important; }
.portfolio-project-card p { margin: 8px 0 0; color: #b1b1b4; font-size: .875rem; line-height: 1.5; }
.portfolio-project-card .portfolio-project-type { margin-top: 6px; color: #ef5555; font-size: .78rem; }
.portfolio-centered-link { display: flex; justify-content: center; margin-top: 28px; }
.portfolio-split-section { padding-block: 36px; }
.portfolio-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); gap: 54px; }
.portfolio-approach { padding-left: 42px; border-left: 1px solid var(--portfolio-border); }
.portfolio-skill-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin-top: 18px; }
.portfolio-skill { min-height: 78px; display: grid; align-content: center; justify-items: center; gap: 8px; border: 1px solid var(--portfolio-border); background: linear-gradient(145deg, #131314, #090909); text-align: center; }
.portfolio-skill span { color: var(--portfolio-red); font-family: "Cascadia Mono", Consolas, monospace; font-size: 1.7rem; font-weight: 500; line-height: 1; }
.portfolio-skill strong { font-size: .84rem; font-weight: 650; }
.portfolio-approach ul { display: grid; gap: 14px; margin: 18px 0 0; padding: 0; list-style: none; }
.portfolio-approach li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; }
.portfolio-approach li > span { color: var(--portfolio-red); font-weight: 800; }
.portfolio-approach strong { color: #eee; font-size: 1rem; }
.portfolio-approach p { margin: 4px 0 0; color: #aaa; font-size: .86rem; line-height: 1.45; }
.portfolio-cta { border-bottom: 1px solid #4b1818; background: radial-gradient(circle at 70% 40%, #571414, #210909 50%, #0d0606 100%); }
.portfolio-cta .portfolio-shell { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding-block: 22px; }
.portfolio-cta p:last-child { margin: 8px 0 0; color: #aaa; }

body.portfolio-interior main > section.section-band:has(a[href="/schedule-a-meeting/"]) { border-color: #4b1818 !important; background: radial-gradient(circle at 70% 40%, #571414, #210909 50%, #0d0606 100%) !important; }
body.portfolio-interior main > section.section-band:has(a[href="/schedule-a-meeting/"]) .container-narrow { min-height: 112px; padding-block: 22px !important; }

.scroll-to-top { position: fixed; right: 24px; bottom: 24px; z-index: 50; width: 46px; height: 46px; border: 1px solid #f04444; background: linear-gradient(135deg, var(--portfolio-red), var(--portfolio-red-dark)); color: #fff; font-size: 1.35rem; line-height: 1; cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s, transform .2s, background-color .2s; }
.scroll-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.scroll-to-top:hover { background: #f03b3b; }
.scroll-to-top:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.portfolio-page-hero { padding-block: 80px; border-bottom: 1px solid var(--portfolio-border); background: #070707; }
.portfolio-page-hero-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 70px; }
.portfolio-page-hero img { width: 100%; max-height: 440px; object-fit: cover; filter: grayscale(1) brightness(.6) contrast(1.25); }
.portfolio-page-hero h1 { font-size: clamp(3.4rem, 6vw, 6.5rem); }
.portfolio-about-copy { display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; }
.portfolio-about-copy p { margin: 0 0 20px; color: var(--portfolio-copy); font-size: 1.05rem; line-height: 1.8; }
.featured-project-hero { padding-block: 70px; }
.featured-project-hero-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(520px, 1.18fr); align-items: center; gap: 64px; }
.featured-project-hero h1 { max-width: 760px; font-size: clamp(3rem, 4.3vw, 5rem) !important; overflow-wrap: anywhere; }
.featured-project-hero img { width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--portfolio-border); object-fit: cover; filter: saturate(.9) brightness(.82); }
.featured-project-type { margin: 24px 0 0; color: var(--portfolio-red); font-size: .85rem; font-weight: 800; text-transform: uppercase; }
.featured-project-overview .portfolio-shell { display: grid; grid-template-columns: .42fr 1fr; gap: 64px; }
.featured-project-copy { max-width: 850px; }
.featured-project-copy p { margin: 20px 0 0; color: var(--portfolio-copy); font-size: 1.05rem; line-height: 1.8; }

/* Bring every existing route into the same portfolio system. */
body.portfolio-interior > main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
body.portfolio-interior > main > section,
body.portfolio-interior > main > article {
  margin: 0 !important;
  border-width: 0 0 1px !important;
  border-color: var(--portfolio-border) !important;
  background: #070707 !important;
}
body.portfolio-interior > main > section + section,
body.portfolio-interior > main > article + section {
  margin-top: 0 !important;
}
body.portfolio-interior main .container-narrow {
  width: min(100% - 128px, 1800px);
  max-width: 1800px;
  margin-inline: auto;
  padding-inline: 0;
}
body.portfolio-interior main > section:first-child,
body.portfolio-interior main > article > header:first-child {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(117, 19, 19, .22), transparent 28rem),
    linear-gradient(105deg, #050505 0%, #090909 64%, #120707 100%) !important;
}
body.portfolio-interior main > section:first-child::after,
body.portfolio-interior main > article > header:first-child::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(90deg, transparent 35%, #000);
}
body.portfolio-interior main > section:first-child > *,
body.portfolio-interior main > article > header:first-child > * {
  position: relative;
  z-index: 1;
}
body.portfolio-interior main > section:first-child .container-narrow,
body.portfolio-interior main > article > header.container-narrow {
  min-height: 360px !important;
  display: grid;
  align-content: center;
  padding-block: 64px !important;
}
body.portfolio-interior main > section:first-child h1,
body.portfolio-interior main > article > header h1 {
  max-width: 1000px;
  margin-top: 16px !important;
  color: var(--portfolio-white) !important;
  font-family: Roboto, sans-serif !important;
  font-size: clamp(3.4rem, 5.6vw, 3.4rem) !important;
  font-weight: 900 !important;
  line-height: .94 !important;
  text-transform: uppercase;
}
body.portfolio-interior main > section:first-child p,
body.portfolio-interior main > article > header p {
  max-width: 780px;
}
body.portfolio-interior main .section-band,
body.portfolio-interior main section:not(:first-child) {
  padding-block: 54px !important;
}
body.portfolio-interior > main > section.portfolio-cta,
body.portfolio-interior > main > section.section-band:has(a[href="/schedule-a-meeting/"]) {
  padding-block: 0 !important;
  border-color: #4b1818 !important;
  background: radial-gradient(circle at 70% 40%, #571414, #210909 50%, #0d0606 100%) !important;
}
body.portfolio-interior > main > section.section-band:has(a[href="/schedule-a-meeting/"]) .container-narrow {
  min-height: 112px;
  padding-block: 22px !important;
}
body.portfolio-interior main .grid { column-gap: 18px; }
body.portfolio-interior main .card {
  overflow: hidden;
  border: 1px solid var(--portfolio-border) !important;
  background: linear-gradient(145deg, #111112, #090909) !important;
  transition: transform .2s ease, border-color .2s ease;
}
body.portfolio-interior main .card:hover {
  border-color: #883030 !important;
  transform: translateY(-3px);
}
body.portfolio-interior main .card img {
  filter: saturate(.82) brightness(.8);
  transition: filter .2s ease, transform .25s ease;
}
body.portfolio-interior main .card:hover img {
  filter: saturate(1) brightness(.95);
  transform: scale(1.015);
}
body.portfolio-interior main .button {
  min-height: 46px;
  border-radius: 0 !important;
  border-color: #3a3a3c !important;
  background: transparent !important;
  color: #fff !important;
  font-size: .7rem;
  letter-spacing: .08em !important;
  text-transform: uppercase;
}
body.portfolio-interior main .button-primary,
body.portfolio-interior main .bg-cobalt {
  border-color: #f04444 !important;
  background: linear-gradient(135deg, var(--portfolio-red), var(--portfolio-red-dark)) !important;
  color: #fff !important;
}
body.portfolio-interior main .prose-modern {
  max-width: 860px;
  margin-inline: auto;
  color: #b0b0b3;
}
body.portfolio-interior main .prose-modern h2,
body.portfolio-interior main .prose-modern h3 {
  color: var(--portfolio-white);
}
body.portfolio-interior main .prose-modern a { color: var(--portfolio-red); }
body.portfolio-interior main input,
body.portfolio-interior main select,
body.portfolio-interior main textarea {
  border-radius: 0 !important;
  border-color: #343436 !important;
  background: #090909 !important;
  color: #f1f1f1 !important;
}
body.portfolio-interior main input:focus,
body.portfolio-interior main select:focus,
body.portfolio-interior main textarea:focus {
  border-color: var(--portfolio-red) !important;
  box-shadow: 0 0 0 2px rgba(229,45,45,.18) !important;
}
main > .bg-paper, main > .section-band.bg-paper, main > section.bg-paper { background: #080808 !important; }
main > .bg-night, main > section.bg-night, main > .border-y.bg-night { background: #050505 !important; }
main .text-cobalt, main .text-tide, main .eyebrow { color: var(--portfolio-red) !important; }
main .button-primary, main .bg-cobalt { background: var(--portfolio-red) !important; color: #fff !important; }
main .card { border-color: var(--portfolio-border); border-radius: 0; background: #0d0d0e; }
main .border-line { border-color: var(--portfolio-border); }
main .text-ink { color: var(--portfolio-white); }
main .text-slate, main .text-muted { color: var(--portfolio-copy); }
main h1, main h2, main h3 { text-wrap: balance; }

body > footer { border-color: var(--portfolio-border); background: #050505; }
body > footer .container-narrow { max-width: 1800px; }
body > footer .text-lemon { color: var(--portfolio-red); }
body.portfolio-interior > footer { margin-top: 0; }

@media (max-width: 1000px) {
  .portfolio-project-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-skill-grid { grid-template-columns: repeat(3, 1fr); }
  .portfolio-split { grid-template-columns: 1fr; }
  .portfolio-approach { padding: 35px 0 0; border-left: 0; border-top: 1px solid var(--portfolio-border); }
}

@media (max-width: 767px) {
  body > header .container-narrow, body > footer .container-narrow { width: 100%; max-width: 100%; }
  body > header .container-narrow { padding-inline: 20px; }
  body > header nav a[aria-current="page"] { box-shadow: inset 3px 0 var(--portfolio-red); }
  .portfolio-shell { width: min(100% - 28px, 1320px); }
  .portfolio-hero { min-height: 760px; }
  .portfolio-hero::after { background: linear-gradient(180deg, rgba(5,5,5,.25), #050505 48%, #050505 100%); }
  .portfolio-hero-image { width: 100%; height: 46%; object-position: 72% center; }
  .portfolio-hero-content { align-content: end; padding-block: 280px 28px; }
  .portfolio-hero h1 { font-size: clamp(2.65rem, 11vw, 3.1rem); }
  .portfolio-intro { font-size: .92rem; }
  .portfolio-stats { grid-template-columns: 1fr 1fr; gap: 16px 0; margin-top: 38px; }
  .portfolio-stats div { padding-inline: 15px; }
  .portfolio-stats div:nth-child(3) { padding-left: 0; border-left: 0; }
  .portfolio-section { padding-block: 46px; }
  .portfolio-section-heading { align-items: start; flex-direction: column; }
  .portfolio-project-grid { grid-template-columns: minmax(0, 1fr); }
  .portfolio-skill-grid { grid-template-columns: 1fr 1fr; }
  .portfolio-skill { min-height: 86px; }
  .portfolio-cta .portfolio-shell { align-items: flex-start; flex-direction: column; padding-block: 42px; }
  .portfolio-page-hero { padding-block: 52px; }
  .portfolio-page-hero-grid, .portfolio-about-copy { grid-template-columns: 1fr; gap: 35px; }
  .featured-project-hero { padding-block: 44px; }
  .featured-project-hero-grid, .featured-project-overview .portfolio-shell { grid-template-columns: 1fr; gap: 32px; }
  .portfolio-page-hero h1 { font-size: 2.8rem; }
  body.portfolio-interior main .container-narrow { width: min(100% - 32px, 1800px); }
  body.portfolio-interior main > section:first-child .container-narrow,
  body.portfolio-interior main > article > header.container-narrow {
    min-height: 280px !important;
    padding-block: 44px !important;
  }
  body.portfolio-interior main > section:first-child h1,
  body.portfolio-interior main > article > header h1 {
    font-size: clamp(2.65rem, 12vw, 4rem) !important;
  }
  body.portfolio-interior main .section-band,
  body.portfolio-interior main section:not(:first-child) { padding-block: 40px !important; }
}

@media (max-width: 360px) {
  body > header .container-narrow { padding-inline: 14px; }
  .portfolio-shell { width: calc(100% - 20px); }
  .portfolio-actions { display: grid; grid-template-columns: 1fr; }
  .portfolio-button, .portfolio-text-link { width: 100%; padding-inline: 14px; }
  .portfolio-stats { grid-template-columns: 1fr; }
  .portfolio-stats div, .portfolio-stats div:nth-child(3) { padding: 12px 0; border-top: 1px solid #4a1c1c; border-left: 0; }
  .portfolio-stats div:first-child { border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-button, .portfolio-text-link, .portfolio-project-card { transition: none; }
  html:focus-within { scroll-behavior: auto; }
}
