/* HeyHi Teacher Tools — shared styles, following heyhi.sg: Quicksand, teal #0D719A, soft pastel sections, playful doodles. */
:root {
  --primary: #0d719a;
  --primary-dark: #145876;
  --orange: #f15d22;
  --yellow: #fcb017;
  --aqua: #ecfdff;
  --butter: #fef0c7;
  --peach: #fde8d7;
  --mint: #e6f3ec;
  --brand: var(--primary);
  --navy: #3d3d3d;            /* headings — heyhi.sg uses dark grey, not navy */
  --c: var(--primary);        /* current tool colour, set per page */
  --soft: #e6f8fb;
  --bg: #fbfbfb;
  --card: #ffffff;
  --text: #454545;
  --muted: #6d6d6d;
  --line: #eaeaea;
  --ok: #2f8f5b;
  --warn: #b7791f;
  --bad: #c84b4b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 6px 20px rgba(13, 113, 154, .06);
  --dots: rgba(13, 113, 154, .07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11181d; --card: #1a242b; --text: #e3e8ea; --muted: #9fb0b8; --line: #2a3840; --navy: #f0f4f5;
    --soft: #1f3038; --shadow: none; --dots: rgba(255, 255, 255, .04); --primary: #3aa3cc; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11181d; --card: #1a242b; --text: #e3e8ea; --muted: #9fb0b8; --line: #2a3840; --navy: #f0f4f5;
  --soft: #1f3038; --shadow: none; --dots: rgba(255, 255, 255, .04); --primary: #3aa3cc; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Quicksand", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dots) 1.3px, transparent 1.3px);
  background-size: 24px 24px;
  color: var(--text); line-height: 1.55; font-size: 16px; font-weight: 500;
}
a { color: var(--primary); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 3.6vw, 2.1rem); }
h2 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
b, strong { font-weight: 700; }

/* Top bar — white, like heyhi.sg */
.hh-top { background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.hh-top .in { max-width: 1140px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.hh-top img { height: 34px; display: block; }
.hh-top .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 700; font-size: 1.05rem; }
.hh-top .brand em { font-style: normal; color: var(--primary); }
.hh-top nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.hh-top nav a, .hh-top nav button {
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--text); text-decoration: none; background: none;
  border: 0; border-radius: 12px; padding: 6px 10px; cursor: pointer; display: inline-flex; align-items: center;
}
.hh-top nav a:hover, .hh-top nav button:hover { color: var(--primary); background: var(--soft); }
.hh-top nav a.cta { background: var(--primary); color: #fff; border-radius: 16px; padding: 7px 16px; font-weight: 700; }
.hh-top nav a.cta:hover { background: var(--primary-dark); color: #fff; }

main { max-width: 1140px; margin: 0 auto; padding: 24px 16px 48px; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }

/* Tool page hero — soft pastel band with doodles */
.tool-hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 20px 26px 24px; margin-bottom: 20px;
  background: var(--soft); border: 1px solid color-mix(in srgb, var(--c) 12%, transparent);
}
.tool-hero .crumb { font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 12px; position: relative; z-index: 1; }
.tool-hero .crumb a { color: var(--c); text-decoration: none; }
.tool-hero .crumb a:hover { text-decoration: underline; }
.tool-hero .crumb span { opacity: .5; margin: 0 4px; }
.tool-hero-row { display: flex; gap: 18px; align-items: center; position: relative; z-index: 1; max-width: 760px; }
.hero-ic { flex: none; width: 64px; height: 64px; border-radius: 20px; background: var(--card); color: var(--c); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .06); transform: rotate(-4deg); }
.hero-ic svg { width: 32px; height: 32px; }
.tool-hero h1 { margin: 0 0 4px; }
.tool-hero .lead { margin: 0; color: var(--text); opacity: .85; }
.hero-doodles { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 260px; height: 156px; }
@media (max-width: 900px) { .hero-doodles { opacity: .35; right: -60px; } }
@media (max-width: 640px) { .hero-ic { width: 52px; height: 52px; } .hero-ic svg { width: 26px; height: 26px; } .tool-hero-row { align-items: flex-start; } }

/* Cards and forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
@media (max-width: 800px) { .grid.two { grid-template-columns: 1fr; } }

label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 5px; color: var(--navy); }
.hint { color: var(--muted); font-size: .85rem; font-weight: 500; }
input[type=text], input[type=number], input[type=url], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 160px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(13, 113, 154, .12); }
input[type=range], input[type=checkbox] { accent-color: var(--primary); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 140px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.check input { width: 18px; height: 18px; }

/* Buttons — heyhi.sg style: teal, 16px radius, flat */
.btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 16px; padding: 10px 20px; cursor: pointer;
  background: var(--primary); color: #fff; display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  transition: background .15s, transform .08s;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--card); color: var(--primary); border: 1.5px solid color-mix(in srgb, var(--primary) 45%, transparent); padding: 8.5px 18px; }
