/* ============================================================
   Home page — Agent4-inspired iteration layer
   Scoped to `.home-v2` so it never touches the other pages.
   Builds on tokens from colors_and_type.css + site.css.
   Signature moves:
     · Hero bento mosaic (super-rounded cards + stat pills + ghost pills)
     · Barbell eyebrows (pill + connected index circle)
     · Rounder cards, richer hover microinteractions
     · Slightly richer scroll-reveal (rise + subtle scale)
   ============================================================ */

/* ---- richer reveal: rise + a touch of scale (home only) ---- */
@media (prefers-reduced-motion: no-preference) {
  .home-v2 .reveal {
    transform: translateY(26px) scale(0.985);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-emphasized);
  }
}
.home-v2 .reveal.in { transform: none; }

/* ============================================================
   HERO — bento mosaic
   ============================================================ */
.home-v2 .hero { padding: 88px 0 92px; overflow-x: clip; }

.hero-bento {
  position: relative;
  display: grid;
  grid-template-columns: 1.36fr 0.84fr;
  grid-template-areas:
    "lead     portrait"
    "stats    portrait";
  gap: 16px;
  z-index: 1;
}

/* decorative ghost pills — agent4 negative-space rhythm */
.hero-bento .ghost-pill {
  position: absolute;
  border: 1px solid var(--hairline);
  border-radius: var(--rounded-full);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}
.hero-bento .gp-1 { width: 260px; height: 104px; top: -52px; left: -78px; }
.hero-bento .gp-2 { width: 188px; height: 84px; right: 30%; bottom: -46px; }
.hero-bento .gp-3 { width: 120px; height: 120px; right: -54px; top: 38%; }

/* shared bento card surface */
.bento-card {
  position: relative;
  background: var(--surface-card);
  border-radius: var(--rounded-xl);
  z-index: 1;
  transition: border-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard);
}

/* headline panel */
.hero-lead-card {
  grid-area: lead;
  padding: 52px 52px 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}
/* soft top-corner light, echoing the bento art on the about page */
.hero-lead-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 80% at 12% -10%, rgba(0,110,245,0.16), rgba(0,110,245,0) 52%);
}
.hero-lead-card > * { position: relative; z-index: 1; }

.home-v2 .hero h1 {
  font-size: clamp(42px, 5.4vw, 68px);
  line-height: 1.03;
  letter-spacing: -1.8px;
  margin: 0;
}
.home-v2 .hero .lead { margin-top: 24px; max-width: 46ch; }
.home-v2 .hero-actions { margin-top: 36px; }

/* portrait — tall cinematic card spanning both rows */
.hero-portrait-card {
  grid-area: portrait;
  overflow: hidden;
  background: var(--surface-raised);
  min-height: 520px;
}
.hero-portrait-card image-slot { width: 100%; height: 100%; display: block; }
.hero-portrait-card .scrim {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(to top, rgba(0,14,31,0.62), transparent 46%);
}
.hero-portrait-card .hero-portrait-badge {
  position: absolute; top: 18px; right: 18px; z-index: 3;
  background: rgba(0,14,31,0.7); backdrop-filter: blur(8px);
  border-radius: var(--rounded-full);
  padding: 7px 15px; font-size: 12px; font-weight: 500; color: var(--accent-300);
}
.hero-portrait-card .hero-portrait-cap {
  position: absolute; left: 22px; right: 22px; bottom: 22px; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--body);
}
.hero-portrait-card .hero-portrait-cap .loc { display: inline-flex; align-items: center; gap: 6px; }
.hero-portrait-card:hover { box-shadow: var(--shadow-card-hover); }

