/* Home page body (index.html). Tokens come from styles.css :root.
   Shared pieces (glass-card, section-title, btn, closing card) are reused from styles.css;
   everything here is home-only and prefixed home-. */

/* ---- Sections ---- */
.home-section {
  --home-accent: var(--accent-blue);
  --home-accent-rgb: 0, 98, 255;
  position: relative;
  padding: 80px 0;
}
.home-section--alt {
  background: #fafafb; /* opaque: the blueprint grid shows only on white sections */
}

/* One accent per section. Set on the section element. */
.home-accent-blue   { --home-accent: var(--accent-blue);   --home-accent-rgb: 0, 98, 255; }
.home-accent-green  { --home-accent: var(--accent-green);  --home-accent-rgb: 16, 185, 129; }
.home-accent-orange { --home-accent: var(--accent-orange); --home-accent-rgb: 255, 107, 0; }
.home-accent-violet { --home-accent: var(--accent-violet); --home-accent-rgb: 124, 58, 237; }

.home-more {
  margin: 32px 0 0;
  text-align: center;
}
.home-small {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.home-small a,
.home-inline-link {
  color: var(--home-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- Facts strip ---- */
.home-facts {
  position: relative;
  padding: 40px 0 56px;   /* room between the peel and "How it all connects" */
}
.home-facts-list {
  list-style: none;
  margin: 0;
  padding: 22px 28px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px 24px;
}
.home-fact {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.home-fact svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--accent-blue);
}

/* ---- Group labels and card grids ---- */
.home-group + .home-group {
  margin-top: 48px;
}
.home-group-label {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--home-accent);
}
.home-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.home-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.home-grid--products {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* ---- Cards ---- */
.home-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 28px;
  color: inherit;
  text-decoration: none;
}
.home-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
.home-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
a.home-card:hover h3 {
  color: var(--home-accent);
}
.home-card:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 3px;
}
.home-card-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(var(--home-accent-rgb), 0.08);
  color: var(--home-accent);
}
.home-card-icon svg {
  width: 22px;
  height: 22px;
}
.home-card-link {
  margin-top: auto;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--home-accent);
}
.home-chip {
  align-self: flex-start;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--home-accent);
  border: 1px solid rgba(var(--home-accent-rgb), 0.3);
  border-radius: 999px;
}

/* Story cards (Our work) */
.home-story-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--home-accent);
}
.home-figure {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--home-accent);
}

/* ---- How we work (steps) ---- */
.home-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.home-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
}
.home-step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--home-accent);
}
.home-step h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
}
.home-step p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* How we work: a loop that runs while the steps are on screen. Card 1 gets an orange
   outline, a line draws across to card 2, card 2 lights, and so on to card 4. All four
   hold for a moment, fade out together, and it starts again. home-panels.js toggles
   .is-on as the section enters and leaves the screen (the loop pauses off screen). */
@property --link { syntax: '<number>'; inherits: false; initial-value: 0; }
.home-step {
  position: relative;
  outline: 1.5px solid transparent;
  outline-offset: -1px;
  overflow: visible;                     /* glass-card clips; the connector sits outside the card */
  animation: 7s linear infinite paused;
}
.home-step::before { border-radius: inherit; }   /* keep the glass tint inside the rounded corners */
.home-step::after {                      /* connector to the next card */
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  width: 20px;                           /* = the grid gap */
  height: 2px;
  margin-top: -1px;
  background: var(--step-link, rgba(255, 107, 0, 0.7));
  transform: scaleX(var(--link));
  transform-origin: left center;
  animation: 7s linear infinite paused;
}
.home-step:last-child::after { display: none; }
.home-step:nth-child(1) { animation-name: stepCard1; }
.home-step:nth-child(2) { animation-name: stepCard2; }
.home-step:nth-child(3) { animation-name: stepCard3; }
.home-step:nth-child(4) { animation-name: stepCard4; }
.home-step:nth-child(1)::after { animation-name: stepLink1; }
.home-step:nth-child(2)::after { animation-name: stepLink2; }
.home-step:nth-child(3)::after { animation-name: stepLink3; }
.home-steps.is-on .home-step,
.home-steps.is-on .home-step::after { animation-play-state: running; }

/* 7s loop: card 1 at 0s, link 1→2 0.5–0.95s, card 2 1s, link 2→3 1.5–1.95s, card 3 2s,
   link 3→4 2.5–2.95s, card 4 3s; hold to 5.6s, fade out by 6.3s, rest, repeat */
