/* ==========================================================================
   CUBETROOP — styles.css
   Palette: the six real cube colors on white sticker / black plastic.
   Type: Unbounded (display) · Atkinson Hyperlegible (body) · JetBrains Mono (notation)
   ========================================================================== */

:root {
  /* plastic + sticker */
  --ink: #17181c;        /* cube plastic */
  --ink-soft: #2a2b31;
  --paper: #ffffff;      /* white sticker */
  --paper-dim: #f4f5f7;
  --line: #e2e4e8;
  --muted: #5b5e66;

  /* the six faces */
  --ct-white: #ffffff;
  --ct-yellow: #ffd21e;
  --ct-red: #e03a2f;
  --ct-orange: #ff7a1a;
  --ct-blue: #0b5fd9;
  --ct-green: #00a457;

  /* roles */
  --accent: var(--ct-blue);      /* overridden per page */
  --action: var(--ct-blue);
  --donate: var(--ct-green);

  --radius-st: 14%;              /* sticker corner rounding */
  --radius: 14px;
  --shadow: 0 10px 30px rgba(23, 24, 28, 0.10);
  --shadow-lift: 0 16px 44px rgba(23, 24, 28, 0.16);

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --max: 1120px;
}

/* per-page face color (set on <body data-accent="...">) */
body[data-accent="blue"]   { --accent: var(--ct-blue); }
body[data-accent="green"]  { --accent: var(--ct-green); }
body[data-accent="yellow"] { --accent: var(--ct-yellow); }
body[data-accent="red"]    { --accent: var(--ct-red); }
body[data-accent="orange"] { --accent: var(--ct-orange); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--ct-blue); }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--ct-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5.4vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { margin: 0 0 1em; }
.lede { font-size: 1.18rem; color: var(--muted); max-width: 40em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: var(--radius-st);
  background: var(--accent);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12);
}

.notation {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* ---------- stickers (signature unit) ---------- */
.st {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: var(--radius-st);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.12);
  background: var(--paper-dim); /* neutral fallback; color classes override */
}
.st--w { background: var(--ct-white); border: 1px solid var(--line); }
.st--y { background: var(--ct-yellow); }
.st--r { background: var(--ct-red); }
.st--o { background: var(--ct-orange); }
.st--b { background: var(--ct-blue); }
.st--g { background: var(--ct-green); }

.logo-mark {
  display: inline-grid;
  grid-template-columns: repeat(3, 9px);
  gap: 2px;
  padding: 4px;
  background: var(--ink);
  border-radius: 6px;
}
.logo-mark .st { width: 9px; height: 9px; box-shadow: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem;
  letter-spacing: 0.02em;
}
.brand:hover { color: var(--ink); }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  position: relative;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 10px;
}
.site-nav a:hover { background: var(--paper-dim); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 4px; border-radius: 3px;
  background: var(--accent);
}
.site-nav .nav-cta {
  background: var(--ink); color: #fff; margin-left: 8px;
}
.site-nav .nav-cta:hover { background: var(--ink-soft); }
.site-nav .nav-cta::after { display: none; }