/* stat pills row (the "10x" treatment) */
.hero-stats-row {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.bento-stat {
  position: relative;
  background: var(--surface-card);
  border-radius: var(--rounded-lg);
  padding: 22px 26px;
  min-height: 116px;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  overflow: hidden;
  transition: border-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard);
}
.bento-stat .n {
  font-family: var(--font-display); font-weight: 600; font-size: 46px; line-height: 1;
  letter-spacing: -1.4px; color: var(--ink);
}
.bento-stat .l { font-size: 13px; line-height: 1.4; color: var(--muted); }
.bento-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}
/* one accent-filled pill for focal pop */
.bento-stat.accent {
  background: linear-gradient(158deg, #0f5ad1, #0044a0);
  border-color: transparent;
}
.bento-stat.accent::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 90% at 85% -20%, rgba(255,255,255,0.22), rgba(255,255,255,0) 55%);
}
.bento-stat.accent .n { color: #fff; position: relative; }
.bento-stat.accent .l { color: var(--accent-100); position: relative; }
.bento-stat.accent:hover { box-shadow: 0 12px 30px rgba(0,73,163,0.4); }

/* ============================================================
   BARBELL EYEBROW — pill + connected index circle
   (agent4 Agent·4 shape, on-brand)
   ============================================================ */
.home-v2 .eyebrow {
  position: relative;
  background: var(--surface-raised);
  border-radius: var(--rounded-full);
  padding: 7px 16px 7px 8px;
  gap: 10px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1.4px;
  color: var(--body);
}
.home-v2 .eyebrow .dot { display: none; }
.home-v2 .eyebrow .idx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: 0;
}

/* ============================================================
   CARD POLISH — rounder + richer hover (home only)
   ============================================================ */
.home-v2 .project-card,
.home-v2 .service-card { border-radius: var(--rounded-xl); }

.home-v2 .project-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: 0 16px 44px rgba(0,14,31,0.55);
}
.home-v2 .project-card .project-thumb .ph { transition: transform var(--duration-slow) var(--ease-emphasized), color var(--duration-base) var(--ease-standard); }
.home-v2 .project-card:hover .project-thumb .ph { transform: scale(1.08); }
/* metadata in the DS mono technical-label voice */
.home-v2 .project-card .meta {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 1.2px; font-size: 12px;
}

.home-v2 .service-card {
  transition: background-color var(--duration-base) var(--ease-standard),
              border-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard);
}
.home-v2 .service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 38px rgba(0,14,31,0.5);
}
/* circular icon bubble (agent4 soft shapes) */
.home-v2 .service-icon {
  width: 56px; height: 56px; border-radius: var(--rounded-full); border: none;
  transition: transform var(--duration-base) var(--ease-emphasized), background-color var(--duration-base) var(--ease-standard);
}
.home-v2 .service-card:hover .service-icon { transform: translateY(-2px) scale(1.06); background: var(--primary); border-color: var(--primary); }
.home-v2 .service-card:hover .service-icon [data-lucide] { color: var(--on-primary); }
.home-v2 .service-card .num { font-family: var(--font-mono); font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent-300); }
/* deliverables → bordered pill chips */
.home-v2 .service-card .deliverables { gap: 8px; }
.home-v2 .service-card .deliverables .d {
  padding: 6px 14px; border-radius: var(--rounded-full);
  background: var(--surface-card); color: var(--body); font-weight: 500;
}
.home-v2 .service-card .deliverables .d::before { display: none; }

/* about + contact portraits: rounder + lift */
.home-v2 .contact-card { border-radius: var(--rounded-xl); }

/* ---- about portrait → cinematic bento card ---- */
.home-v2 .about-portrait { border-radius: var(--rounded-xl); position: relative; overflow: hidden; }
.home-v2 .about-portrait .scrim {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(0,14,31,0.6), transparent 52%);
}
.home-v2 .about-portrait-badge {
  position: absolute; top: 16px; left: 16px; z-index: 3;
  background: rgba(0,14,31,0.7); backdrop-filter: blur(8px);
  border-radius: var(--rounded-full);
  padding: 7px 15px; font-size: 12px; font-weight: 500; color: var(--accent-300);
}
.home-v2 .about-portrait-cap {
  position: absolute; left: 18px; bottom: 18px; right: 18px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--body);
}
.home-v2 .about-portrait-cap [data-lucide] { color: var(--accent-300); }