@keyframes stepCard1 { 0% { outline-color: transparent; } 5%, 80% { outline-color: var(--step-ring, rgba(255,107,0,.65)); } 90%, 100% { outline-color: transparent; } }
@keyframes stepCard2 { 0%, 14% { outline-color: transparent; } 19%, 80% { outline-color: var(--step-ring, rgba(255,107,0,.65)); } 90%, 100% { outline-color: transparent; } }
@keyframes stepCard3 { 0%, 28% { outline-color: transparent; } 33%, 80% { outline-color: var(--step-ring, rgba(255,107,0,.65)); } 90%, 100% { outline-color: transparent; } }
@keyframes stepCard4 { 0%, 42% { outline-color: transparent; } 47%, 80% { outline-color: var(--step-ring, rgba(255,107,0,.65)); } 90%, 100% { outline-color: transparent; } }
@keyframes stepLink1 { 0%, 7% { --link: 0; opacity: 1; } 14%, 80% { --link: 1; opacity: 1; } 90%, 100% { --link: 1; opacity: 0; } }
@keyframes stepLink2 { 0%, 21% { --link: 0; opacity: 1; } 28%, 80% { --link: 1; opacity: 1; } 90%, 100% { --link: 1; opacity: 0; } }
@keyframes stepLink3 { 0%, 35% { --link: 0; opacity: 1; } 42%, 80% { --link: 1; opacity: 1; } 90%, 100% { --link: 1; opacity: 0; } }

@media (max-width: 1100px) {             /* two across: 1→2 and 3→4 side by side, 2→3 drops down */
  .home-steps .home-step:nth-child(2)::after {
    top: 100%; left: -10px; width: 2px; height: 20px; margin-top: 0;
    transform: scaleY(var(--link)); transform-origin: center top;
  }
}
@media (max-width: 768px) {              /* one column: each card links straight down */
  .home-steps .home-step:nth-child(n)::after {
    top: 100%; left: 50%; width: 2px; height: 20px; margin: 0 0 0 -1px;
    transform: scaleY(var(--link)); transform-origin: center top;
  }
}
@media (prefers-reduced-motion: reduce) {  /* no loop: everything shown lit */
  .home-step, .home-step::after { animation: none !important; }
  .home-step { outline-color: var(--step-ring, rgba(255,107,0,.65)); }
  .home-step::after { --link: 1; }
}

/* ---- Timeframes teaser ---- */
.home-times {
  margin: 0 auto;
  max-width: 760px;
  padding: 8px 28px;
}
.home-time-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--glass-border);
}
.home-time-row:last-child {
  border-bottom: 0;
}
.home-time-row dt {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
}
.home-time-row dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  color: var(--home-accent);
}

/* ---- The crew ---- */
.home-crew {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.home-crew-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 26px 18px;
  text-align: center;
}
.home-avatar {
  width: 96px;
  height: 96px;
  margin-bottom: 8px;
  object-fit: contain;
}
.home-crew-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
}
.home-role {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.home-tag {
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--home-accent);
  border: 1px solid rgba(var(--home-accent-rgb), 0.3);
  border-radius: 999px;
}

/* ---- Blog block ---- */
.home-blog {
  text-align: center;
}

