/* Home page: the section chart (see home.js) */
:root { --pill: #145C9E; --pill-shadow: #0B3A66; --pill-text: #FEFAE0; --picked: #19A83A; --picked-shadow: #11782A; --area: #145C9E; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --pill: #FEFAE0; --pill-shadow: #C7BF99; --pill-text: #10365C; --area: #FEFAE0; }
}

body.home { min-height: 100vh; display: flex; flex-direction: column; }
.home-top { padding: 14px 16px; }
.home-top .brand img { width: 46px; height: 46px; border-radius: 0; filter: drop-shadow(0 4px 8px rgba(27, 42, 61, 0.18)); }
.home-top .brand { font-size: 22px; }
main { flex: 1; display: flex; flex-direction: column; }
/* Before a section is opened, the chart sits in the middle of the screen */
.stage-wrap { align-items: center; min-height: 0; }
body:not(.open) .stage-wrap { min-height: calc(100vh - 200px); padding-top: 0; }

/* The chart and its buttons scale together (sizes inside are % / container units) */
.stage-wrap { display: flex; justify-content: center; padding: 6vh 16px 0; transition: padding 0.6s cubic-bezier(.2,.8,.2,1), min-height 0.6s cubic-bezier(.2,.8,.2,1); }
.stage {
  position: relative; container-type: inline-size;
  width: min(760px, 100%); aspect-ratio: 1.45;
  transition: width 0.6s cubic-bezier(.2,.8,.2,1);
}
body.open .stage-wrap { padding-top: 0; }
body.open .stage { width: min(470px, 100%); }

.radar { position: absolute; left: 50%; top: 50%; width: 52%; transform: translate(-50%, -50%); overflow: visible; }
.radar .outline { fill: var(--card); stroke: var(--ink); stroke-width: 0.3; stroke-dasharray: 0.8 0.8; }
.radar #rings polygon { fill: none; stroke: var(--ink); stroke-opacity: 0.55; stroke-width: 0.25; stroke-dasharray: 0.8 0.8; }
.radar #spokes line { stroke: var(--ink); stroke-opacity: 0.6; stroke-width: 0.25; stroke-dasharray: 0.8 0.8; }
.radar .area { fill: var(--area); fill-opacity: 0.16; stroke: var(--area); stroke-width: 0.45; stroke-linejoin: round; }

/* The raised pill buttons, placed around the chart by home.js */
#pills button {
  position: absolute; transform: translate(-50%, -50%);
  width: 26.5cqw; padding: 0.7cqw 0; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--pill); color: var(--pill-text);
  font: 600 4.6cqw/1.15 "Fredoka", "Nunito", sans-serif;
  box-shadow: 0 0.6cqw 0 var(--pill-shadow);
  transition: background 0.25s, box-shadow 0.25s, transform 0.12s;
  white-space: nowrap;
}
#pills button:hover { filter: brightness(1.08); }
#pills button:active { transform: translate(-50%, calc(-50% + 0.4cqw)); box-shadow: 0 0.2cqw 0 var(--pill-shadow); }
#pills button[aria-current="true"] { background: var(--picked); color: #fff; box-shadow: 0 0.6cqw 0 var(--picked-shadow); }
#pills button:focus-visible { outline: 3px solid var(--picked); outline-offset: 3px; }

.legend { position: absolute; right: 13%; bottom: 3%; display: flex; align-items: center; gap: 2.4cqw; font: 600 4.4cqw "Nunito", sans-serif; color: var(--ink); }
.legend .swatch { width: 6.4cqw; height: 6.4cqw; background: var(--area); opacity: 0.55; }

/* The opened section, under the shrunk chart */
.panel { width: 100%; box-sizing: border-box; max-width: 1240px; margin: 0 auto; padding: 8px 16px 48px; opacity: 0; transform: translateY(24px); pointer-events: none; transition: opacity 0.45s 0.15s, transform 0.45s 0.15s; }
body.open .panel { opacity: 1; transform: none; pointer-events: auto; }
body:not(.open) .panel { height: 0; padding: 0; overflow: hidden; }
.panel h2 { font-size: clamp(34px, 5vw, 48px); margin: 0 0 16px; }
.panel .lead { font-size: 20px; }
.small { font-size: 14px; margin-top: 12px; }

/* White boxes: 4 across; with more than 4 they scroll left and right */
.boxes-wrap { position: relative; }
.boxes {
  display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 16px; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.boxes > * { flex: 0 0 calc((100% - 3 * 24px) / 4); scroll-snap-align: start; }
.scroll-btn {
  position: absolute; top: calc(50% - 8px); transform: translateY(-50%); z-index: 1;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font: 800 22px "Nunito", sans-serif;
  box-shadow: 0 3px 0 var(--accent-shadow);
}
.scroll-btn.prev { left: -14px; }
.scroll-btn.next { right: -14px; }
.scroll-btn[hidden] { display: none; }
.project {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  min-height: 420px; padding: 18px 20px 28px; border-radius: 36px; background: #fff;
  color: var(--ink); text-decoration: none; box-shadow: 0 1px 0 var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .project { background: #06223D; } }
a.project:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(20, 42, 61, 0.12); }
.project h3 { font-size: 22px; margin: 4px 0 8px; }
.project p { color: var(--ink-soft); margin: 0; }
.project .project-icon { width: 104px; height: 104px; margin-top: auto; border-radius: 23px; box-shadow: 0 6px 16px rgba(27, 42, 61, 0.15); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.split { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.app-icon { width: 160px; height: 160px; filter: drop-shadow(0 10px 20px rgba(20, 92, 158, 0.3)); }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 10px 0; }
.faq summary { font-weight: 800; cursor: pointer; }
.faq p { margin: 8px 0 0; color: var(--ink-soft); }
ul.plain { padding-left: 20px; }
ul.plain li { margin: 8px 0; }

.home-foot { max-width: 1240px; width: 100%; margin: 0 auto; padding: 20px 16px 32px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: 14px; color: var(--ink-soft); border-top: 1px solid var(--line); }
.home-foot a { color: var(--ink-soft); }

@media (max-width: 900px) {
  .boxes > * { flex-basis: calc((100% - 24px) / 2.15); }
  .project { min-height: 300px; }
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stage { aspect-ratio: 1.15; }
  .radar { width: 58%; }
  #pills button { width: 30cqw; font-size: 5.4cqw; }
  .legend { right: 4%; font-size: 5cqw; }
  body.open .stage { width: 100%; }
  .cards, .split { grid-template-columns: 1fr; }
  .boxes > * { flex-basis: 78%; }
  .project { min-height: 260px; }
  .scroll-btn { display: none; }
  .app-icon { width: 110px; height: 110px; }
}
@media (prefers-reduced-motion: reduce) { .stage, .stage-wrap, .panel { transition: none; } }
