/* English Hub — colourful sticker-book look: chunky rounded type, bold course colours, cards that pop off a soft dotted page. */
:root {
  --page: #f6f3ff;
  --dots: #e4ddff;
  --surface: #ffffff;
  --ink: #1c1640;
  --muted: #5f5a80;
  --line: #e2ddf5;
  --brand: #5b3df5;
  --brand-ink: #ffffff;
  --shadow: 0 3px 0 #1c164014, 0 12px 28px -16px #1c164055;

  --sun: #ffd23f;       --sun-ink: #3a2c00;
  --mint: #3ddc97;      --mint-ink: #04331f;
  --sky: #4cc3ff;       --sky-ink: #032d44;
  --berry: #ff4f8b;     --berry-ink: #ffffff;
  --tangerine: #ff8a3d; --tangerine-ink: #3b1800;
  --grape: #8b5cf6;     --grape-ink: #ffffff;
  --teal: #14b8a6;      --teal-ink: #ffffff;
  --lime: #b6e34b;      --lime-ink: #1f2b00;
  --night: #241b4d;     --night-ink: #ffd23f;

  --display: "Fredoka", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #120f26; --dots: #221c45; --surface: #1d1838; --ink: #f2efff; --muted: #aca6d0;
    --line: #2f2856; --brand: #8f7bff; --brand-ink: #120f26;
    --shadow: 0 3px 0 #00000040, 0 12px 28px -16px #000000aa;
    --night: #2d2360;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--body); font-size: 16px; line-height: 1.5; color: var(--ink);
  background-color: var(--page);
  background-image: radial-gradient(var(--dots) 1.5px, transparent 1.6px);
  background-size: 22px 22px;
}
main { flex: 1; outline: none; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.08; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 8px; }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1160px; margin: 0 auto; padding: 12px max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 1.3rem; text-decoration: none; }
.logo b { color: var(--brand); font-weight: 700; }
.logo-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--brand); color: var(--sun); display: grid; place-items: center; font-weight: 700; font-size: 1.25rem; transform: rotate(-6deg); box-shadow: 0 3px 0 #1c164030; }
.logo.small { font-size: 1.05rem; } .logo.small .logo-mark { width: 28px; height: 28px; font-size: 1rem; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a { text-decoration: none; font-weight: 700; font-size: .95rem; padding: 8px 12px; border-radius: 999px; color: var(--muted); }
.topnav a:hover, .topnav a[aria-current="page"] { background: var(--surface); color: var(--ink); }
@media (max-width: 560px) { .topnav a:not(:last-child) { display: none; } }

/* Hero */
.hero { position: relative; padding-block: 56px 36px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .stickers { display: none; } }
.kicker { display: inline-block; font-weight: 800; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; background: var(--surface); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.8rem); font-weight: 700; letter-spacing: -.01em; }
.hero h1 .hl { color: var(--brand); position: relative; white-space: nowrap; }
.hero h1 .hl::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: .06em; height: .22em; background: var(--sun); border-radius: 99px; z-index: -1; }
.hero .lede { margin-top: 16px; font-size: 1.15rem; color: var(--muted); max-width: 46ch; font-weight: 600; }

.search { margin-top: 26px; position: relative; max-width: 560px; }
.search input {
  width: 100%; font: inherit; font-size: 1.05rem; font-weight: 700; color: var(--ink);
  padding: 16px 18px 16px 52px; border-radius: 18px; border: 2.5px solid var(--ink); background: var(--surface);
  box-shadow: 0 5px 0 var(--ink);
}
.search input::placeholder { color: var(--muted); font-weight: 600; }
.search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 2.5; }
.stats { display: flex; gap: 22px; margin-top: 22px; flex-wrap: wrap; font-weight: 700; color: var(--muted); }
.stats b { font-family: var(--display); font-size: 1.6rem; color: var(--ink); display: block; line-height: 1; font-variant-numeric: tabular-nums; }

.stickers { position: relative; height: 340px; }
.sticker { position: absolute; font-family: var(--display); font-weight: 700; border-radius: 26px; display: grid; place-items: center; text-align: center; box-shadow: var(--shadow); border: 3px solid var(--ink); line-height: 1.05; animation: float 6s ease-in-out infinite; }
.sticker small { display: block; font-family: var(--body); font-weight: 800; font-size: .7rem; letter-spacing: .12em; }
.s1 { width: 150px; height: 150px; background: var(--sun); color: var(--sun-ink); font-size: 2.2rem; left: 4%; top: 18px; transform: rotate(-8deg); }
.s2 { width: 170px; height: 120px; background: var(--berry); color: var(--berry-ink); font-size: 1.7rem; right: 4%; top: 0; transform: rotate(7deg); animation-delay: -2s; }
.s3 { width: 190px; height: 110px; background: var(--sky); color: var(--sky-ink); font-size: 1.5rem; left: 22%; bottom: 10px; transform: rotate(4deg); animation-delay: -4s; }
.s4 { width: 110px; height: 110px; background: var(--mint); color: var(--mint-ink); font-size: 2.4rem; right: 8%; bottom: 40px; border-radius: 50%; transform: rotate(-10deg); animation-delay: -1s; }
@keyframes float { 50% { translate: 0 -10px; } }

