/* ============================================================
   SILICAIRN — Home page layout (redesign)
   Section order: nav · hero · statement · services · tech ·
   bento · articles · contact · footer
   ============================================================ */

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  display: flex; align-items: center;
  /* same frosted-glass material as the hero panel — colors behind blur through */
  background: var(--glass-bg);
  box-shadow: 0 1px 0 var(--hairline);
  transition: transform .4s var(--ease-out);
  will-change: transform;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav {
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav { background: rgba(246, 242, 233, 0.92); }
}
/* auto-hide: slide up out of view when scrolling down, slide back on scroll up */
.nav.nav-hidden { transform: translateY(-100%); }
.nav-inner {
  width: 100%; max-width: calc(var(--maxw) + var(--margin) * 2);
  margin: 0 auto; padding: 0 var(--margin);
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: .55rem; }
/* logo mark as an alpha-mask so it can be painted any exact color (brand green / white) */
.nav-logo-mark {
  width: 24px; height: 24px;
  background-color: var(--green-700);
  -webkit-mask: url(/assets/mark-white.svg) center / contain no-repeat;
          mask: url(/assets/mark-white.svg) center / contain no-repeat;
  transition: background-color .3s var(--ease);
}
.nav-logo-text { font-family: var(--font-label); font-weight: 600; letter-spacing: .14em; font-size: 1rem; color: var(--green-700); transition: color .3s var(--ease); }
/* dark bands (hero, statement strip, footer): logo + wordmark go white */
.nav.nav-on-dark .nav-logo-text { color: var(--on-ink); }
.nav.nav-on-dark .nav-logo-mark { background-color: var(--on-ink); }

