:root {
  color-scheme: light dark;
  --page: #f7f7f5;
  --ink: #202724;
  --muted: #5c665f;
  --line: #d8ddd9;
  --soft: #e9ece8;
  --panel: #f0f2ee;
  --art: #dfe6df;
  --accent: #65866c;
  --focus: #416d55;
  --button-ink: #f7f7f5;
  --shadow: 0 20px 64px rgba(25, 39, 30, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #111413;
    --ink: #f1f3ef;
    --muted: #a8b1ab;
    --line: #373e39;
    --soft: #1b211d;
    --panel: #202622;
    --art: #29382e;
    --accent: #a6c8ac;
    --focus: #b9d8c0;
    --button-ink: #111413;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

a:focus-visible,
button:focus-visible,
.gallery-viewport:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}

::selection {
  background: var(--accent);
  color: var(--page);
}

.site-shell {
  width: min(100% - 72px, 1192px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 24px;
  z-index: 5;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--page);
}

.skip-link:focus { top: 16px; }

.site-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand,
.footer-brand {
  font-size: 1.18rem;
  font-weight: 750;
  letter-spacing: -.045em;
}

.brand span,
.accent { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: .84rem;
  font-weight: 600;
}

.site-nav a,
.text-link,
.site-footer a {
  transition: color .2s ease;
}

.site-nav a:hover,
.text-link:hover,
.site-footer a:hover {
  color: var(--accent);
}

.hero {
  min-height: 430px;
  padding: 72px 0 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.art-topline {
  font-weight: 600;
}

.hero h1 {
  margin: 25px 0 11px -6px;
  font-size: clamp(4.8rem, 11vw, 10.2rem);
  font-weight: 620;
  letter-spacing: -.065em;
  line-height: .96;
}

.hero-tagline {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.4vw, 1.72rem);
  font-weight: 520;
  letter-spacing: -.025em;
}

.hero-description {
  max-width: 540px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 34px;
  padding-bottom: 6px;
  border-bottom: 1px solid currentColor;
  font-size: .86rem;
  font-weight: 650;
}

.featured {
  padding: 14px 0 100px;
  scroll-margin-top: 24px;
}

.section-heading {
  margin-bottom: 27px;
}

.section-heading h2,
.about h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  font-weight: 570;
  letter-spacing: -.035em;
  line-height: 1.15;
}