/* ---- FAQ (details/summary, as on pricing.html) ---- */
.home-faq {
  display: grid;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto;
}
.home-faq details {
  padding: 0;
}
.home-faq summary {
  position: relative;
  padding: 20px 56px 20px 24px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
}
.home-faq summary::-webkit-details-marker {
  display: none;
}
.home-faq summary::after {
  content: '+';
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent-blue);
}
.home-faq details[open] summary::after {
  content: '\2212';
}
.home-faq summary:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
}
.home-faq details p {
  margin: 0;
  padding: 0 24px 22px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.home-faq details p a {
  color: var(--accent-blue);
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .home-facts-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .home-grid--products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .home-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-crew {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .home-grid--3 {
    grid-template-columns: 1fr;
  }
  .home-grid--products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .home-section {
    padding: 64px 0;
  }
  .home-facts {
    padding-top: 28px;
    padding-bottom: 36px;
  }
  .home-facts-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 18px;
  }
  .home-facts-list > li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .home-grid,
  .home-grid--products,
  .home-steps {
    grid-template-columns: 1fr;
  }
  .home-card {
    padding: 22px;
  }
  .home-crew {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-crew-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .home-times {
    padding: 4px 20px;
  }
  .home-time-row {
    flex-direction: column;
    gap: 4px;
  }
  .home-time-row dd {
    text-align: left;
  }
  .home-faq summary {
    padding: 18px 48px 18px 20px;
    font-size: 1rem;
  }
  .home-faq details p {
    padding: 0 20px 20px;
  }
}

/* "What we do": row 1 = the five products (blue LED, inside the hero wrapper), row 2 = the three
   ways we build (orange LED, just below). Phones use app.js's pinned card stacks. */
@media (min-width: 769px) {
  .grid.capabilities-grid--products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.capabilities-grid--build { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1101px) {
  .grid.capabilities-grid--products { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.capabilities-build-section { padding-top: 0; }

/* ---- Pillar headers: Engineering (blue) and Marketing (Mediterranean blue). Small and calm. ---- */
.pillar-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 28px;
}
.pillar-label {
  position: relative;
  margin: 0;
  padding-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.pillar-label::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--pillar-color);
}
.pillar-head--engineering { --pillar-color: var(--accent-blue); }
.pillar-head--marketing { --pillar-color: var(--accent-med, #0f5fa6); }
.pillar-head--engineering .pillar-label { color: var(--accent-blue); }
.pillar-head--marketing .pillar-label { color: var(--accent-med, #0f5fa6); }
.pillar-line {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ---- Marketing row (row 3). Plain grid: app.js does not pin or stack it. ---- */
.mkt-home { padding-top: 0; }
.mkt-home-grid {
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 769px) {
  .mkt-home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.mkt-dot {
  background: var(--accent-med, #0f5fa6);
  box-shadow: 0 0 6px var(--accent-med, #0f5fa6);
}
.cap-marketing .card-punchy { color: var(--accent-med, #0f5fa6); }

/* Proof teaser: full row width, under the six marketing cards. */
.mkt-home-proof {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.mkt-home-proof:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(15,95,166,0.12);
}
@media (min-width: 769px) {
  .mkt-home-proof {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 28px;
  }
}
.mkt-proof-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.mkt-proof-figure {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 7vw, 3.2rem);
  line-height: 1.05;
  background: linear-gradient(135deg, var(--accent-med, #0f5fa6), #2a9fd6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mkt-proof-caption {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

@media (prefers-reduced-motion: reduce) {
  .mkt-home-grid a.glass-card,
  .mkt-home-proof { transition: none; }
  .mkt-home-grid a.glass-card:hover,
  .mkt-home-proof:hover { transform: none; }
}

/* ---- What we do: three equal pillar cards (Engineering, Marketing, Infrastructure) ----
   Each card: the pillar label, one line, its offerings as pills (each opens that
   offering's info panel, see home-panels.js), then "Explore …". Mars (21 Nov 2026):
   listing every offering as a card crowded the page. */
.pillars-section { padding-top: 8px; }
.pillars-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 992px) { .pillars-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; } }
.pillar-card { display: flex; flex-direction: column; gap: 14px; padding: 28px 26px 24px; }
.pillar-card .pillar-head { margin: 0; }
.pillar-card .pillar-label { font-size: 0.74rem; }
.pillar-card-line { margin: 0; font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; line-height: 1.35; color: var(--text-primary); text-wrap: balance; }
.pillar-pills { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pillar-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  font-size: 0.84rem; font-weight: 500; line-height: 1.2; text-decoration: none; color: var(--text-primary);
  background: rgba(255, 255, 255, 0.7); box-shadow: 0 0 0 1px var(--pill-line, rgba(15, 23, 42, 0.1));
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, color 0.2s ease;
}
.pillar-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pill-dot); flex: none; }
.pillar-pill::after { content: "+"; font-weight: 700; color: var(--pill-dot); margin-left: 1px; }
.pillar-pill:hover { transform: translateY(-1px); background: #fff; box-shadow: 0 0 0 1px var(--pill-dot), 0 8px 18px -12px var(--pill-dot); }
.pillar-pill:focus-visible { outline: 2px solid var(--pill-dot); outline-offset: 2px; }
.pillar-pill--product { --pill-dot: var(--accent-blue); }
.pillar-pill--build { --pill-dot: var(--accent-orange); }
.pillar-pill--mkt { --pill-dot: var(--accent-med, #0f5fa6); }
.pillar-pill--inf { --pill-dot: #65a30d; }
.pillar-proof { margin-top: 2px; font-size: 0.86rem; color: var(--text-secondary); text-decoration: none; }
.pillar-proof b { color: var(--accent-med, #0f5fa6); font-weight: 600; }
.pillar-proof:hover { color: var(--text-primary); }
.pillar-explore { margin-top: auto; padding-top: 6px; font-weight: 600; font-size: 0.95rem; text-decoration: none; color: var(--pillar-accent); }
.pillar-explore:hover { text-decoration: underline; }
.pillar-card--eng { --pillar-accent: var(--accent-blue); }
.pillar-card--mkt { --pillar-accent: var(--accent-med, #0f5fa6); }
.pillar-card--inf { --pillar-accent: #4d7c0f; }
/* Infrastructure wears its own graphite-and-lime look (services/infra.css) */
.pillar-head--infrastructure { --pillar-color: #84cc16; }
.pillar-head--infrastructure .pillar-label { color: #4d7c0f; }
@media (prefers-reduced-motion: reduce) { .pillar-pill { transition: none; } .pillar-pill:hover { transform: none; } }
.pillar-pill { gap: 6px; padding: 5px 10px; font-size: 0.8rem; }
.pillar-pills { gap: 7px; }
/* {RUFEN. text wordmark in the info panels (same as services/marketing.css) */
.rufen-word { font-family: var(--font-display, 'Outfit', sans-serif); font-weight: 800; color: #0062ff; letter-spacing: -0.01em; white-space: nowrap; }
.rufen-word .rw-b { color: #ff6b00; margin-right: 0.04em; }
.rufen-word .rw-d { color: #ff6b00; }

/* Mars (21 Nov 2026): no pills on cards. The offerings are a plain list, like the
   info panel's: a small icon in the pillar's colour, then the name, two columns.
   No outline, background, dot or "+". Each row still opens its info panel. */
.pillar-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.pillar-item { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; line-height: 1.3; color: var(--text-primary); text-decoration: none; transition: color 0.2s ease; }
.pillar-item svg { width: 17px; height: 17px; flex: none; color: var(--item-ico); transition: transform 0.2s ease; }
.pillar-item:hover { color: var(--item-ico); }
.pillar-item:hover svg { transform: translateX(1px) scale(1.08); }
.pillar-item:focus-visible { outline: 2px solid var(--item-ico); outline-offset: 3px; border-radius: 4px; }
.pillar-item--product { --item-ico: var(--accent-blue); }
.pillar-item--build { --item-ico: var(--accent-orange); }
.pillar-item--mkt { --item-ico: var(--accent-med, #0f5fa6); }
.pillar-item--inf { --item-ico: #65a30d; }
@media (max-width: 400px) { .pillar-list { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .pillar-item, .pillar-item svg { transition: none; } .pillar-item:hover svg { transform: none; } }

/* A soft glow round each pillar card's edges, outside the card, in the pillar's
   colour (Mars, 21 Nov 2026: an edge shadow glow, not colour inside the card).
   The halo leans slowly round the card so it feels alive, and brightens on hover.
   The three cards move out of step. Still with reduced motion. */
@property --hx { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --hy { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --hg { syntax: '<number>'; inherits: false; initial-value: 0.22; }
.pillar-card {
  position: relative;
  box-shadow:
    0 4px 20px rgba(15, 23, 42, 0.03), 0 0 0 1px rgba(15, 23, 42, 0.02),
    var(--hx) var(--hy) 34px -6px color-mix(in srgb, var(--pillar-accent) calc(var(--hg) * 100%), transparent);
  transition: --hg 0.5s ease, box-shadow 0.3s ease;
}
.pillar-card:hover { --hg: 0.4; }
@media (prefers-reduced-motion: no-preference) {
  .pillar-card { animation: pcHalo 12s ease-in-out infinite; }
  .pillar-card--mkt { animation-delay: -4s; }
  .pillar-card--inf { animation-delay: -8s; }
}
@keyframes pcHalo {
  0%, 100% { --hx: 0px;   --hy: -6px; }
  25%      { --hx: 7px;   --hy: 0px; }
  50%      { --hx: 0px;   --hy: 7px; }
  75%      { --hx: -7px;  --hy: 0px; }
}

/* The offerings stack in one column, one name per line, every row aligned. */
.pillar-list { grid-template-columns: minmax(0, 1fr); gap: 11px; }
.pillar-item { font-size: 0.92rem; white-space: nowrap; }
.pillar-item span { overflow: hidden; text-overflow: ellipsis; }
.pillar-card > * { position: relative; z-index: 2; }
.pillar-card > .pillar-glow { position: absolute; z-index: 1; }

/* Facts strip under the peel-off paper (peel.js / peel.css): full width, just
   enough room round the strip for the paper's label; Engineering blue hint. */
.home-facts .bd-peel { max-width: none; padding: 22px 0; --mkt-accent: var(--accent-blue); }
.home-facts .bd-peel-label b { font-size: clamp(1.1rem, 2vw, 1.4rem); }
.home-facts .bd-peel-label small { color: #6f4a2e; }
/* Home strip: the paper is Rufen orange at 10% (#ff6b00 over white), solid so it hides the facts.
   The marketing pages keep the cream paper. */
.home-facts .bd-peel-paper {
  background-color: #fff0e6;
  background-image:
    linear-gradient(135deg, rgba(120, 50, 0, 0.15) var(--fold, 0px), rgba(120, 50, 0, 0.04) calc(var(--fold, 0px) + 18px), rgba(120, 50, 0, 0) calc(var(--fold, 0px) + 70px)),
    radial-gradient(rgba(160, 70, 10, 0.045) 1px, transparent 1.2px),
    linear-gradient(180deg, #fff3eb, #ffede1);
  box-shadow: 0 22px 44px -22px rgba(140, 70, 20, 0.3), 0 1px 2px rgba(120, 50, 0, 0.08);
}
.home-facts .bd-peel-back {
  background-image: linear-gradient(135deg, #fff7f1 0px, #fff0e6 calc(var(--fold, 0px) - 60px), #f8dcc8 calc(var(--fold, 0px) - 8px), #f0ccb2 var(--fold, 0px));
}

/* ===== Dark mode (html[data-theme="dark"]) ===== */
/* -- Pillar cards: an s1 card (foundation); the coloured halo becomes a tinted edge that breathes -- */
@keyframes pcEdgeDark{
  0%,100%{ border-color:var(--dk-line-1); }
  50%{ border-color:color-mix(in srgb,var(--pillar-accent) 45%,var(--dk-line-1)); }
}
:root[data-theme="dark"] .pillar-card{ box-shadow:inset 0 1px 0 var(--dk-light-top); animation-name:pcEdgeDark; }   /* keeps the 12s duration and the -4s/-8s delays of the light rule */
:root[data-theme="dark"] .pillar-card:hover{ animation:none; background:var(--surface-raised); border-color:color-mix(in srgb,var(--pillar-accent) 55%,var(--dk-line-3)); box-shadow:inset 0 1px 0 var(--dk-light-top); }
:root[data-theme="dark"] .pillar-head--engineering{ --pillar-color:var(--blue-text); }
:root[data-theme="dark"] .pillar-head--marketing{ --pillar-color:#71c1e0; }            /* = --mkt-text */
:root[data-theme="dark"] .pillar-head--infrastructure{ --pillar-color:var(--lime-text); }
:root[data-theme="dark"] .pillar-item--product{ --item-ico:var(--blue-text); }
:root[data-theme="dark"] .pillar-item--build{ --item-ico:var(--orange-text); }
:root[data-theme="dark"] .pillar-item--mkt{ --item-ico:#71c1e0; }
:root[data-theme="dark"] .pillar-item--inf{ --item-ico:var(--lime-text); }
/* -- Facts strip, FAQ, steps -- */
:root[data-theme="dark"] .home-fact svg{ color:var(--blue-text); }
:root[data-theme="dark"] .home-faq summary::after{ color:var(--blue-text); }
:root[data-theme="dark"] .home-faq summary:focus-visible{ outline-color:var(--dk-focus); }
:root[data-theme="dark"] .home-faq details[open]{ border-color:var(--dk-line-3); }
:root[data-theme="dark"] .home-steps{ --step-ring:rgba(255,125,40,.9); --step-link:rgba(255,125,40,.9); }   /* the hero particle orange #ff7d28 (Mars, 23 Nov); animation unchanged */
/* -- Info panels (home-panels.js). `body` in the selector (0,3,1) beats the old dark draft in services/websites.css (0,3,0, loaded after home.css) -- */
:root[data-theme="dark"] body .web-modal{ background:var(--dk-scrim); }
:root[data-theme="dark"] body .web-modal-card{ background:var(--dk-s3); box-shadow:0 0 0 1px var(--dk-edge), inset 0 1px 0 var(--dk-edge-hi), var(--shadow-pop); }   /* the card has no border in light, so the edge is a zero-blur ring (no layout shift) */
:root[data-theme="dark"] body .web-modal-card h3{ color:var(--text-primary); }
:root[data-theme="dark"] body .web-infra-lead{ color:var(--text-secondary); }
:root[data-theme="dark"] body .web-infra-list li{ color:var(--text-primary); }
:root[data-theme="dark"] body .web-infra-list svg{ color:var(--blue-text); }
:root[data-theme="dark"] body .web-infra-more{ color:var(--blue-text); }
:root[data-theme="dark"] body .web-infra-all{ color:var(--text-secondary); }
:root[data-theme="dark"] body .web-modal-x{ color:var(--text-secondary); }
:root[data-theme="dark"] body .web-modal-x:hover{ background:var(--dk-s4); color:var(--text-primary); }
:root[data-theme="dark"] body .web-modal-x:focus-visible{ outline-color:var(--dk-focus); }
:root[data-theme="dark"] .rufen-word{ color:var(--blue-text); }
:root[data-theme="dark"] .rufen-word :is(.rw-b,.rw-d){ color:var(--orange-text); }
/* -- Interactive Sandbox (window, foundation): two fixes it needs on this page -- */
:root[data-theme="dark"] .form-group input.range-slider{ background-color:transparent; }                         /* the foundation's .form-group input rule painted a canvas box round the slider */
:root[data-theme="dark"] .form-group input.range-slider:focus{ background-color:transparent; box-shadow:none; }
/* preset rows: rest is a faint plate on the s2 body, never a recess. html:root[...] = (0,2,1); with :not(.active) = (0,4,1) beats the foundation (0,3,0) and its :hover (0,3,0); the hover rule is one class heavier. */
html:root[data-theme="dark"] .preset-btn:not(.active){ background:rgba(150,175,230,.05); border-color:var(--dk-line-2); }
html:root[data-theme="dark"] .preset-btn:not(.active):hover{ background:rgba(129,170,247,.09); border-color:var(--dk-line-3); }
/* voice tab post-call strip: lift from the s1 recess to the body level, at rest and after the call. #voice-summary-box = (1,x,x) id specificity, beats the foundation's (0,5,0). */
html:root[data-theme="dark"] #voice-summary-box.console-footer,
html:root[data-theme="dark"] .voice-log-console.show-summary #voice-summary-box.console-footer{ background:var(--dk-s2); border-top-color:var(--dk-line-3); }
html:root[data-theme="dark"] .preset-btn.active,
html:root[data-theme="dark"] .preset-btn.active:hover{ background:var(--dk-s3); border-color:rgba(243,157,94,.45); box-shadow:inset 2px 0 0 var(--orange-text); color:var(--text-primary); }   /* selected row = s3 + 2px bar; no brown */
html:root[data-theme="dark"] .preset-btn.active strong{ color:var(--orange-text); }
/* ---- ROI calculator: tints, not brand colours (the slider rule in styles.css groups two pseudo-elements and Chrome drops it) ---- */
:root[data-theme="dark"] .range-slider{ --c:var(--blue-text); }                    /* (0,3,0) */
:root[data-theme="dark"] #range-staff{ --c:var(--blue-text); }                      /* (1,2,0) beats #range-staff{--c} (1,0,0) */
:root[data-theme="dark"] #range-software{ --c:var(--orange-text); }
:root[data-theme="dark"] .range-slider::-webkit-slider-thumb{ background:var(--dk-s3); box-shadow:none; }   /* ring colour = var(--c) already (3px border) */
:root[data-theme="dark"] .range-slider::-moz-range-thumb{ background:var(--dk-s3); box-shadow:none; }
:root[data-theme="dark"] .range-slider:focus-visible::-webkit-slider-thumb{ box-shadow:0 0 0 4px rgba(151,191,254,.35); }
:root[data-theme="dark"] .range-slider:focus-visible::-moz-range-thumb{ box-shadow:0 0 0 4px rgba(151,191,254,.35); }
:root[data-theme="dark"] .container-software .slider-label,
:root[data-theme="dark"] #val-software{ color:var(--orange-text); }
:root[data-theme="dark"] .savings-value{ color:var(--green-text); text-shadow:none; }
:root[data-theme="dark"] .cost-bar--legacy span{ background:linear-gradient(90deg,rgba(234,136,133,.70),var(--red-text)); }
:root[data-theme="dark"] .cost-bar--agentic span{ background:linear-gradient(90deg,rgba(129,170,247,.70),var(--blue-text)); }
/* hero badge: the lucide svg inherits currentColor, so the container sets the tint */
:root[data-theme="dark"] .hero-badge{ color:var(--blue-text); }

/* ---- Phones: the three pillar cards become one card with a tab per pillar (Mars, 23 Nov) ----
   The tabs sit inside the card, across its top edge (home-panels.js moves the tab row into whichever card is open).
   Tap a tab, use the arrow keys, or swipe the card. Desktop is unchanged (the tabs are hidden there). */
.pillar-tabs { display: none; }
@media (max-width: 767px) {
  .pillar-tabs {
    display: flex; margin: -28px -26px 6px; padding: 0 10px; border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }
  .pillar-tab {
    flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 16px 2px 13px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; cursor: pointer;
    font: 600 0.8rem/1 var(--font-display); color: var(--text-secondary); white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease;
  }
  .pillar-tab::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tab-c); opacity: 0.4; flex: none; transition: opacity 0.2s ease; }
  .pillar-tab.is-active { color: var(--tab-c); border-bottom-color: var(--tab-c); }
  .pillar-tab.is-active::before { opacity: 1; }
  .pillar-tab:focus-visible { outline: 2px solid var(--tab-c); outline-offset: -2px; border-radius: 6px; }
  .pillar-tab--eng { --tab-c: var(--accent-blue); }
  .pillar-tab--mkt { --tab-c: var(--accent-med, #0f5fa6); }
  .pillar-tab--inf { --tab-c: #4d7c0f; }
  /* all three cards share one grid cell, so the card is always as tall as the longest list and the page below never jumps */
  .pillars-grid { gap: 0; }
  /* The hidden cards sit in the same spot, so they must never catch a tap: on iPhone Safari a hidden card stacked above
     the open one could swallow it (only Engineering, the first card, opened its pop-ups). The open card is on top. */
  .pillars-grid .pillar-card { grid-area: 1 / 1; visibility: hidden; pointer-events: none; touch-action: pan-y; }
  .pillars-grid .pillar-card.is-active { visibility: visible; pointer-events: auto; position: relative; z-index: 2; }
  .pillars-grid .pillar-card.is-active > :not(.pillar-tabs) { animation: pillarIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .pillars-grid .pillar-card .pillar-head { display: none; }   /* the tab carries the pillar name */
  .pillars-grid .pillar-list { gap: 9px; }
}
@keyframes pillarIn { from { opacity: 0; transform: translateX(var(--pillar-from, 12px)); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pillars-grid .pillar-card.is-active > * { animation: none !important; } }
:root[data-theme="dark"] .pillar-tabs { border-bottom-color: var(--dk-line-2); }
:root[data-theme="dark"] .pillar-tab--eng { --tab-c: var(--blue-text); }
:root[data-theme="dark"] .pillar-tab--mkt { --tab-c: #71c1e0; }
:root[data-theme="dark"] .pillar-tab--inf { --tab-c: var(--lime-text); }

/* ---- Phones: the facts are one line that rotates, set into the page instead of a peeled card (Mars, 23 Nov) ----
   peel.js skips the list on phones (data-peel-desktop); home-panels.js moves .is-on from fact to fact. */
@media (max-width: 767px) {
  .home-facts { padding: 6px 0 30px; }
  .home-facts .home-facts-list {
    display: grid; grid-template-columns: minmax(0, 1fr); padding: 0; min-height: 48px;
    background: none !important; border: 0 !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }   /* !important: the dark glass-card rules are heavier, and on phones this line must sit in the page, not in a card */
  .home-facts .home-facts-list::before { display: none; }
  .home-facts .home-facts-list > li,
  .home-facts .home-facts-list > li:last-child:nth-child(odd) {
    grid-area: 1 / 1; justify-content: center; text-align: center; font-size: 1rem;
    opacity: 0; transform: translateY(10px); transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .home-facts .home-facts-list > li.is-on { opacity: 1; transform: none; }
  .home-facts .home-facts-list > li.is-off { transform: translateY(-10px); }
  .home-facts-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
  .home-facts-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted, #94a3b8); opacity: 0.35; transition: opacity 0.3s ease, width 0.3s ease; }
  .home-facts-dots i.is-on { width: 16px; border-radius: 3px; opacity: 1; background: var(--accent-blue); }
}
@media (min-width: 768px) { .home-facts-dots { display: none; } }
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .home-facts .home-facts-list > li { transition: none; }
}
:root[data-theme="dark"] .home-facts-dots i.is-on { background: var(--blue-text); }

/* ---- Phones: How we work lights up as you scroll (Mars, 23 Nov) ----
   Instead of the timed loop, each card gets its orange outline when it reaches the middle of the screen, and the
   connector above it draws in. Scrolling back up turns them off again. home-panels.js sets .is-scroll and .is-lit. */
@media (max-width: 767px) {
  .home-steps.is-scroll .home-step,
  .home-steps.is-scroll .home-step::after { animation: none !important; }
  .home-steps.is-scroll .home-step { outline-color: transparent; transition: outline-color 0.45s ease; }
  .home-steps.is-scroll .home-step.is-lit { outline-color: var(--step-ring, rgba(255, 107, 0, 0.65)); }
  .home-steps.is-scroll .home-step::after { --link: 0; transition: --link 0.45s ease; }
  .home-steps.is-scroll .home-step.is-linked::after { --link: 1; }
}
@media (max-width: 767px) {
  #capabilities.pillars-section { padding-bottom: 8px; }   /* the rotating facts sit just under the pillar card */
  .home-facts { padding-top: 14px; }
}

/* ---- The statement between "How it all connects" and the Sandbox (Mars, 23 Nov) ----
   One large line set into the page. "own" is blue, and an orange line draws under it as it comes into view
   (home-panels.js adds .is-in). */
.home-statement { padding: 72px 0; text-align: center; }
.home-statement-line {
  margin: 0 auto; max-width: 18ch; font: 700 clamp(2rem, 4.6vw, 3.2rem)/1.12 var(--font-display);
  letter-spacing: -0.02em; color: var(--text-primary); text-wrap: balance;
  opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.home-statement-mark { position: relative; display: inline-block; color: var(--accent-blue); }
/* Orange scribes: hand-drawn marker marks that write themselves in, one after another, when the section comes into view
   (.is-in from home-panels.js). Each word sets its own start with --d. Kinds: line (under "own", two passes),
   wave (under "success"), circle (round "world-class"), small (under a word in the points). */
.scribe { position: relative; display: inline-block; white-space: nowrap; }
.scribe-svg { position: absolute; overflow: visible; pointer-events: none; }
.scribe--line .scribe-svg { left: -6%; width: 112%; bottom: -0.2em; height: 0.36em; }
.scribe--wave .scribe-svg { left: -3%; width: 106%; bottom: -0.3em; height: 0.45em; }
.scribe--circle .scribe-svg { left: -9%; width: 118%; top: -28%; height: 156%; }
.scribe--small .scribe-svg { left: -4%; width: 108%; bottom: -0.22em; height: 0.35em; }
.scribe-svg path {
  fill: none; stroke: var(--accent-orange); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.55s cubic-bezier(0.55, 0.1, 0.35, 1) var(--d, 0.45s);
}
.scribe--line .scribe-svg path + path { stroke-width: 3.5; transition-duration: 0.4s; transition-delay: calc(var(--d, 0.45s) + 0.5s); }
.scribe--wave .scribe-svg path { stroke-width: 3; }
.scribe--circle .scribe-svg path { stroke-width: 2.5; transition-duration: 0.7s; }
.scribe--small .scribe-svg path { stroke-width: 2.5; transition-duration: 0.35s; }
.home-statement-sub {
  margin: 16px auto 0; max-width: 52ch; font-size: 1.08rem; line-height: 1.55; color: var(--text-secondary);
  opacity: 0; transition: opacity 0.7s ease 0.3s;
}
/* the three things owning it gets you: icon and one line each, in a row (stacked on phones), no cards */
.home-statement-points {
  list-style: none; margin: 34px auto 0; padding: 0; max-width: 980px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 30px; text-align: left;
}
.home-statement-points li {
  display: flex; align-items: flex-start; gap: 12px; font-size: 0.95rem; line-height: 1.5; color: var(--text-secondary);
  opacity: 0; transform: translateY(10px); transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.home-statement-points li:nth-child(1) { transition-delay: 1.1s; }
.home-statement-points li:nth-child(2) { transition-delay: 1.25s; }
.home-statement-points li:nth-child(3) { transition-delay: 1.4s; }
.home-statement-points svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--accent-orange); }
.home-statement-points b { color: var(--text-primary); font-weight: 600; }
.home-statement-next {
  display: inline-flex; align-items: center; gap: 6px; margin: 30px 0 0; font: 600 0.9rem/1 var(--font-display); color: var(--accent-blue);
  opacity: 0; transition: opacity 0.6s ease 2.7s;
}
/* the lead-in's arrow is a scribe too: a hand-drawn arrow curling down to the Sandbox, drawn after the other scribes */
.home-statement-next { align-items: flex-start; }
.scribe-arrow { width: 34px; height: 50px; margin-top: 4px; overflow: visible; }
.scribe-arrow path {
  fill: none; stroke: var(--accent-orange); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.5s cubic-bezier(0.55, 0.1, 0.35, 1) 2.9s;
}
.scribe-arrow path + path { transition-duration: 0.25s; transition-delay: 3.35s; }
.home-statement.is-in .scribe-arrow path { stroke-dashoffset: 0; }
.home-statement.is-in .home-statement-points li { opacity: 1; transform: none; }
.home-statement.is-in .home-statement-next { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .home-statement.is-in .home-statement-next .scribe-arrow { animation: stNudge 2s ease-in-out 3.8s infinite; }
}
@keyframes stNudge { 0%, 100% { transform: none; } 50% { transform: translateY(4px); } }
@media (max-width: 767px) {
  .home-statement-points { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 26px; max-width: 420px; }
  .home-statement-points li { font-size: 0.92rem; }
  .home-statement-next { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-statement-points li, .home-statement-next { opacity: 1; transform: none; transition: none; }
}
:root[data-theme="dark"] .home-statement-points svg { color: #ff7d28; }
:root[data-theme="dark"] .home-statement-next { color: var(--blue-text); }
.home-statement-sub strong { color: var(--text-primary); font-weight: 600; }
.home-statement.is-in .home-statement-line { opacity: 1; transform: none; }
.home-statement.is-in .home-statement-sub { opacity: 1; }
.home-statement.is-in .scribe-svg path { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) {
  .home-statement-line, .home-statement-sub { opacity: 1; transform: none; transition: none; }
  .scribe-svg path, .scribe-arrow path { stroke-dashoffset: 0; transition: none; }
}
:root[data-theme="dark"] .home-statement-mark { color: #468cff; }
:root[data-theme="dark"] .scribe-svg path, :root[data-theme="dark"] .scribe-arrow path { stroke: #ff7d28; }

/* ---- Phones: one even rhythm, 48px above and below each main section (Mars, 23 Nov) ----
   The pillar card and the rotating facts line stay close together on purpose. */
@media (max-width: 767px) {
  #how-it-connects.iac-section,
  #sandbox.sandbox-section,
  #how-we-work.home-section,
  #faq.home-section,
  .home-statement { padding-top: 48px !important; padding-bottom: 48px !important; }
  #contact.contact-section { padding-top: 48px !important; }
  .home-statement-line { font-size: 1.9rem; }
  .home-statement-sub { font-size: 0.95rem; margin-top: 12px; }
}
@media (max-width: 767px) {
  /* the statement holds a whole phone screen for itself: the space between the header and the bottom bar, content centred (Mars, 23 Nov) */
  .home-statement {
    min-height: calc(100vh - var(--home-hdr, 60px) - var(--home-bar, 36px)); min-height: calc(100svh - var(--home-hdr, 60px) - var(--home-bar, 36px));
    display: flex; flex-direction: column; justify-content: center;
    padding-top: 56px !important; padding-bottom: 56px !important;
  }
  .home-statement-line { font-size: 2.1rem; }
  .home-statement-sub { margin-top: 18px; }
  .home-statement-points { margin-top: 32px; gap: 18px; }
  .home-statement-next { margin-top: 30px; }
}
@media (max-width: 767px) {
  /* Every home section holds at least one phone screen for itself, content centred (Mars, 23 Nov).
     A screen = the space between the header (80px) and the bottom bar (36px). Sections taller than that keep their
     natural height. The pillar card and the rotating facts share one screen: the card's section leaves room for the
     facts line (about 110px) under it. */
  #how-it-connects, #sandbox, #how-we-work, #faq, #contact {
    min-height: calc(100vh - var(--home-hdr, 60px) - var(--home-bar, 36px)); min-height: calc(100svh - var(--home-hdr, 60px) - var(--home-bar, 36px));
    display: flex; flex-direction: column; justify-content: center;
  }
  #capabilities.pillars-section {
    min-height: calc(100vh - var(--home-hdr, 60px) - var(--home-bar, 36px)); min-height: calc(100svh - var(--home-hdr, 60px) - var(--home-bar, 36px));
    display: flex; flex-direction: column; justify-content: center;
  }
}


@media (max-width: 767px) {
  /* the rotating facts get their own room between the pillar card and "How it all connects" (Mars, 23 Nov) */
  .home-facts { padding-top: 0 !important; padding-bottom: 96px !important; }   /* the pillar screen already leaves room above */
}