/* ---- experience rows → elevated bento cards ---- */
.home-v2 .exp-list { display: flex; flex-direction: column; gap: 16px; position: relative; }
.home-v2 .exp-item {
  background: var(--surface-raised);
  border: none;
  border-radius: var(--rounded-xl);
  padding: 32px;
  margin: 0;
  position: relative; isolation: isolate; overflow: hidden;
  transition: transform var(--duration-base) var(--ease-standard),
              border-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard);
}
.home-v2 .exp-item:last-child { border-bottom: none; }
.home-v2 .exp-item::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(120% 80% at 12% -10%, rgba(0,110,245,0.12), rgba(0,110,245,0) 50%);
  opacity: 0; transition: opacity var(--duration-base) var(--ease-standard);
}
.home-v2 .exp-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 44px rgba(0,14,31,0.5);
  outline: 1px solid rgba(0,110,245,0.35);
}
.home-v2 .exp-item:hover::before { opacity: 1; }
.home-v2 .exp-item > * { position: relative; z-index: 1; }
/* exp-item grid: main content left, period (year + range) right */
.home-v2 .exp-item {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 0;
  align-items: start;
}
/* exp-main: [h3 + co stacked] [badge centered alongside] then body + tags full-width */
.home-v2 .exp-main {
  grid-column: 1; grid-row: 1;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  column-gap: 16px;
}
.home-v2 .exp-main h3        { grid-column: 1; grid-row: 1; margin-bottom: 4px; }
.home-v2 .exp-main .exp-badge { grid-column: 2; grid-row: 1; align-self: center; }
.home-v2 .exp-main .co       { grid-column: 1; grid-row: 2; }
.home-v2 .exp-main p         { grid-column: 1 / -1; grid-row: 3; max-width: none; }
.home-v2 .exp-main .exp-tags  { grid-column: 1 / -1; grid-row: 4; }
.home-v2 .exp-period {
  grid-column: 2; grid-row: 1;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
/* period text */
.home-v2 .exp-period { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 1px; font-size: 12px; }
.home-v2 .exp-period .yr { font-size: 28px; letter-spacing: -0.6px; color: var(--ink); font-family: var(--font-display); font-weight: 600; }
.home-v2 .exp-period .exp-range { text-align: right; }
/* clickable experience card */
.home-v2 .exp-item[data-experience] { cursor: pointer; }
.home-v2 .exp-item[data-experience]:focus-visible {
  outline: none; box-shadow: var(--shadow-focus-ring);
}
/* "View details" pill */
.home-v2 .exp-view-pill {
  position: absolute; bottom: 20px; right: 20px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--ink);
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--rounded-full); padding: 6px 14px;
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard);
  pointer-events: none;
}
.home-v2 .exp-item[data-experience]:hover .exp-view-pill { opacity: 1; transform: translateY(0); }
/* accent the "Most recent" badge */
.home-v2 .exp-item:first-child .exp-badge .badge { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* ---- services: soft corner light + content above ---- */
.home-v2 .service-card { isolation: isolate; overflow: hidden; }
.home-v2 .service-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(120% 80% at 88% -12%, rgba(0,110,245,0.12), rgba(0,110,245,0) 52%);
  opacity: 0; transition: opacity var(--duration-base) var(--ease-standard);
}
.home-v2 .service-card:hover::before { opacity: 1; }
.home-v2 .service-card > * { position: relative; z-index: 1; }
/* services sit on a band — raise them for contrast like the experience cards */
.home-v2 .band .service-card,
.home-v2 .band .exp-item { background: var(--surface-raised); }

/* ---- logo strip → pill chips ---- */
.home-v2 .logo-row { gap: 14px; }
.home-v2 .logo-row .co {
  font-size: 17px; padding: 12px 24px;
  border-radius: var(--rounded-full);
  background: var(--surface-card); color: var(--body);
  transition: color var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard),
              border-color var(--duration-base) var(--ease-standard),
              background-color var(--duration-base) var(--ease-standard);
}
.home-v2 .logo-row .co:hover {
  transform: translateY(-2px); color: var(--ink);
  background: var(--surface-raised);
}

/* ---- contact points → pill rows + soft light card ---- */
.home-v2 .contact-card { isolation: isolate; overflow: hidden; }
.home-v2 .contact-card > * { position: relative; z-index: 1; }
.home-v2 .contact-point {
  background: var(--surface-card);
  border-radius: var(--rounded-full); padding: 10px 18px 10px 10px; width: fit-content; max-width: 100%;
  transition: transform var(--duration-base) var(--ease-standard);
}
.home-v2 .contact-point:hover { transform: translateX(4px); }
.home-v2 .contact-point .ci { border-radius: var(--rounded-full); border: none; }

