/* RK Grid & Energy Solution — shared styles */
:root { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { font-family: 'Sora', 'Helvetica Neue', Arial, sans-serif; background: #F5F5F0; color: #0E1217; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif; letter-spacing: -0.025em; }

/* ---------- Image slots: real photo on top, blueprint placeholder underneath ---------- */
:where(.slot) { position: relative; }
.slot { overflow: hidden; background-color: #0B2E4F;
  background-image:
    linear-gradient(rgba(245,245,240,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,245,240,.07) 1px, transparent 1px),
    linear-gradient(rgba(245,245,240,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,245,240,.035) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px; }
.slot > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; filter: saturate(.85) contrast(1.02); }
.slot > .slot-label { position: absolute; left: 20px; bottom: 18px; z-index: 0; color: rgba(245,245,240,.55); font-size: 12px; line-height: 1.5; max-width: 80%; }
.slot > .slot-label b { display: block; color: rgba(245,245,240,.85); font-weight: 500; }
.slot > .shade { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

/* ---------- Registration marks (drawing-sheet corners) ---------- */
.reg { position: relative; }
.reg::before, .reg::after { content: ""; position: absolute; width: 14px; height: 14px; border-color: currentColor; opacity: .5; }
.reg::before { top: -1px; left: -1px; border-top: 1px solid; border-left: 1px solid; }
.reg::after { bottom: -1px; right: -1px; border-bottom: 1px solid; border-right: 1px solid; }

/* ---------- One-line diagrams: draw once ---------- */
.oneline path, .oneline line, .oneline circle, .oneline rect, .oneline polyline { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.4s cubic-bezier(.6,0,.2,1) .3s forwards; }
.oneline .late { animation-delay: 1.1s; }
/* Diagrams further down the page wait until scrolled into view */
.oneline.on-view path, .oneline.on-view line, .oneline.on-view circle, .oneline.on-view rect, .oneline.on-view polyline { animation-play-state: paused; }
.oneline.on-view.in path, .oneline.on-view.in line, .oneline.on-view.in circle, .oneline.on-view.in rect, .oneline.on-view.in polyline { animation-play-state: running; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Header ---------- */
#siteHeader { transition: background-color .3s ease, border-color .3s ease; }
#siteHeader.solid { background-color: rgba(14,18,23,.97); border-color: rgba(245,245,240,.12); }
.nav-main a[aria-current="page"] { color: #F5F5F0; box-shadow: inset 0 -1px 0 #FFC300; padding-bottom: 4px; }
#mobileNav a[aria-current="page"] { color: #FFC300; }

/* ---------- Focus ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid #FFC300; outline-offset: 3px; }

/* ---------- Form fields (on dark) ---------- */
.field { width: 100%; background: transparent; border: 0; border-bottom: 1px solid rgba(245,245,240,.28); padding: 14px 0 12px; color: #F5F5F0; font-size: 16px; border-radius: 0; transition: border-color .2s; }
.field:focus { outline: none; border-bottom-color: #FFC300; }
.field::placeholder { color: rgba(245,245,240,.35); }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #F5F5F0 50%), linear-gradient(135deg, #F5F5F0 50%, transparent 50%); background-position: calc(100% - 12px) 22px, calc(100% - 6px) 22px; background-size: 6px 6px; background-repeat: no-repeat; }
select.field option { color: #0E1217; }
.field.invalid { border-bottom-color: #E0654A; }

/* ---------- Buttons ---------- */
:where(.btn) { display: inline-flex; }
.btn { align-items: center; gap: 14px; padding: 18px 28px; font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 15px; letter-spacing: .01em; transition: background-color .2s, color .2s, border-color .2s; }
.btn-signal { background: #FFC300; color: #0E1217; }
.btn-signal:hover { background: #F5F5F0; }
.btn-line { border: 1px solid currentColor; }
.btn-line:hover { background: #F5F5F0; color: #0E1217; border-color: #F5F5F0; }
.btn-ink { border: 1px solid #0E1217; color: #0E1217; }
.btn-ink:hover { background: #0E1217; color: #F5F5F0; }

/* ---------- Services page index ---------- */
.toc a { display: block; padding: 10px 0 10px 16px; border-left: 1px solid #D9D9D1; color: #5B6470; font-size: 14px; transition: color .2s, border-color .2s; }
.toc a:hover { color: #0E1217; }
.toc a.active { color: #0E1217; border-left-color: #FFC300; border-left-width: 3px; padding-left: 14px; }

/* ---------- Scope lists ---------- */
.scope li { padding: 12px 0; border-bottom: 1px solid #D9D9D1; font-size: 15px; line-height: 1.5; }
.scope.dark li { border-bottom-color: rgba(245,245,240,.15); }

/* ---------- Project filter ---------- */
.filter-btn { padding: 10px 18px; border: 1px solid #D9D9D1; font-size: 14px; color: #5B6470; transition: background-color .2s, color .2s, border-color .2s; }
.filter-btn:hover { color: #0E1217; border-color: #0E1217; }
.filter-btn[aria-pressed="true"] { background: #0E1217; border-color: #0E1217; color: #F5F5F0; }
[data-project][hidden] { display: none; }

/* ---------- FAQ ---------- */
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 24px; padding: 26px 0; font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 20px; letter-spacing: -0.02em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .pm { position: relative; flex: none; width: 16px; height: 16px; margin-top: 6px; }
.faq summary .pm::before, .faq summary .pm::after { content: ""; position: absolute; background: currentColor; left: 0; top: 7.5px; width: 16px; height: 1px; transition: transform .25s; }
.faq summary .pm::after { transform: rotate(90deg); }
.faq details[open] summary .pm::after { transform: rotate(0deg); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .oneline path, .oneline line, .oneline circle, .oneline rect, .oneline polyline { animation: none !important; stroke-dashoffset: 0 !important; }
}