.nav-links { display: flex; align-items: center; gap: var(--s-8); }
.nav-links a {
  font-family: var(--font-label); font-size: .85rem; font-weight: 500; letter-spacing: .02em;
  color: var(--text-soft); transition: color .2s var(--ease); padding: .25rem 0;
}
.nav.nav-on-dark .nav-links a { color: var(--on-ink-soft); }
.nav-links a:hover { color: var(--green-700); }
.nav.nav-on-dark .nav-links a:hover { color: var(--on-ink); }
.nav-cta {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 1.1rem;
  border: 1px solid var(--hairline); border-radius: var(--r-soft); color: var(--ink) !important;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.nav.nav-on-dark .nav-cta { border-color: rgba(255,255,255,0.4); color: var(--on-ink) !important; }
.nav-cta:hover { background: var(--green-700); border-color: var(--green-700); color: var(--paper) !important; }

.nav-toggle { display: none; flex-direction: column; gap: 6px; width: 40px; height: 40px; padding: 9px; }
.nav-toggle-bar { display: block; width: 100%; height: 2px; background: currentColor; color: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav.nav-on-dark .nav-toggle-bar { color: var(--on-ink); }
.nav-toggle.active .nav-toggle-bar:first-child { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle.active .nav-toggle-bar:last-child { transform: rotate(-45deg) translate(4px, -4px); }

/* ---------- Hero (looping background video) ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: flex-start;          /* anchor from the top, not centred */
  padding-top: calc(var(--nav-h) + var(--s-12));   /* constant gap below the fixed nav */
  padding-bottom: var(--s-12);
  overflow: hidden;
  color: var(--on-ink);
}
/* looping video fills the hero; gradient fallback sits beneath it (z-index 0) */
.hero-video { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
/* painterly-hills gradient — underlay shown while the video loads, if it's missing, or on reduced-motion */
.hero-fallback {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 80% at 78% 8%, rgba(224,145,62,0.45), transparent 55%),
    radial-gradient(90% 70% at 20% 0%, rgba(132,199,158,0.40), transparent 60%),
    linear-gradient(180deg, #5fa07a 0%, #3d7d57 38%, #1f5c3c 70%, #123a26 100%);
}
.hero-fallback::after {
  content: ''; position: absolute; left: -5%; right: -5%; bottom: -2%; height: 46%;
  background: radial-gradient(60% 120% at 50% 100%, #16482e 0%, #1b5236 60%, transparent 100%);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hero-inner { position: relative; z-index: 2; width: 100%; }
.hero-panel {
  max-width: 660px;
  padding: clamp(var(--s-8), 4vw, var(--s-16));
  color: var(--ink);
}
.hero-panel .display { color: var(--ink); }
.hero-panel .eyebrow { color: var(--green-900); }
.hero-lead { margin-top: var(--s-6); max-width: 34ch; color: var(--text-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-8); }
.hero-actions .btn { border-radius: var(--r-pill); }   /* fully rounded pill CTAs */

/* ---------- Statement strip ---------- */
.statement {
  background: var(--green-700); color: var(--on-ink);
  padding: var(--s-24) 0;
}
.statement .big {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 4rem); line-height: 1.05; letter-spacing: -0.01em;
  max-width: 18ch;
}
.statement .big .accent { color: var(--amber); }
.statement .sub { margin-top: var(--s-6); max-width: 52ch; color: var(--on-ink-soft); }

/* ---------- Services: 4 tall vertical tiles ---------- */
.services-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-8); flex-wrap: wrap; margin-bottom: var(--s-12); }
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.svc-tile {
  display: flex; flex-direction: column;
  min-height: 380px; padding: var(--s-6) var(--s-6) var(--s-8);
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .3s var(--ease);
}
.svc-tile:hover { transform: translateY(-6px); box-shadow: var(--glass-shadow-sm); border-color: var(--green-300); }
.svc-num { font-family: var(--font-label); font-size: .75rem; font-weight: 600; letter-spacing: .14em; color: var(--green-500); }
.svc-tile .h3 { margin-top: auto; padding-top: var(--s-8); }
.svc-tile .body { margin-top: var(--s-3); font-size: .98rem; }
.svc-tile .arrow-link { margin-top: var(--s-6); }

/* ---------- Tech: horizontal image marquee ---------- */
.tech { padding: var(--s-8) 0; background: var(--green-700); border-block: 1px solid rgba(255,255,255,0.12); overflow: hidden; }
.tech-head { text-align: center; margin-bottom: var(--s-3); }
.tech-head .eyebrow { color: var(--on-ink-soft); }
/* Two tightly-stacked lanes forming one continuous conveyor: the top lane drifts
   left and items exit at the left edge and reappear on the bottom lane drifting
   right (and vice-versa at the right edge). JS (rAF) drives positions in .is-live
   mode; the no-JS / reduced-motion fallback is static, centered rows. */
.beltway {
  position: relative; width: 100%; overflow: hidden;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-6) var(--s-12);
  /* Items are fully gone within --belt-edge of each side; the fade band stays a fixed
     --belt-fade wide (not stretched). Bump --belt-edge up to make them vanish sooner. */
  --belt-edge: 7%;
  --belt-fade: 5%;
  -webkit-mask-image: linear-gradient(90deg, transparent var(--belt-edge), #000 calc(var(--belt-edge) + var(--belt-fade)), #000 calc(100% - var(--belt-edge) - var(--belt-fade)), transparent calc(100% - var(--belt-edge)));
          mask-image: linear-gradient(90deg, transparent var(--belt-edge), #000 calc(var(--belt-edge) + var(--belt-fade)), #000 calc(100% - var(--belt-edge) - var(--belt-fade)), transparent calc(100% - var(--belt-edge)));
}
.beltway.is-live { display: block; }                                   /* JS owns layout */
.beltway.is-live .belt-item { position: absolute; top: 0; left: 0; will-change: transform; }
.belt-item { height: 38px; display: flex; align-items: center; opacity: .8; transition: opacity .2s var(--ease); }
.belt-item:hover { opacity: 1; }
.belt-item img { height: 100%; width: auto; object-fit: contain; }
/* placeholder chip until real wordmark images arrive */
.belt-item .chip { font-family: var(--font-label); font-weight: 600; letter-spacing: .04em; color: var(--on-ink-muted); padding: .4rem .9rem; border: 1px dashed rgba(255,255,255,0.28); border-radius: var(--r-pill); white-space: nowrap; }

/* ---------- Bento: 2x2 pinwheel (big on diagonal) ---------- */
.bento {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  grid-template-rows: repeat(2, minmax(228px, 31vh));
  gap: var(--s-4);
}
.bento-tile {
  position: relative; overflow: hidden;
  border-radius: var(--r-tile);
  padding: var(--s-6);
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--paper-2); border: 1px solid var(--hairline);
}
.bento-tile--big { grid-row: span 1; }
/* pinwheel: T1 big top-left, T4 big bottom-right */
.bento-tile.t1 { grid-column: 1; grid-row: 1; }
.bento-tile.t2 { grid-column: 2; grid-row: 1; }
.bento-tile.t3 { grid-column: 1; grid-row: 2; }
.bento-tile.t4 { grid-column: 2; grid-row: 2; }
/* swap column spans so big tiles sit on the diagonal */
.bento { grid-template-areas: "t1 t2" "t3 t4"; }
.bento-tile.t1 { grid-area: t1; }
.bento-tile.t2 { grid-area: t2; }
.bento-tile.t3 { grid-area: t3; }
.bento-tile.t4 { grid-area: t4; }
.bento--pinwheel {
  grid-template-columns: repeat(5, 1fr);   /* big = 3 cols, small = 2 cols (≈1.5:1) */
  grid-template-areas:
    "t1 t1 t1 t2 t2"    /* row 1: big left, small right (unchanged) */
    "t3 t3 t4 t4 t4";   /* row 2: small left, big right (swapped) */
}
.bento-tile--ink { background: var(--green-700); color: var(--on-ink); border-color: transparent; }
.bento-tile .stat { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1; color: var(--amber); }
.bento-tile .stat-label { font-family: var(--font-label); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-top: var(--s-2); }
.bento-tile--ink .stat-label { color: var(--on-ink-soft); }

/* ---------- Articles: 3-up rotating ---------- */
.articles-head { text-align: center; margin-bottom: var(--s-12); }
.articles-stage { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: var(--s-4); align-items: stretch; }
.article-card {
  border-radius: var(--r-tile); overflow: hidden; position: relative;
  background: var(--paper-2); border: 1px solid var(--hairline);
  min-height: 320px; padding: var(--s-8);
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.article-card--side { opacity: .6; }
.article-card--main { background: var(--green-700); color: var(--on-ink); border-color: transparent; }
.article-kicker { font-family: var(--font-label); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--green-500); margin-bottom: var(--s-3); }
.article-card--main .article-kicker { color: var(--green-300); }
.articles-dots { display: flex; justify-content: center; gap: .5rem; margin-top: var(--s-8); }
.articles-dots button { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline); transition: background .2s var(--ease), transform .2s var(--ease); }
.articles-dots button.active { background: var(--green-700); transform: scale(1.3); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--s-12); align-items: start; }
.form { display: flex; flex-direction: column; gap: var(--s-4); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.form-label { display: block; font-family: var(--font-label); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: var(--s-2); }
.form-input, .form-textarea {
  width: 100%; font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--r-soft);
  padding: .8rem .9rem; min-height: 48px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(47,139,87,0.15); }
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-status { font-size: .9rem; min-height: 1.2em; }
.form-status.is-ok { color: var(--green-700); }
.form-status.is-error { color: #B23B2E; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--on-ink); padding: var(--s-20) 0 var(--s-8); }
.footer-top { display: flex; justify-content: space-between; gap: var(--s-16); padding-bottom: var(--s-12); border-bottom: 1px solid rgba(255,255,255,0.12); }
.footer-brand { max-width: 340px; }
.footer-logo { display: flex; align-items: center; gap: .55rem; margin-bottom: var(--s-4); }
.footer-logo-mark { width: 22px; height: 22px; filter: brightness(0) invert(1); }
.footer-logo-text { font-family: var(--font-label); font-weight: 600; letter-spacing: .14em; }
.footer-tagline { font-size: .9rem; color: var(--on-ink-soft); }
.footer-cols { display: flex; gap: var(--s-16); }
.footer-col-title { font-family: var(--font-label); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--on-ink-muted); margin-bottom: var(--s-4); }
.footer-col ul { display: flex; flex-direction: column; gap: .6rem; }
.footer-col a { font-size: .9rem; color: var(--on-ink-soft); transition: color .2s var(--ease); }
.footer-col a:hover { color: var(--on-ink); }
.footer-bottom { padding-top: var(--s-8); display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.footer-note, .footer-copy { font-size: .75rem; color: var(--on-ink-muted); }
.footer-note { font-family: var(--font-label); letter-spacing: .04em; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .svc-tile { min-height: 360px; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: var(--s-12);
    background: rgba(18,58,38,0.97); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
  }
  .nav-links.open { opacity: 1; pointer-events: auto; }
  .nav-links a { font-size: 1.4rem; color: var(--on-ink) !important; }
  .nav-cta { border: none; padding: 0; }
  .bento { grid-template-columns: 1fr; grid-template-areas: "t1" "t2" "t3" "t4"; grid-template-rows: none; }
  .bento-tile { min-height: 220px; }
  .articles-stage { grid-template-columns: 1fr; }
  .article-card--side { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; gap: var(--s-12); }
}
@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
}