/* Sections */
.section { padding-block: 34px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.section-head p { color: var(--muted); font-weight: 600; }

/* Course tiles */
.courses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 960px) { .courses { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .courses { grid-template-columns: 1fr; } }
.tile {
  --c: var(--sun); --ci: var(--sun-ink);
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 190px; padding: 18px;
  background: var(--c); color: var(--ci); border-radius: 24px; text-decoration: none; border: 3px solid var(--ink);
  box-shadow: 0 6px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease; overflow: hidden;
}
.tile:hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 10px 0 var(--ink); }
.tile:active { transform: translateY(2px); box-shadow: 0 3px 0 var(--ink); }
.tile .num { font-family: var(--display); font-weight: 700; font-size: 3.6rem; line-height: .9; }
.tile .num small { font-size: 1.05rem; letter-spacing: .08em; margin-left: 4px; }
.tile h3 { font-size: 1.25rem; }
.tile p { font-size: .92rem; font-weight: 700; opacity: .85; }
.tile .count { position: absolute; top: 16px; right: 16px; background: var(--surface); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: .85rem; font-variant-numeric: tabular-nums; }
.tile .blob { position: absolute; right: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: #ffffff33; }

/* Colour helpers */
.c-sun { --c: var(--sun); --ci: var(--sun-ink); } .c-mint { --c: var(--mint); --ci: var(--mint-ink); }
.c-sky { --c: var(--sky); --ci: var(--sky-ink); } .c-berry { --c: var(--berry); --ci: var(--berry-ink); }
.c-tangerine { --c: var(--tangerine); --ci: var(--tangerine-ink); } .c-grape { --c: var(--grape); --ci: var(--grape-ink); }
.c-teal { --c: var(--teal); --ci: var(--teal-ink); } .c-lime { --c: var(--lime); --ci: var(--lime-ink); }
.c-night { --c: var(--night); --ci: var(--night-ink); }

/* Collections */
.collections { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px; border-radius: 24px; background: var(--c); color: var(--ci); text-decoration: none; border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); transition: transform .15s; }
.banner:hover { transform: translateY(-3px); }
.banner h3 { font-size: 1.5rem; }
.banner p { font-weight: 700; opacity: .85; margin-top: 4px; }
.banner .go { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--ci); color: var(--c); display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; }

/* Course page header */
.course-hero { background: var(--c); color: var(--ci); border-bottom: 3px solid var(--ink); }
.course-hero .wrap { padding-block: 34px 30px; display: flex; flex-direction: column; gap: 12px; }
.back { align-self: flex-start; text-decoration: none; font-weight: 800; background: var(--surface); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 14px; box-shadow: 0 3px 0 var(--ink); }
.course-hero h1 { font-size: clamp(2.4rem, 7vw, 4rem); }
.course-hero p { font-weight: 700; font-size: 1.1rem; opacity: .9; max-width: 60ch; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip { font: inherit; font-weight: 800; font-size: .9rem; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; transition: transform .1s; }
.chip:hover { transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--page); }
.chip .n { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* Unit groups and cards */
.unit { margin-bottom: 30px; }
.unit h2 { font-size: 1.3rem; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.unit h2::before { content: ""; width: 14px; height: 14px; border-radius: 4px; background: var(--brand); transform: rotate(45deg); flex: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px; min-width: 0;
  background: var(--surface); border: 2px solid var(--line); border-radius: 20px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--ink); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.type { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--c); color: var(--ci); }
.type svg { width: 14px; height: 14px; fill: currentColor; }
.t-game { --c: var(--berry); --ci: var(--berry-ink); } .t-grammar { --c: var(--sky); --ci: var(--sky-ink); }
.t-vocab { --c: var(--sun); --ci: var(--sun-ink); } .t-skills { --c: var(--mint); --ci: var(--mint-ink); }
.t-speaking { --c: var(--tangerine); --ci: var(--tangerine-ink); } .t-project { --c: var(--grape); --ci: var(--grape-ink); }
.t-slides { --c: var(--teal); --ci: var(--teal-ink); } .t-teacher { --c: var(--night); --ci: var(--night-ink); }
.ext { font-size: .72rem; font-weight: 800; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.card h3 { font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }
.card p { font-size: .92rem; color: var(--muted); font-weight: 600; }
.card-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .82rem; font-weight: 800; color: var(--muted); }
.card-foot .open { color: var(--brand); display: inline-flex; align-items: center; gap: 4px; }
.card:hover .open span { translate: 3px 0; }
.card-foot .open span { transition: translate .15s; }

.empty { padding: 40px 20px; text-align: center; font-weight: 700; color: var(--muted); background: var(--surface); border: 2px dashed var(--line); border-radius: 20px; }
.note { margin-top: 10px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); font-weight: 600; color: var(--muted); }

/* Footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 30px; }
.foot-in { max-width: 1160px; margin: 0 auto; padding: 22px max(18px, env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; color: var(--muted); font-weight: 600; font-size: .9rem; }

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

/* Nombre largo en la cabecera */
.logo span:last-child, .topnav a { white-space: nowrap; }
@media (max-width: 560px) {
  .logo { font-size: 1.05rem; gap: 8px; }
  .logo-mark { width: 30px; height: 30px; font-size: 1.05rem; }
  .topnav a { padding: 6px 8px; font-size: .85rem; }
}
@media (max-width: 360px) { .topnav { display: none; } }
