/* KRD Systems — public site. Palette sampled from brand-source/logo.png + banner.png. */
:root {
  --navy: #061a40;
  --navy-2: #0b2a5e;
  --blue: #005fe6;
  --blue-600: #004fc2;
  --cyan: #00a8ff;
  --steel: #a3a7ae;
  --slate: #5f6e85;
  --ink: #0d1b33;
  --muted: #5f6e85;
  --line: #e3e8f0;
  --bg: #ffffff;
  --bg-tint: #f4f7fb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(6, 26, 64, .06), 0 8px 24px rgba(6, 26, 64, .06);
  --shadow-lg: 0 2px 4px rgba(6, 26, 64, .06), 0 24px 48px rgba(6, 26, 64, .12);
  --font-head: 'Montserrat', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-600); }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4.1rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
h1 em, h2 em { font-style: normal; color: var(--blue); }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- buttons / labels */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .85em 1.5em; border-radius: 10px; border: 2px solid var(--blue);
  background: var(--blue); color: #fff; font: 600 .95rem/1 var(--font-head); letter-spacing: .02em;
  transition: transform .18s var(--ease), background .18s, box-shadow .18s; cursor: pointer;
}
.btn:hover { background: var(--blue-600); border-color: var(--blue-600); color: #fff; box-shadow: 0 8px 20px rgba(0, 95, 230, .25); }
.btn:active { transform: scale(.97); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-tint); color: var(--navy); border-color: var(--steel); box-shadow: none; }
.btn-sm { padding: .6em 1.1em; font-size: .85rem; }
.eyebrow, .kicker {
  font: 600 .78rem/1 var(--font-head); letter-spacing: .32em; text-transform: uppercase; color: var(--blue); margin-bottom: 1.1em;
}
.kicker::before { content: ''; display: inline-block; width: 22px; height: 3px; background: var(--cyan); vertical-align: middle; margin-right: 10px; transform: skewX(-30deg); }
.kicker-light { color: var(--cyan); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 58ch; }

/* ---------- header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.brand-word { display: flex; flex-direction: column; line-height: 1; font-family: var(--font-head); }
.brand-word b { font-weight: 800; font-size: 1.15rem; letter-spacing: .04em; }
.brand-word span { font-weight: 600; font-size: .58rem; letter-spacing: .5em; color: var(--slate); margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { color: var(--ink); font: 500 .92rem var(--font-head); position: relative; }
.nav a:not(.btn)::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--blue); transform: scaleX(0); transition: transform .2s var(--ease); }
.nav a:not(.btn):hover::after { transform: scaleX(1); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; height: 2px; background: var(--navy); margin: 6px 0; transition: transform .2s; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- diagonal brand stripes (from the banner corners) */
.stripes { position: absolute; width: 380px; height: 380px; pointer-events: none; z-index: 0; }
.stripes-tl { top: 0; left: 0;
  background: linear-gradient(135deg, var(--navy) 0 14%, transparent 14% 16%, var(--blue) 16% 21%, transparent 21% 24%, rgba(0, 95, 230, .14) 24% 34%, transparent 34% 37%, rgba(0, 95, 230, .06) 37% 46%, transparent 46%); }
.stripes-br { bottom: 0; right: 0;
  background: linear-gradient(135deg, transparent 54%, rgba(0, 95, 230, .06) 54% 63%, transparent 63% 66%, rgba(0, 168, 255, .16) 66% 76%, transparent 76% 78%, var(--blue) 78% 84%, transparent 84% 86%, var(--navy) 86%); }
.stripes-dark.stripes-tl { background: linear-gradient(135deg, var(--blue) 0 12%, transparent 12% 15%, var(--cyan) 15% 18%, transparent 18% 22%, rgba(255, 255, 255, .06) 22% 34%, transparent 34%); }