.btn.ghost:hover { background: var(--aqua); border-color: var(--primary); }
.btn.big { font-size: 1.1rem; padding: 12px 26px; }
.btn.ghost.big { padding: 10.5px 24px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--line); }
.pill.ok { background: #e3f4ea; color: var(--ok); }
.pill.warn { background: var(--butter); color: var(--warn); }
.pill.bad { background: #fbe4e4; color: var(--bad); }

/* Hub hero — light, centred, doodles at the sides (like the heyhi.sg landing page) */
.hub-hero { position: relative; overflow: hidden; text-align: center; padding: 56px 24px 64px; border-radius: 28px; background: linear-gradient(180deg, var(--card), var(--aqua)); border: 1px solid var(--line); }
.hub-hero > .copy { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hub-hero .kicker { display: inline-flex; align-items: center; gap: 8px; background: var(--butter); color: #8a5a00; padding: 5px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; margin-bottom: 18px; }
.hub-hero h1 { font-size: clamp(1.9rem, 4.6vw, 2.8rem); margin-bottom: 14px; }
.hub-hero h1 .hl { color: var(--primary); position: relative; white-space: nowrap; }
.hub-hero h1 .hl svg { position: absolute; left: 0; bottom: -8px; width: 100%; height: 12px; }
.hub-hero .lead { margin: 0 auto; font-size: 1.1rem; }
.hub-hero .chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }
.hub-hero .chips a { text-decoration: none; font-weight: 700; font-size: .92rem; padding: 9px 18px; border-radius: 16px; background: var(--card); color: var(--primary); border: 1.5px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.hub-hero .chips a:first-child { background: var(--primary); color: #fff; border-color: var(--primary); }
.hub-hero .chips a:hover { border-color: var(--primary); background: var(--aqua); }
.hub-hero .chips a:first-child:hover { background: var(--primary-dark); }
.side-art { position: absolute; bottom: 0; width: 230px; height: 230px; pointer-events: none; }
.side-art.l { left: 6px; } .side-art.r { right: 6px; }
@media (max-width: 900px) { .side-art { width: 150px; height: 150px; opacity: .45; } }
@media (max-width: 560px) { .side-art { display: none; } .hub-hero { padding: 40px 18px 44px; } }
.float { animation: float 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.float.d2 { animation-delay: -2s; } .float.d3 { animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-6px) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .float { animation: none; } }

.trust { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: center; margin: 22px 0 6px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.trust span { display: inline-flex; align-items: center; gap: 8px; }
.trust i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .75rem; font-weight: 700; }

/* Section titles on hub */
.section-head { display: flex; align-items: center; gap: 12px; margin: 36px 0 14px; }
.section-head .dot { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; }
.section-head .dot svg { width: 20px; height: 20px; }
.section-head h2 { margin: 0; font-size: 1.3rem; }

/* Tool cards — white card, pastel header with doodles */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.tool {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tool:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 40%, transparent); box-shadow: 0 12px 26px rgba(0, 0, 0, .07); }
.tool-art { position: relative; height: 92px; background: var(--soft); overflow: hidden; }
.tool-doodles { position: absolute; right: -6px; top: -4px; width: 170px; height: 102px; transition: transform .3s; }
.tool:hover .tool-doodles { transform: translateY(-3px) rotate(-2deg); }
.tool .ic { position: absolute; left: 18px; top: 66px; width: 52px; height: 52px; border-radius: 16px; background: var(--card); color: var(--c); display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .08); border: 1px solid var(--line); }
.tool .ic svg { width: 26px; height: 26px; }
.tool-body { padding: 34px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.tool .tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c); }
.tool h3 { margin: 2px 0 6px; font-size: 1.1rem; }
.tool p { margin: 0 0 12px; color: var(--muted); font-size: .93rem; flex: 1; }
.tool .go { font-weight: 700; font-size: .9rem; color: var(--primary); }
.tool .go b { display: inline-block; transition: transform .15s; }
.tool:hover .go b { transform: translateX(4px); }

.more { margin-top: 40px; }
.more .tools { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* Footer */
footer.hh-foot { margin-top: 24px; background: var(--card); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.foot-in { max-width: 1140px; margin: 0 auto; padding: 22px 16px; display: flex; gap: 14px; align-items: center; }
.foot-logo { width: 40px; height: auto; flex: none; }

/* Fullscreen helpers */
.fs-target:fullscreen { background: var(--bg); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 24px; }

/* Print */
.print-only { display: none; }
@media print {
  .hh-top, .no-print, footer.hh-foot { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .sheet { page-break-after: always; }
  .sheet:last-child { page-break-after: auto; }
}
@media (max-width: 480px) { .hh-top .brand { font-size: .95rem; white-space: nowrap; } .hh-top nav a.cta { display: none; } }
