/* Kvalnes Labs homepage: calm industrial precision. */
.portfolio-body {
  background:
    radial-gradient(ellipse 90% 58% at 86% -12%, rgba(239, 168, 96, 0.24), transparent 68%),
    radial-gradient(ellipse 65% 42% at 5% 72%, rgba(92, 126, 113, 0.14), transparent 72%),
    #cfd8d1;
  color: #243330;
  overflow-x: hidden;
}

.portfolio-body .site-header,
.portfolio-body .portfolio-main,
.portfolio-footer { width: min(1340px, calc(100% - 56px)); margin-right: auto; margin-left: auto; }

.portfolio-body .site-header {
  margin-top: 26px; padding: 0 0 15px; border: 0; border-bottom: 1px solid rgba(110, 132, 122, 0.48);
  border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none;
}
.portfolio-body .brand span { border-radius: 3px; background: #2c4641; box-shadow: none; }
.portfolio-body .site-nav { gap: 22px; }
.portfolio-body .site-nav .site-link { color: #4c5e59; font-size: 0.88rem; font-weight: 700; text-decoration: none; }
.portfolio-body .site-nav .site-link:hover,
.portfolio-body .site-nav .site-link:focus-visible { color: #183632; }

.portfolio-body .portfolio-main { max-width: none; margin-top: clamp(1.75rem, 4vw, 4rem); padding: 0 0 clamp(4.5rem, 8vw, 7rem); }
.portfolio-body .portfolio-flow { display: flex; flex-direction: column; gap: clamp(4.75rem, 8vw, 8rem); }

.portfolio-body .labs-hero {
  display: grid; grid-template-columns: minmax(310px, 0.82fr) minmax(500px, 1.18fr); gap: clamp(2.5rem, 5vw, 5.75rem);
  position: relative; isolation: isolate; align-items: center; min-height: 620px; padding: clamp(2.5rem, 5vw, 5.25rem);
  border: 1px solid rgba(132, 167, 154, 0.7); border-radius: 10px;
  background: linear-gradient(128deg, #3b6157 0%, #2b4a43 53%, #1f3934 100%);
  box-shadow: 0 34px 72px rgba(42, 62, 54, 0.24), 0 2px 0 rgba(255, 228, 191, 0.13) inset, 0 0 70px rgba(238, 160, 88, 0.1);
  text-align: left;
}
.portfolio-body .labs-hero::before,
.portfolio-body .labs-hero::after { display: none; }
.portfolio-body .labs-hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  display: block;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 62% 72% at 102% -6%, rgba(252, 191, 120, 0.3), transparent 66%),
    linear-gradient(112deg, rgba(255, 235, 204, 0.08), transparent 34%);
  pointer-events: none;
}
.portfolio-body .hero-intro,
.portfolio-body .hero-system-proof { position: relative; z-index: 1; }
.portfolio-body .hero-intro { display: grid; align-content: center; gap: 1.4rem; min-width: 0; max-width: 31rem; }
.portfolio-body .eyebrow,
.portfolio-body .hero-system-brief span { color: #9ed1c4; }
.portfolio-body .labs-hero h1 {
  max-width: 8.5ch; margin: 0; color: #edf1eb; font-size: clamp(3.5rem, 5.5vw, 6.15rem); font-weight: 760;
  letter-spacing: -0.065em; line-height: 0.9;
}
.portfolio-body .labs-hero .hero-lead { max-width: 28rem; margin: 0; color: #cfdbd4; font-size: clamp(1.02rem, 1.25vw, 1.2rem); line-height: 1.55; overflow-wrap: anywhere; }
.portfolio-body .labs-meta { max-width: 29rem; gap: 0.6rem 0; }
.portfolio-body .labs-meta span { color: #d6e0d9; border-color: rgba(211, 226, 217, 0.3); font-size: 0.72rem; }
.portfolio-body .hero-project-link {
  width: fit-content; margin-top: 0.3rem; padding: 0.9rem 1.1rem; border: 1px solid #9ed1c4; background: #9ed1c4;
  color: #1d3531; font-size: 0.83rem; font-weight: 800; letter-spacing: 0.01em;
}
.portfolio-body .hero-project-link:hover,
.portfolio-body .hero-project-link:focus-visible { border-color: #c2e2d8; background: #c2e2d8; outline: 3px solid rgba(194, 226, 216, 0.28); outline-offset: 3px; }

.portfolio-body .hero-system-proof {
  display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; min-height: 500px; overflow: hidden; border: 1px solid rgba(220, 235, 226, 0.38);
  border-radius: 6px; background: #203b36; box-shadow: 0 18px 36px rgba(13, 30, 27, 0.25), 0 1px 0 rgba(255, 231, 199, 0.2) inset;
}
.portfolio-body .hero-primary-proof { position: relative; display: block; grid-column: 1; grid-row: 1; min-height: 0; overflow: hidden; background: #1d312e; }
.portfolio-body .hero-primary-proof::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(180deg, transparent, rgba(20, 37, 34, 0.4)); pointer-events: none; }
.portfolio-body .hero-primary-proof img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: sepia(0.06) saturate(0.9) contrast(1.04); transition: transform 420ms ease; }
.portfolio-body .hero-primary-proof:hover img { transform: scale(1.025); }
.portfolio-body .proof-label { position: absolute; z-index: 1; bottom: 0; left: 0; padding: 0.62rem 0.75rem; background: #2c4641; color: #e0ebe4; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.portfolio-body .hero-system-brief { display: grid; grid-column: 1; grid-row: 2; grid-template-columns: minmax(160px, 0.7fr) minmax(180px, 1fr) minmax(200px, 1.15fr); gap: 1.25rem; align-items: end; padding: 1.1rem 1.2rem 1.2rem; border-top: 1px solid rgba(220, 235, 226, 0.28); color: #e7eee9; }
.portfolio-body .hero-system-brief span { align-self: start; font-size: 0.67rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.portfolio-body .hero-system-brief strong { color: #edf1eb; font-size: 1rem; line-height: 1.08; }
.portfolio-body .hero-system-brief p { margin: 0; color: #c8d5ce; font-size: 0.8rem; line-height: 1.4; }

.portfolio-body .content-section { width: 100%; margin: 0; }
.portfolio-body .section-title { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 0.6fr); gap: 1rem 3rem; align-items: end; max-width: none; margin: 0 0 2rem; }
.portfolio-body .section-title h2 { max-width: 12ch; margin: 0; color: #243330; font-size: clamp(2.45rem, 4.25vw, 4.7rem); font-weight: 760; letter-spacing: -0.06em; line-height: 0.92; }
.portfolio-body .section-title .eyebrow { margin: 0 0 0.7rem; }
.portfolio-body .section-title .muted { max-width: 33rem; margin: 0 0 0.28rem; color: #5a6a64; line-height: 1.55; }

.portfolio-body .approach-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; padding: 1px; list-style: none; border: 1px solid #b5c2ba; background: #b5c2ba; }
.portfolio-body .approach-grid li { min-height: 218px; padding: 1.5rem; background: linear-gradient(145deg, #e7ece5, #dbe3db); box-shadow: 0 1px 0 rgba(255, 248, 234, 0.65) inset; }
.portfolio-body .approach-grid span { display: block; color: #53766d; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; }
.portfolio-body .approach-grid h3 { margin: 2.6rem 0 0.7rem; color: #29413c; font-size: 1.32rem; line-height: 1.05; }
.portfolio-body .approach-grid p { max-width: 25rem; margin: 0; color: #596b65; line-height: 1.5; }

.portfolio-body #projects { order: 1; }
.portfolio-body #approach { order: 2; }
.portfolio-body #background { order: 3; }
.portfolio-body #education { order: 4; }
.portfolio-body .workstation-section { order: 5; }

.portfolio-body .project-card-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.portfolio-body .project-card { display: flex; grid-column: span 4; min-height: 250px; padding: 1.6rem; border: 1px solid #b2c0b6; border-radius: 7px; background: linear-gradient(145deg, #eef2eb, #dde5dc); box-shadow: 0 12px 26px rgba(63, 81, 71, 0.07), 0 1px 0 rgba(255, 250, 235, 0.82) inset; }
.portfolio-body .project-card--engineering { grid-column: span 6; min-height: 320px; padding: 2rem; background: linear-gradient(145deg, #dce5da, #c7d4ca); }
.portfolio-body .project-card--engineering:first-child { grid-column: span 7; background: #31544d; border-color: #31544d; color: #edf2ed; }
.portfolio-body .project-card--engineering:nth-child(2) { grid-column: span 5; }
.portfolio-body .project-card h3 { color: #29413c; font-size: 1.6rem; line-height: 1.04; }
.portfolio-body .project-card p { color: #5b6b65; line-height: 1.55; }
.portfolio-body .project-card--engineering:first-child h3 { color: #eff3ee; }
.portfolio-body .project-card--engineering:first-child p,
.portfolio-body .project-card--engineering:first-child > .pill { color: #c8ddd5; }
.portfolio-body .project-card--engineering:first-child .button-link { color: #b8ddd2; }
.portfolio-body .project-card:hover { transform: translateY(-3px); border-color: #79978d; box-shadow: 0 12px 24px rgba(40, 59, 54, 0.08); }

.portfolio-body #background { display: grid; grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1.45fr); gap: 2rem; padding-top: 0.25rem; }
.portfolio-body #background::before { content: "Background"; color: #53766d; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.portfolio-body .experience-details { border-top: 1px solid #aebdb4; border-bottom: 1px solid #aebdb4; }
.portfolio-body .experience-details summary { color: #29413c; font-size: clamp(1.65rem, 2.5vw, 2.4rem); font-weight: 760; letter-spacing: -0.045em; }
.portfolio-body #education { max-width: 900px; padding: 2rem; border-left: 3px solid #86aa9f; background: #e8ede8; }
.portfolio-body #education .section-title h2 { font-size: 1.2rem; letter-spacing: 0; }

.portfolio-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid #b5c2ba; color: #60716b; font-size: 0.8rem; }
.portfolio-footer span:first-child { color: #2d4641; font-weight: 800; }

@media (max-width: 1020px) {
  .portfolio-body .labs-hero { grid-template-columns: 1fr; min-height: 0; }
  .portfolio-body .hero-intro { max-width: 40rem; }
  .portfolio-body .hero-system-proof { min-height: 560px; }
}

@media (max-width: 700px) {
  .portfolio-body .site-header,
  .portfolio-body .portfolio-main,
  .portfolio-footer { width: calc(100% - 32px); }
  .portfolio-body .site-header { margin-top: 16px; }
  .portfolio-body .site-nav { gap: 14px; }
  .portfolio-body .site-nav .site-link { font-size: 0.76rem; }
  .portfolio-body .portfolio-main { margin-top: 1.25rem; }
  .portfolio-body .portfolio-flow { gap: 4rem; }
  .portfolio-body .labs-hero { gap: 2.5rem; min-height: 0; padding: 1.5rem; border-radius: 5px; }
  .portfolio-body .labs-hero h1 { max-width: 8.2ch; font-size: clamp(3.2rem, 14vw, 4.65rem); }
  .portfolio-body .labs-hero .eyebrow { max-width: 30ch; font-size: 0.65rem; line-height: 1.45; white-space: normal; }
  .portfolio-body .labs-hero .hero-lead { padding-right: 0.25rem; font-size: 0.96rem; }
  .portfolio-body .labs-meta { display: grid; gap: 0.45rem; }
  .portfolio-body .labs-meta span { padding: 0; border: 0; }
  .portfolio-body .hero-system-proof { min-height: 0; }
  .portfolio-body .hero-primary-proof { min-height: 320px; }
  .portfolio-body .hero-system-brief { grid-template-columns: 1fr; gap: 0.65rem; padding: 1rem; }
  .portfolio-body .section-title { grid-template-columns: 1fr; gap: 0.8rem; }
  .portfolio-body .section-title h2 { max-width: 10ch; }
  .portfolio-body .approach-grid { grid-template-columns: 1fr; }
  .portfolio-body .approach-grid li { min-height: 0; }
  .portfolio-body .approach-grid h3 { margin-top: 1.75rem; }
  .portfolio-body .project-card,
  .portfolio-body .project-card--engineering,
  .portfolio-body .project-card--engineering:first-child,
  .portfolio-body .project-card--engineering:nth-child(2) { grid-column: 1 / -1; min-height: 0; }
  .portfolio-body #background { grid-template-columns: 1fr; gap: 0.7rem; }
  .portfolio-body #education { padding: 1.5rem; }
  .portfolio-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-body .hero-primary-proof img,
  .portfolio-body .project-card { transition: none; }
}