/* ---------- hero */
.hero { position: relative; overflow: hidden; padding: clamp(64px, 10vw, 128px) 0 clamp(72px, 10vw, 120px); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
.hero-copy h1 { max-width: 16ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 440px; justify-self: end; width: 100%; }
.hero-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 24px; box-shadow: var(--shadow-lg); }
.stages { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* The logo mark's four "stages" (traced from brand-source/logo.png) animate in sequence. */
.stage { opacity: 0; animation: stage-in .7s var(--ease) forwards; }
.stage.s1 { fill: var(--navy); animation-delay: .05s; }
.stage.s2 { fill: var(--blue); animation-delay: .2s; }
.stage.s3 { fill: var(--cyan); animation-delay: .35s; }
.stage.s4 { fill: var(--steel); animation-delay: .5s; }
.hero-art.has-photo .stages { inset: auto -18px -18px auto; width: 34%; height: 34%; background: #fff; border-radius: 18px; padding: 14px; box-shadow: var(--shadow-lg); }
@keyframes stage-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- sections */
.section { padding: clamp(72px, 9vw, 112px) 0; position: relative; }
.section-tint { background: var(--bg-tint); }
[data-section][hidden] { display: none !important; }

.about { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.about-media img#about-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow-lg); }
.about-mark { aspect-ratio: 1; border-radius: 24px; background: var(--bg-tint); display: grid; place-items: center; padding: 18%; position: relative; overflow: hidden; }
.about-mark::after { content: ''; position: absolute; inset: auto -30% -30% auto; width: 70%; height: 70%; background: linear-gradient(135deg, transparent 50%, rgba(0, 95, 230, .1) 50%); }
.prose p { color: #33425c; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; margin: 2rem 0 0; }
.stats div { border-left: 3px solid var(--blue); padding: 4px 0 4px 16px; }
.stats dt { font: 800 1.7rem/1.1 var(--font-head); color: var(--navy); }
.stats dd { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }

.services { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; counter-reset: stage; }
.services li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); position: relative; overflow: hidden; counter-increment: stage; transition: transform .25s var(--ease), box-shadow .25s; }
.services li:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.services li::before { content: 'STAGE 0' counter(stage); display: block; font: 700 .72rem var(--font-head); letter-spacing: .28em; color: var(--blue); margin-bottom: 18px; }
.services li::after { content: ''; position: absolute; top: 0; right: 0; width: 64px; height: 64px; background: linear-gradient(225deg, var(--cyan) 0 20%, transparent 20%); opacity: .7; }
.services p { color: var(--muted); margin: 0; }

.timeline { list-style: none; padding: 0; margin: 2.5rem 0 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 23px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--blue), var(--cyan), var(--line)); }
.tl-item { display: grid; grid-template-columns: 48px 1fr; gap: 24px; padding-bottom: 36px; position: relative; }
.tl-dot { width: 48px; height: 48px; border-radius: 12px; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; overflow: hidden; z-index: 1; }
.tl-dot img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.tl-dot.empty::after { content: ''; width: 14px; height: 14px; background: var(--blue); transform: skewX(-20deg); }
.tl-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.tl-head h3 { margin: 0; }
.tl-when { font: 600 .8rem var(--font-head); color: var(--blue); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.tl-org { color: var(--slate); font-weight: 500; margin: 4px 0 12px; }
.tl-org a { color: inherit; border-bottom: 1px solid var(--line); }
.tl-card ul { margin: 12px 0 0; padding-left: 1.1em; color: #33425c; }
.tl-card li { margin-bottom: 4px; }
.tl-card li::marker { color: var(--blue); }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin-top: 2.5rem; }
.project { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; text-align: left; padding: 0; font: inherit; color: inherit; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s; }
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.project-cover { aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--navy), var(--blue)); position: relative; overflow: hidden; }
.project-cover img, .project-cover video { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.project:hover .project-cover img { transform: scale(1.04); }
.project-badge { position: absolute; left: 12px; top: 12px; background: rgba(6, 26, 64, .85); color: #fff; font: 600 .7rem var(--font-head); letter-spacing: .14em; text-transform: uppercase; padding: 6px 10px; border-radius: 6px; }
.project-count { left: auto; right: 12px; background: rgba(255, 255, 255, .9); color: var(--navy); }
.project-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project-body h3 { margin: 0; }
.project-body p { color: var(--muted); margin: 0; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 8px 0 0; }
.tags li, .chip { font: 500 .78rem var(--font-body); background: var(--bg-tint); color: var(--navy-2); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }

.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 2.5rem; }
.skill-group h3 { font-size: .8rem; letter-spacing: .26em; text-transform: uppercase; color: var(--slate); }
.skill-group div { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-group .chip { font-size: .9rem; padding: 7px 14px; background: #fff; }

.contact { position: relative; overflow: hidden; background: var(--navy); color: #c9d4e8; padding: clamp(72px, 9vw, 112px) 0; }
.contact h2 { color: #fff; }
.contact .lead { color: #aebcd6; }
.contact-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.contact-card { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; padding: 28px; display: grid; gap: 22px; }
.contact-form { display: grid; gap: 14px; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cf-field { display: grid; gap: 6px; }
.cf-field span { font: 600 .7rem var(--font-head); letter-spacing: .2em; text-transform: uppercase; color: #8fa1c2; }
.cf-field em { font-style: normal; letter-spacing: .05em; text-transform: none; color: #6f83a8; }
.cf-field input, .cf-field textarea {
  width: 100%; font: inherit; color: #fff; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px; padding: 11px 13px; transition: border-color .15s, background .15s;
}
.cf-field textarea { resize: vertical; min-height: 120px; }
.cf-field input:focus, .cf-field textarea:focus { outline: none; border-color: var(--cyan); background: rgba(255, 255, 255, .1); }
.cf-field input[aria-invalid="true"], .cf-field textarea[aria-invalid="true"] { border-color: #ff8a93; }
.cf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cf-actions .btn:disabled { opacity: .6; cursor: wait; }
.cf-status { margin: 0; font-size: .9rem; color: #aebcd6; }
.cf-status.ok { color: #7ee2b8; }
.cf-status.err { color: #ff8a93; }
.contact-form.sent .cf-row, .contact-form.sent .cf-field, .contact-form.sent .cf-actions .btn { display: none; }
.contact-form.sent .cf-status { font-size: 1.05rem; }
.contact-emails { display: grid; gap: 2px; }
.contact-emails a { word-break: break-all; }
.contact-meta { display: grid; gap: 14px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); }
.contact-meta:empty { display: none; }
.contact-row { display: flex; align-items: center; gap: 14px; color: #fff; }
.contact-row small { display: block; color: #8fa1c2; font: 600 .7rem var(--font-head); letter-spacing: .2em; text-transform: uppercase; }
.contact-row a { color: #fff; }
.contact-row a:hover { color: var(--cyan); }
.contact-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--blue); display: grid; place-items: center; flex: none; }
.contact-ico svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.contact-links a { color: #fff; border: 1px solid rgba(255, 255, 255, .2); padding: 6px 12px; border-radius: 8px; font-size: .9rem; }
.contact-links a:hover { border-color: var(--cyan); color: var(--cyan); }

.site-footer { background: #041232; color: #8fa1c2; font-size: .88rem; padding: 22px 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.footer-link { color: #8fa1c2; }
.footer-link:hover { color: #fff; }

/* ---------- lightbox */
.lightbox { border: 0; padding: 0; border-radius: 18px; width: min(1100px, calc(100% - 24px)); max-height: calc(100vh - 24px); box-shadow: var(--shadow-lg); }
.lightbox::backdrop { background: rgba(4, 18, 50, .78); backdrop-filter: blur(4px); }
.lightbox[open] { animation: lb-in .25s var(--ease); }
@keyframes lb-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.lb-inner { display: grid; grid-template-columns: 1.5fr 1fr; max-height: calc(100vh - 24px); }
.lb-stage { background: #041232; display: grid; place-items: center; min-height: 320px; }
.lb-stage img, .lb-stage video { max-height: calc(100vh - 24px); width: 100%; object-fit: contain; }
.lb-meta { padding: 32px; overflow: auto; }
.lb-close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--navy); z-index: 2; }
.lb-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 20px; }
.lb-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: var(--bg-tint); position: relative; }
.lb-thumbs button[aria-current="true"] { border-color: var(--blue); }
.lb-thumbs img, .lb-thumbs video { width: 100%; height: 100%; object-fit: cover; }
.lb-thumbs .is-video::after { content: '▶'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.lb-caption { color: var(--muted); font-size: .88rem; margin-top: 8px; }

/* ---------- reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive */
@media (max-width: 900px) {
  .hero-inner, .about, .contact-inner, .lb-inner { grid-template-columns: 1fr; }
  .hero-art { max-width: 300px; justify-self: start; order: -1; }
  .about-media { max-width: 360px; }
  .about-media:has(#about-photo[hidden]) { display: none; }
  .hero-art { max-width: 220px; }
  .lb-stage { min-height: 220px; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav a:not(.btn)::after { display: none; }
  .nav .btn { margin-top: 12px; }
  .stripes { width: 300px; height: 300px; }
  .stripes-tl { top: -150px; left: -150px; }
  .stripes-br { bottom: -150px; right: -150px; }
  .projects { grid-template-columns: 1fr; }
  .cf-row { grid-template-columns: 1fr; }
  .contact-card { padding: 20px; }
  .tl-item { grid-template-columns: 36px 1fr; gap: 14px; }
  .tl-dot { width: 36px; height: 36px; border-radius: 9px; }
  .timeline::before { left: 17px; }
  .tl-card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .stage { opacity: 1; }
}