/* ---- decorative ghost pills in About + Contact ---- */
.home-v2 #about, .home-v2 #contact { position: relative; overflow: clip; }
.home-v2 #about .container, .home-v2 #contact .container { position: relative; z-index: 1; }
.home-v2 .ghost-pill {
  position: absolute; border: 1px solid var(--hairline);
  border-radius: var(--rounded-full); pointer-events: none; z-index: 0; opacity: 0.55;
}
.home-v2 #about .sgp-1 { width: 300px; height: 120px; top: 56px; right: -96px; }
.home-v2 #contact .sgp-1 { width: 280px; height: 116px; bottom: 24px; left: -110px; }
.home-v2 #contact .sgp-2 { width: 150px; height: 150px; top: 40px; right: -70px; }

/* ============================================================
   FEWER BORDERS — lean on the navy surface tiers, not hairlines
   (home only — home.css is loaded by index.html alone)
   Borders now survive only where they ARE the element (outline
   buttons, inputs, icon-buttons, the modal edge, tooltips) or act
   as a true structural divider (navbar / footer / cards on canvas).
   ============================================================ */
/* bands separate by their lighter surface alone — no edge lines */
.home-v2 .band { border-top: none; border-bottom: none; }
/* service cards live on a band as raised tiles — the surface step is the edge */
.home-v2 .service-card { border: none; }
/* filled availability pill — the primary-subtle fill defines it */
.home-v2 .hero-availability { border: none; }
/* skill chips → quiet recessed fill instead of an outline */
.home-v2 .tag { border: none; background: var(--surface-card); color: var(--body); }
/* modal placeholder + metric tiles read off the raised modal surface */
.modal-hero { border: none; }
.modal-metric { border: none; background: var(--surface-card); }

/* "More systems" list inside the case-study modal — rule-separated rows
   (a genuine divider, mirroring the design system's index-list pattern) */
.modal-systems { display: flex; flex-direction: column; }
.modal-systems .sys-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
}
.modal-systems .sys-row:first-child { border-top: none; }
.modal-systems .sys-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; width: 100%;
}
.modal-systems .sys-name {
  font-family: var(--font-display); font-weight: 600;
  font-size: 16px; color: var(--ink);
}
.modal-systems .sys-note {
  font-size: 14px; line-height: 1.55; color: var(--body); text-wrap: pretty;
}
.modal-systems .sys-year {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.4px;
  color: var(--muted); white-space: nowrap;
}
.modal-systems .sys-link.btn {
  margin-top: 2px;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--rounded-md);
}
.modal-systems .sys-link.btn [data-lucide],
.modal-systems .sys-link.btn svg { width: 15px; height: 15px; }

/* ============================================================
   RESPONSIVE — collapse bento gracefully
   ============================================================ */
@media (max-width: 1080px) {
  .hero-bento {
    grid-template-columns: 1fr 0.82fr;
  }
  .hero-portrait-card { min-height: 460px; }
}
@media (max-width: 880px) {
  .home-v2 .hero { padding: 56px 0 64px; }
  .hero-bento {
    grid-template-columns: 1fr;
    grid-template-areas:
      "lead"
      "portrait"
      "stats";
    gap: 14px;
  }
  .hero-lead-card { padding: 36px 28px 32px; }
  .home-v2 .hero h1 { font-size: 40px; letter-spacing: -1px; }
  .hero-portrait-card { min-height: 380px; }
  .hero-bento .ghost-pill { display: none; }
  .home-v2 .exp-item { padding: 24px; grid-template-columns: 1fr; row-gap: 24px; }
  .home-v2 .exp-period {
    grid-column: 1; grid-row: 1;
    flex-direction: row; justify-content: space-between; align-items: baseline;
  }
  .home-v2 .exp-period .exp-range { text-align: right; }
  .home-v2 .exp-main { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; }
  .home-v2 .exp-main h3        { order: 1; margin-bottom: 4px; }
  .home-v2 .exp-main .co       { order: 2; margin-bottom: 24px; }
  .home-v2 .exp-main .exp-badge { order: 3; align-self: flex-start; margin-bottom: 24px; }
  .home-v2 .exp-main p         { order: 4; margin: 0 0 24px; }
  .home-v2 .exp-main .exp-tags  { order: 5; }
  .home-v2 #about .sgp-1, .home-v2 #contact .sgp-1, .home-v2 #contact .sgp-2 { display: none; }
}
@media (max-width: 480px) {
  .home-v2 .hero h1 { font-size: 34px; }
  .hero-stats-row { grid-template-columns: 1fr 1fr; }
  .bento-stat { padding: 18px 18px; min-height: 100px; }
  .bento-stat .n { font-size: 38px; }
  .home-v2 .eyebrow { font-size: 10.5px; letter-spacing: 0.8px; padding: 6px 12px 6px 6px; }
  .home-v2 .eyebrow .idx { width: 22px; height: 22px; font-size: 11px; }
}