.nav-toggle {
  display: none;
  background: none; border: 2px solid var(--ink);
  border-radius: 10px; padding: 8px 10px;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700;
  cursor: pointer;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  padding: 14px 24px;
  border-radius: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { color: #fff; }
.btn--accent { background: var(--action); color: #fff; }
.btn--accent:hover { color: #fff; }
.btn--donate { background: var(--donate); color: #fff; }
.btn--donate:hover { color: #fff; }
.btn--ghost {
  background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}

/* ---------- hero ---------- */
.hero { padding: 72px 0 56px; overflow: hidden; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.hero-copy .btn { margin-right: 12px; margin-bottom: 12px; }

/* scramble → solve strip */
.solve-strip {
  display: inline-flex; gap: 5px; margin: 18px 0 26px;
}
.solve-strip .st {
  width: 22px; height: 22px;
  transition: background 0.6s ease;
}
.solve-strip-caption {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 22px;
}

/* 3D cube */
.cube-stage {
  perspective: 1100px;
  display: grid; place-items: center;
  min-height: 380px;
  touch-action: none;
  cursor: grab;
}
.cube-stage:active { cursor: grabbing; }
.cube3d {
  position: relative;
  width: 230px; height: 230px;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(32deg);
}
.face {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 7px;
  padding: 7px;
  background: var(--ink);
  border-radius: 14px;
}
.face .st { width: auto; height: auto; border-radius: 12%; box-shadow: inset 0 -4px 0 rgba(0,0,0,0.14); }
.face--front  { transform: translateZ(115px); }
.face--back   { transform: rotateY(180deg) translateZ(115px); }
.face--right  { transform: rotateY(90deg)  translateZ(115px); }
.face--left   { transform: rotateY(-90deg) translateZ(115px); }
.face--top    { transform: rotateX(90deg)  translateZ(115px); }
.face--bottom { transform: rotateX(-90deg) translateZ(115px); }

.cube-hint {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section--dim { background: var(--paper-dim); }
.section--ink { background: var(--ink); color: #fff; }
.section--ink .eyebrow, .section--ink .lede { color: #b9bcc4; }
.section-head { max-width: 46em; margin-bottom: 40px; }

/* stat strip */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.stat {
  border-top: 4px solid var(--accent);
  padding-top: 14px;
}
.stat:nth-child(1) { border-color: var(--ct-green); }
.stat:nth-child(2) { border-color: var(--ct-blue); }
.stat:nth-child(3) { border-color: var(--ct-yellow); }
.stat:nth-child(4) { border-color: var(--ct-red); }
.stat b {
  font-family: var(--font-display);
  font-size: 1.9rem; font-weight: 700; display: block;
}
.stat span { color: var(--muted); font-size: 0.95rem; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .st { width: 18px; height: 18px; margin-bottom: 14px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); margin: 0; font-size: 0.98rem; }

/* 8 steps (real sequence → numbering earns its place) */
.steps { counter-reset: step; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 32px; padding: 0; margin: 0; list-style: none; }
.steps li {
  counter-increment: step;
  display: flex; gap: 16px; align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border-radius: 22%;
  background: var(--ink); color: #fff;
  align-self: center;
}
.steps li:nth-child(3n+1)::before { background: var(--ct-blue); }
.steps li:nth-child(3n+2)::before { background: var(--ct-green); }
.steps li:nth-child(3n+3)::before { background: var(--ct-red); }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 0.95rem; }

/* ---------- gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 190px;
  gap: 12px;
}
.gallery figure {
  margin: 0; position: relative; overflow: hidden;
  border-radius: 12px;
  background: var(--paper-dim);
  cursor: zoom-in;
}
.gallery figure.wide { grid-column: span 2; }
.gallery figure.tall { grid-row: span 2; }
.gallery img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.35s ease;
}
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 14px 12px;
  font-size: 0.85rem; color: #fff;
  background: linear-gradient(transparent, rgba(23,24,28,0.75));
  opacity: 0; transition: opacity 0.25s ease;
}
.gallery figure:hover figcaption { opacity: 1; }
/* colored corner tab on hover — the sticker peeking through */
.gallery figure::after {
  content: "";
  position: absolute; top: 10px; right: 10px;
  width: 14px; height: 14px; border-radius: var(--radius-st);
  background: var(--accent);
  opacity: 0; transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.gallery figure:hover::after { opacity: 1; transform: scale(1); }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(23,24,28,0.92);
  display: none;
  align-items: center; justify-content: center;
  padding: 4vh 4vw;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw; max-height: 82vh;
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
}
.lightbox .lb-caption {
  position: absolute; bottom: 4vh; left: 0; right: 0;
  text-align: center; color: #cfd2d8; font-size: 0.95rem;
  padding: 0 60px;
}
.lightbox button {
  position: absolute;
  background: rgba(255,255,255,0.12);
  color: #fff; border: none;
  width: 46px; height: 46px; border-radius: 12px;
  font-size: 1.3rem; cursor: pointer;
}
.lightbox button:hover { background: rgba(255,255,255,0.24); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- team ---------- */
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.leader {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
}
.leader-photo {
  aspect-ratio: 1;
  background: var(--paper-dim);
  display: grid; place-items: center;
}
.leader-photo img { width: 100%; height: 100%; object-fit: cover; }
.leader-initials {
  font-family: var(--font-display); font-weight: 800;
  font-size: 2.6rem; color: #fff;
  width: 96px; height: 96px;
  display: grid; place-items: center;
  border-radius: 18%;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,0.14);
}
.leader-body { padding: 20px; }
.leader-body h3 { margin-bottom: 2px; }
.leader-role {
  font-family: var(--font-mono); font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); display: block; margin-bottom: 10px;
}
.leader-body p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* ---------- partners / timeline ---------- */
.partners { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.partner {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
  font-weight: 700;
  display: flex; align-items: center; gap: 12px;
}
.partner small { display: block; font-weight: 400; color: var(--muted); }

.timeline { border-left: 3px solid var(--line); margin-left: 8px; padding-left: 32px; }
.timeline-item { position: relative; padding-bottom: 48px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute; left: -41px; top: 6px;
  width: 15px; height: 15px; border-radius: var(--radius-st);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--paper);
}
.timeline-item:nth-child(5n+1)::before { background: var(--ct-blue); }
.timeline-item:nth-child(5n+2)::before { background: var(--ct-green); }
.timeline-item:nth-child(5n+3)::before { background: var(--ct-yellow); }
.timeline-item:nth-child(5n+4)::before { background: var(--ct-red); }
.timeline-item:nth-child(5n+5)::before { background: var(--ct-orange); }
.timeline-item .when {
  font-family: var(--font-mono); font-size: 0.78rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.timeline-item h3 { margin: 4px 0 8px; font-size: 1.25rem; }

/* quotes */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.quote {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
}
.quote::before {
  content: "";
  position: absolute; top: -7px; left: 24px;
  width: 14px; height: 14px; border-radius: var(--radius-st);
  background: var(--ct-yellow);
}
.quote p { font-size: 1.02rem; margin-bottom: 10px; }
.quote cite { font-style: normal; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }

/* ---------- learn resources ---------- */
.resources { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.resource {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.resource .kind {
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted);
}
.resource .kind::before {
  content: ""; width: 11px; height: 11px; border-radius: var(--radius-st);
}
.resource[data-kind="doc"] .kind::before { background: var(--ct-blue); }
.resource[data-kind="video"] .kind::before { background: var(--ct-red); }
.resource[data-kind="pdf"] .kind::before { background: var(--ct-green); }
.resource h3 { margin: 0; }
.resource p { color: var(--muted); font-size: 0.95rem; margin: 0; flex: 1; }
.resource a { font-weight: 700; text-decoration: none; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; }
.faq-list details {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
.faq-list summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 1.08rem;
  padding: 18px 40px 18px 0;
  position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 1.2rem;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 22%;
  background: var(--paper-dim);
  transition: transform 0.2s ease, background 0.2s ease;
}
.faq-list details[open] summary::after {
  content: "–";
  background: var(--accent);
  color: #fff;
}
.faq-list details p { color: var(--muted); padding-bottom: 18px; max-width: 60ch; }

/* ---------- forms ---------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; }
form.contact-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 0.95rem; }
.field input, .field textarea, .field select {
  font: inherit;
  padding: 13px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  transition: border-color 0.15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--ct-blue);
}
.form-note { font-size: 0.9rem; color: var(--muted); }

.donate-panel {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
}
.donate-panel h2 { color: #fff; }
.donate-panel p { color: #b9bcc4; }
.donate-panel .big {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700; color: #fff;
}
.donate-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink);
  color: #b9bcc4;
  padding: 56px 0 32px;
  margin-top: 72px;
}
.site-footer .wrap {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.site-footer h3 { color: #fff; font-size: 0.95rem; }
.site-footer a { color: #e6e8ec; text-decoration: none; }
.site-footer a:hover { color: var(--ct-yellow); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-stickers { display: inline-flex; gap: 4px; margin: 14px 0; }
.footer-bottom {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 0.85rem;
}

/* ---------- cta band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { max-width: 20em; margin-left: auto; margin-right: auto; }
.cta-band .btn { margin: 8px 6px 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .cube-stage { min-height: 300px; }
  .cube3d { width: 180px; height: 180px; }
  .face--front  { transform: translateZ(90px); }
  .face--back   { transform: rotateY(180deg) translateZ(90px); }
  .face--right  { transform: rotateY(90deg)  translateZ(90px); }
  .face--left   { transform: rotateY(-90deg) translateZ(90px); }
  .face--top    { transform: rotateX(90deg)  translateZ(90px); }
  .face--bottom { transform: rotateX(-90deg) translateZ(90px); }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
  .contact-grid { grid-template-columns: 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr; gap: 28px; }

  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch;
    padding: 12px 24px 20px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px; }
  .site-nav .nav-cta { margin-left: 0; text-align: center; }
}

@media (max-width: 520px) {
  .gallery { grid-template-columns: 1fr; grid-auto-rows: 220px; }
  .gallery figure.wide, .gallery figure.tall { grid-column: auto; grid-row: auto; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