.project-feature {
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(0, 52%) minmax(0, 48%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.project-feature + .project-feature {
  margin-top: 32px;
}

.project-copy {
  min-width: 0;
  padding: clamp(30px, 4vw, 54px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 38px;
}

.project-copy h3 {
  max-width: 590px;
  margin: 18px 0 20px;
  font-size: clamp(2.65rem, 5vw, 4.8rem);
  font-weight: 600;
  letter-spacing: -.055em;
  line-height: 1.02;
}

.project-summary {
  max-width: 530px;
  margin: 0;
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  line-height: 1.65;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 24px;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--button-ink);
  font-size: .84rem;
  font-weight: 700;
  transition: transform .2s ease, opacity .2s ease;
}

.primary-link:hover {
  transform: translateY(-1px);
  opacity: .9;
}

.access-note {
  color: var(--muted);
  font-size: .8rem;
}

.project-gallery {
  container-type: inline-size;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--art);
  border-left: 1px solid var(--line);
}

.gallery-viewport {
  min-width: 0;
  flex: 1;
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.gallery-viewport::-webkit-scrollbar { display: none; }

.gallery-slide {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.project-art {
  position: relative;
  min-width: 0;
  min-height: 570px;
  height: 100%;
  padding: 66px 34px 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--art);
}

.project-art::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .24;
  background-image:
    linear-gradient(to right, var(--muted) 1px, transparent 1px),
    linear-gradient(to bottom, var(--muted) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to right, transparent 0, #000 40%);
}

.art-topline {
  position: absolute;
  z-index: 2;
  left: 30px;
  right: 30px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: .74rem;
}

.art-topline { top: 25px; }

.facility-map {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  height: auto;
  color: var(--ink);
}

.map-line {
  stroke: currentColor;
  stroke-width: 1.8;
}

.map-line.soft {
  opacity: .5;
  stroke-width: 1.25;
}

.map-node rect,
.map-badge rect {
  fill: var(--page);
  stroke: var(--line);
}

.map-node circle {
  fill: var(--accent);
}

.map-node text,
.map-badge text {
  fill: var(--ink);
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

.map-connector {
  stroke: var(--muted);
  stroke-width: 1.4;
  stroke-dasharray: 4 6;
}

.map-hub {
  fill: var(--page);
  stroke: var(--accent);
  stroke-width: 2;
}

.map-check {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-badge .small {
  fill: var(--muted);
  font-size: 7px;
  letter-spacing: .12em;
}

.art-workflow {
  background: var(--soft);
}

.art-workflow::before {
  opacity: .14;
}

.workflow-diagram {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
}

.workflow-step {
  min-width: 0;
  padding: 18px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workflow-index {
  color: var(--accent);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .12em;
}

.workflow-step strong {
  font-size: .84rem;
  line-height: 1.25;
}

.workflow-step span:last-child {
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.45;
}

.workflow-arrow {
  align-self: center;
  color: var(--muted);
  font-size: 1.15rem;
}

.art-roles {
  background: var(--art);
}

.roles-diagram {
  position: relative;
  z-index: 1;
  width: min(100%, 510px);
  height: 330px;
}

.role-card {
  position: absolute;
  z-index: 2;
  width: 190px;
  min-height: 68px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
}

.role-card strong,
.role-card span {
  display: block;
}

.role-card strong {
  font-size: .82rem;
}

.role-card div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .67rem;
}

.role-marker {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid !important;
  place-items: center;
  background: var(--soft);
  color: var(--focus);
  font-size: .72rem;
  font-weight: 800;
}

.role-operator { top: 20px; left: 0; }
.role-supervisor { top: 125px; right: 0; }
.role-admin { bottom: 16px; left: 34px; }

.roles-hub {
  position: absolute;
  z-index: 2;
  top: 120px;
  left: 50%;
  width: 132px;
  height: 132px;
  transform: translateX(-50%);
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.roles-hub span {
  color: var(--muted);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.roles-hub strong {
  margin-top: 2px;
  font-size: .94rem;
}

.role-line {
  position: absolute;
  z-index: 1;
  height: 1px;
  background: var(--muted);
  transform-origin: left center;
  opacity: .6;
}

.line-a {
  width: 125px;
  top: 96px;
  left: 164px;
  transform: rotate(28deg);
}

.line-b {
  width: 112px;
  top: 177px;
  left: 320px;
  transform: rotate(-2deg);
}

.line-c {
  width: 110px;
  top: 257px;
  left: 180px;
  transform: rotate(-30deg);
}

.gallery-footer {
  min-height: 58px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.gallery-footer[hidden] {
  display: none;
}

.gallery-controls {
  display: flex;
  align-items: center;
  gap: 9px;
}

.gallery-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, opacity .2s ease;
}

.gallery-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--soft);
}

.gallery-button:disabled {
  opacity: .35;
  cursor: default;
}

.gallery-counter {
  min-width: 48px;
  color: var(--muted);
  text-align: center;
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
}

.about {
  padding: 85px 0 96px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr);
  gap: clamp(40px, 8vw, 110px);
  align-items: start;
}

.about-text {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.12rem, 2vw, 1.52rem);
  line-height: 1.6;
  letter-spacing: -.02em;
}

.about-contact {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: .94rem;
}

.about-contact a {
  color: var(--ink);
  border-bottom: 1px solid currentColor;
  transition: color .2s ease;
}

.about-contact a:hover { color: var(--accent); }

.site-footer {
  min-height: 124px;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
}

.footer-brand {
  color: var(--ink);
  font-size: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

@media (max-width: 860px) {
  .site-shell {
    width: min(100% - 40px, 720px);
  }

  .site-header { min-height: 80px; }

  .hero {
    min-height: 385px;
    padding: 58px 0 64px;
  }

  .hero h1 {
    margin-left: -3px;
    font-size: clamp(4rem, 14vw, 7rem);
  }

  .project-feature {
    grid-template-columns: 1fr;
  }

  .project-copy {
    padding: 34px;
  }

  .project-gallery {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .project-art {
    min-height: 420px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 520px) {
  .site-shell {
    width: calc(100% - 32px);
  }

  .site-header {
    min-height: 72px;
  }

  .brand {
    font-size: 1.05rem;
  }

  .site-nav {
    gap: 20px;
    font-size: .78rem;
  }

  .hero {
    min-height: 350px;
    padding: 50px 0 56px;
  }

  .hero h1 {
    font-size: clamp(3.65rem, 17vw, 5rem);
    letter-spacing: -.055em;
  }

  .hero-tagline {
    font-size: 1.2rem;
  }

  .hero-description {
    font-size: .92rem;
    line-height: 1.65;
  }

  .featured {
    padding-bottom: 72px;
  }

  .project-copy {
    min-height: 0;
    padding: 24px 22px 26px;
    gap: 28px;
  }

  .project-copy h3 {
    margin-top: 15px;
    font-size: clamp(2.3rem, 11vw, 3.3rem);
    letter-spacing: -.045em;
  }

  .project-summary {
    font-size: .98rem;
  }

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

  .primary-link {
    width: 100%;
  }

  .project-art {
    min-height: 320px;
    padding: 46px 14px 45px;
  }

  .art-topline {
    left: 16px;
    right: 16px;
    font-size: .68rem;
  }

  .art-topline {
    top: 14px;
  }

  .facility-map {
    width: 105%;
    max-width: none;
  }

  .workflow-diagram {
    grid-template-columns: 1fr;
    gap: 7px;
    width: 86%;
  }

  .workflow-arrow {
    display: none;
  }

  .workflow-step {
    min-height: 68px;
    padding: 10px 12px;
  }

  .workflow-step span:last-child {
    font-size: .64rem;
  }

  .gallery-footer {
    padding: 9px 12px;
  }

  .about {
    padding: 66px 0 70px;
  }

  .site-footer {
    align-items: flex-start;
  }

  .site-footer > span:nth-child(2) {
    width: 100%;
    order: 3;
  }
}

/* Stack the roles diagram when the gallery is too narrow for the radial layout. */
@container (max-width: 559px) {
  .roles-diagram {
    width: 86%;
    height: auto;
    display: grid;
    gap: 7px;
  }

  .role-card,
  .roles-hub {
    position: static;
    width: auto;
  }

  .role-card {
    min-height: 0;
    padding: 10px 12px;
  }

  .roles-hub {
    order: -1;
    height: auto;
    padding: 10px 12px;
    flex-direction: row;
    gap: 8px;
    transform: none;
    border-radius: 10px;
  }

  .roles-hub strong { margin-top: 0; }

  .role-line { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