/* ============================================================
   MOBILE / TOUCH FIXES — homepage
   ============================================================ */

/* 1. Clip ghost pills so they never cause horizontal page overflow.
      The hero-bento ghost pills use negative left/right offsets that
      can escape the body's overflow-x:hidden on mobile Safari. */
.home-v2 .hero { overflow: hidden; }

/* 2. Allow vertical scroll to pass through all large bento containers
      that have overflow:hidden but are not themselves scrollable. */
@media (pointer: coarse) {
  .bento-card,
  .bento-stat,
  .hero-portrait-card,
  .home-v2 .about-portrait,
  .home-v2 .exp-item,
  .home-v2 .service-card,
  .home-v2 .contact-card { touch-action: pan-y; }
}

/* 3. Strip all hover transforms / border / shadow on touch devices. */
@media (hover: none), (pointer: coarse) {
  /* stat pills */
  .bento-stat:hover                             { transform: none; box-shadow: none; border-color: var(--hairline); }
  .bento-stat.accent:hover                      { box-shadow: none; }

  /* portrait card */
  .hero-portrait-card:hover                     { border-color: var(--hairline); box-shadow: none; }

  /* project cards */
  .home-v2 .project-card:hover                  { transform: none; box-shadow: none; border-color: var(--hairline); }
  .home-v2 .project-card:hover .project-thumb .ph { transform: none; }

  /* service cards */
  .home-v2 .service-card:hover                  { transform: none; box-shadow: none; border-color: var(--hairline); }
  .home-v2 .service-card:hover::before          { opacity: 0; }
  .home-v2 .service-card:hover .service-icon    { transform: none; background: var(--primary-subtle); border-color: var(--border-strong); }
  .home-v2 .service-card:hover .service-icon [data-lucide] { color: var(--accent-300); }

  /* experience cards */
  .home-v2 .exp-item:hover                      { transform: none; box-shadow: none; border-color: var(--border); outline: none; }
  .home-v2 .exp-item:hover::before              { opacity: 0; }
  .home-v2 .exp-item[data-experience]:hover .exp-view-pill { opacity: 0; transform: translateY(6px); }

  /* logo strip chips */
  .home-v2 .logo-row .co:hover                  { transform: none; color: var(--body); border-color: var(--hairline); background: var(--surface-card); }

  /* contact points */
  .home-v2 .contact-point:hover                 { transform: none; border-color: var(--hairline); }
}

/* ============================================================
   NO HOVER on non-interactive elements — home
   Stat tiles, the portrait card, the service cards and the
   experience cards don't link or open anything, so they lose the
   hover lift / shadow / icon-fill / corner-light. The project cards
   (which open the case-study modal), the logo links and the contact
   points (each wraps a real link) keep their hover.
   ============================================================ */
.home-v2 .bento-stat:hover { transform: none; box-shadow: none; }
.home-v2 .bento-stat.accent:hover { box-shadow: none; }
.home-v2 .hero-portrait-card:hover { box-shadow: none; }
.home-v2 .service-card:hover { transform: none; box-shadow: none; }
.home-v2 .service-card:hover::before { opacity: 0; }
.home-v2 .service-card:hover .service-icon { transform: none; background: var(--primary-subtle); }
.home-v2 .service-card:hover .service-icon [data-lucide] { color: var(--accent-300); }
.home-v2 .exp-item:hover { transform: none; box-shadow: none; }
.home-v2 .exp-item:hover::before { opacity: 0; }
