/* Math With Mr DJ · home page
   Same brand colors and fonts as puzzles.mathwithmrdj.com. */

@font-face { font-family: Anton; font-weight: 400; font-display: swap; src: url(../fonts/anton.woff2) format("woff2"); }
@font-face { font-family: Fredoka; font-weight: 300 700; font-display: swap; src: url(../fonts/fredoka.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(../fonts/plex-mono-500.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600 700; font-display: swap; src: url(../fonts/plex-mono-600.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 100 700; font-display: swap; src: url(../fonts/plex-sans.woff2) format("woff2"); }

:root {
  --violet: #7E03F2;
  --blue: #0049D2;
  --gold: #FCD604;
  --ground: #F7F5FC;
  --surface: #FFFFFF;
  --surface-2: #F0EDF8;
  --ink: #17121F;
  --ink-2: #463C5C;
  --ink-3: #6F6589;
  --line: #E2DCF0;
  --line-2: #CFC7E4;
  --good: #0F7F62;
  --bad: #BE2F2F;
  --hero: linear-gradient(115deg, #7E03F2, #001282 55%, #0049D2);
  --shadow: 0 1px 2px rgba(23, 18, 31, .06), 0 12px 30px -16px rgba(46, 18, 96, .35);
  --radius: 20px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --violet: #A369FF; --blue: #5B9DFF; --gold: #FFD814;
    --ground: #100D18; --surface: #1A1626; --surface-2: #241E33;
    --ink: #EDE9F6; --ink-2: #C0B8D6; --ink-3: #8F86A8;
    --line: #2B2439; --line-2: #3C3352;
    --good: #3ED2B4; --bad: #FF7B6B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -16px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --violet: #A369FF; --blue: #5B9DFF; --gold: #FFD814;
  --ground: #100D18; --surface: #1A1626; --surface-2: #241E33;
  --ink: #EDE9F6; --ink-2: #C0B8D6; --ink-3: #8F86A8;
  --line: #2B2439; --line-2: #3C3352;
  --good: #3ED2B4; --bad: #FF7B6B;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -16px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---- base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 17px/1.6 "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
a { color: var(--violet); }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fine { font-size: 14px; color: var(--ink-3); }
.eyebrow {
  font: 600 12px/1 "IBM Plex Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--violet);
  margin-bottom: 12px;
}
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--ground); }
.skip:focus { top: 12px; }

/* ---- buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 24px; border-radius: 16px; border: 0;
  font: 700 17px/1 "IBM Plex Sans", sans-serif; text-decoration: none; white-space: nowrap;
  transition: transform .12s, filter .15s, box-shadow .15s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--violet); color: #fff; }
.btn.gold { background: var(--gold); color: #17121F; box-shadow: 0 4px 0 #b39500; }
.btn.youtube { background: #fff; color: #17121F; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.yt-icon { width: 28px; height: 20px; flex: none; }

/* ---- header ------------------------------------------------------------- */

.masthead {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; min-width: 0; }
.brand-face { flex: none; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: var(--hero); border: 2px solid var(--gold); }
.brand-face img { width: 200%; max-width: none; margin: -2px 0 0 -50%; }
.brand-name {
  font: 400 21px/1 Anton, Impact, sans-serif; letter-spacing: .015em; text-transform: uppercase; white-space: nowrap;
  background: linear-gradient(96deg, var(--violet), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover { background: var(--surface-2); }
.nav .nav-pill { background: var(--violet); color: #fff; }
.nav .nav-pill:hover { background: var(--violet); filter: brightness(1.08); }
@media (max-width: 560px) { .nav-wide { display: none; } }

/* ---- hero ----------------------------------------------------------------- */

.hero { position: relative; overflow: hidden; isolation: isolate; background: var(--hero); color: #fff; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .13;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='white' stroke-width='5' stroke-linecap='round'%3E%3Cpath d='M18 10v20M8 20h20M78 22h22M50 70l14 14M64 70L50 84M90 92h16'/%3E%3C/g%3E%3Cg fill='white'%3E%3Ccircle cx='98' cy='86' r='3'/%3E%3Ccircle cx='98' cy='98' r='3'/%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner { display: grid; grid-template-columns: 1fr; align-items: end; gap: 8px; padding-top: 40px; }
.hero-text { padding-bottom: 8px; }
.hero-eyebrow { font: 600 12.5px/1 "IBM Plex Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .85); margin-bottom: 14px; }
.hero-title {
  font: 400 clamp(52px, 13vw, 104px)/.92 Anton, Impact, sans-serif; text-transform: uppercase; letter-spacing: .01em;
  -webkit-text-stroke: 3px #000; paint-order: stroke fill;
}
.hero-title em { font-style: normal; color: var(--gold); }
.hero-kicker {
  display: block; margin-bottom: 10px;
  font: 700 clamp(20px, 4.5vw, 28px)/1.1 Fredoka, sans-serif; text-transform: none; letter-spacing: .01em;
  -webkit-text-stroke: 0; color: #fff;
}
.hero-sub { margin-top: 18px; max-width: 34em; font-size: 18.5px; color: rgba(255, 255, 255, .92); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-pose { justify-self: center; width: min(66vw, 290px); filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .35)); }
@media (min-width: 820px) {
  .hero-inner { grid-template-columns: 1.25fr 1fr; padding-top: 56px; }
  .hero-text { padding-bottom: 64px; }
  .hero-pose { width: 100%; max-width: 440px; justify-self: end; }
}
@media (max-width: 480px) {
  .hero-ctas .btn { flex: 1 1 100%; }
}

/* ---- sections -------------------------------------------------------- */

.section { padding: 64px 0; }
.section-tint { background: var(--surface-2); }
.section h2 { font: 400 clamp(34px, 6vw, 46px)/1.02 Anton, Impact, sans-serif; text-transform: uppercase; letter-spacing: .015em; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.more { font-weight: 700; text-decoration: none; white-space: nowrap; }

.videos { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.video {
  display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; transition: transform .15s;
}
.video:hover { transform: translateY(-3px); }
/* On phones the videos become a swipeable row instead of a long list. */
@media (max-width: 600px) {
  .videos {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 80%;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin: 0 -20px; padding: 4px 20px 18px; scroll-padding: 0 20px;
  }
  .video { scroll-snap-align: start; }
}
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--hero); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.play {
  position: absolute; right: 10px; bottom: 10px; width: 40px; height: 28px; border-radius: 8px; background: #FF0033;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}
.play::after { content: ""; position: absolute; left: 16px; top: 8px; border: 6px solid transparent; border-left: 10px solid #fff; border-right: 0; }
.video-title { padding: 0 4px; font-weight: 700; font-size: 16.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video time { padding: 0 4px; margin-top: auto; font: 500 13px/1 "IBM Plex Mono", monospace; color: var(--ink-3); }

.topics { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
.topics-label { font-weight: 600; color: var(--ink-2); margin-right: 4px; }
.topics a {
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
}
.topics a:hover { border-color: var(--violet); color: var(--violet); }

.puzzles-inner { display: grid; gap: 28px; align-items: center; }
.puzzles-text > p { margin-top: 14px; max-width: 34em; color: var(--ink-2); }
.puzzle-list { list-style: none; padding: 0; margin: 22px 0 26px; display: grid; gap: 12px; }
.puzzle-list li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.puzzle-list svg { width: 48px; height: 48px; flex: none; }
.puzzle-list b { display: block; font-size: 17px; }
.puzzle-list span { color: var(--ink-2); font-size: 15.5px; line-height: 1.4; }
.puzzles-pose { justify-self: center; width: min(70vw, 320px); }
@media (min-width: 820px) {
  .puzzles-inner { grid-template-columns: 1.4fr 1fr; }
  .puzzles-pose { width: 100%; max-width: 360px; }
}

.updates-card {
  position: relative; overflow: hidden; display: grid; gap: 8px; align-items: center;
  padding: 28px 24px; border-radius: 28px; background: var(--hero); color: #fff;
}
.updates-pose { justify-self: center; width: min(60vw, 240px); filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .3)); }
.updates-body h2 { color: #fff; -webkit-text-stroke: 2px #000; paint-order: stroke fill; }
.updates-body > p { margin-top: 10px; color: rgba(255, 255, 255, .92); max-width: 32em; }
.signup { margin-top: 20px; }
.signup-row { display: flex; flex-wrap: wrap; gap: 10px; }
.signup input[type="email"] {
  flex: 1 1 240px; min-width: 0; height: 54px; padding: 0 18px; border-radius: 16px; border: 2px solid transparent;
  background: #fff; color: #17121F; font: 500 17px/1 "IBM Plex Sans", sans-serif;
}
.signup input[type="email"]:focus { outline: none; border-color: var(--gold); }
.signup .btn { flex: 0 0 auto; }
.signup .fine { margin-top: 12px; color: rgba(255, 255, 255, .8); }
.signup .fine a { color: #fff; }
.signup-msg { min-height: 0; margin-top: 10px; font-weight: 700; }
.signup-msg:empty { display: none; }
.signup-msg.good { color: #fff; font-size: 19px; }
.signup-msg.bad { color: #FFD3CC; }
.signup.done .signup-row { display: none; }
@media (min-width: 820px) {
  .updates-card { grid-template-columns: 260px 1fr; gap: 32px; padding: 40px 48px 40px 32px; }
  .updates-pose { width: 100%; }
}
@media (max-width: 480px) { .signup .btn { flex: 1 1 100%; } }

/* ---- footer ----------------------------------------------------------------- */

.footer { padding: 40px 0 48px; border-top: 1px solid var(--line); }
.footer-inner { display: grid; gap: 18px; }
.footer-brand { font: 400 22px/1 Anton, Impact, sans-serif; text-transform: uppercase; letter-spacing: .015em; margin-bottom: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.footer-links a:hover { color: var(--violet); }
@media (min-width: 820px) {
  .footer-inner { grid-template-columns: 1fr auto; align-items: center; }
  .footer-copy { grid-column: 1 / -1; }
}

/* ---- simple pages (privacy, unsubscribe, messages) ------------------------------ */

.page { max-width: 720px; margin: 0 auto; padding: 48px 20px 64px; }
.page h1 { font: 400 clamp(38px, 8vw, 52px)/1 Anton, Impact, sans-serif; text-transform: uppercase; letter-spacing: .015em; }
.page h2 { font: 400 24px/1.15 Anton, Impact, sans-serif; text-transform: uppercase; letter-spacing: .015em; margin: 28px 0 8px; }
.page p, .page li { color: var(--ink-2); }
.page p + p { margin-top: 12px; }
.page ul { padding-left: 20px; display: grid; gap: 8px; }
.page .lead { margin-top: 12px; font-size: 19px; }
.page .btn { margin-top: 24px; }
.page-pose { width: 160px; margin-bottom: 12px; }
.page .signup input[type="email"] { border-color: var(--line-2); }
.page .signup .fine { color: var(--ink-3); }
.page .signup-msg.good { color: var(--good); }
.page .signup-msg.bad { color: var(--bad); }

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