/* coan.ca — bubbly, sticker-style, recoloured by the season (app.js sets the theme colours) */
:root {
  --sky1: #ffb36b; --sky2: #ffe2b8;
  --main: #e8590c; --second: #ffd43b; --pop: #12b886;
  --ground1: #c2410c; --ground2: #9a3412;
  --ink: #241a33; --paper: #fffaf0; --paper-2: #fff1d6; --on-pop: #241a33;
  --title-font: 'Titan One', 'Baloo 2', system-ui, sans-serif;
  --body-font: 'Baloo 2', system-ui, sans-serif;
  --wobble: 58% 42% 55% 45% / 52% 60% 40% 48%;
  color-scheme: light;
}
:root[data-mode="night"] {
  --ink: #fdf6e3; --paper: #1f1b33; --paper-2: #2a2545;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--body-font); font-size: 18px; line-height: 1.45;
  color: var(--ink); background: var(--sky2);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- the scene ---------- */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.sky { position: absolute; inset: 0; background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 70%); transition: background 0.8s; }
.night-veil {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 32% 8%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 58% 22%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 76% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 34%, #fff 50%, transparent 51%),
    linear-gradient(180deg, #0b0a24ee, #1c1740cc);
}
:root[data-mode="night"] .night-veil { opacity: 1; }
#particles { position: absolute; inset: 0; width: 100%; height: 100%; }
.hills { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 24vh; min-height: 120px; }
.hill-back { fill: var(--ground1); transition: fill 0.8s; }
.hill-front { fill: var(--ground2); transition: fill 0.8s; }
:root[data-mode="night"] .hills { filter: brightness(0.55) saturate(0.8); }

.sky-thing { position: absolute; top: 9vh; right: 8vw; width: clamp(80px, 12vw, 150px); aspect-ratio: 1; border-radius: 50%; transition: all 0.8s; }
.sky-thing.sun { background: radial-gradient(circle, #fff7c2 0 35%, #ffd43b 36% 60%, #ffa94d 61%); box-shadow: 0 0 60px 20px #ffd43b88; }
.sky-thing.sun::before {
  content: ''; position: absolute; inset: -38%; border-radius: 50%;
  background: repeating-conic-gradient(#ffe06688 0 8deg, transparent 8deg 24deg);
  -webkit-mask: radial-gradient(circle, transparent 38%, #000 39% 70%, transparent 71%);
          mask: radial-gradient(circle, transparent 38%, #000 39% 70%, transparent 71%);
  animation: spin 40s linear infinite;
}
.sky-thing.moon { background: radial-gradient(circle at 35% 35%, #fffbe6, #f1e3a6 60%, #d9c47c); box-shadow: 0 0 70px 18px #fff3b066; }
.sky-thing.moon::after { content: ''; position: absolute; width: 22%; height: 22%; left: 52%; top: 50%; border-radius: 50%; background: #d4bf7a88; box-shadow: -40px -26px 0 -4px #d4bf7a66, -14px 18px 0 -6px #d4bf7a66; }
.sky-thing.pale { background: radial-gradient(circle, #ffffff 0 42%, #fffbe8 52%, #fff6d000 71%); box-shadow: none; }
:root[data-mode="night"] .sky-thing:not(.moon) { background: radial-gradient(circle at 35% 35%, #fffbe6, #e9e1c4 60%, #cfc39b); box-shadow: 0 0 60px 14px #fff3b044; }
:root[data-mode="night"] .sky-thing::before { display: none; }

/* Christmas lights along the top */
.lights { display: none; position: absolute; top: -6px; left: 0; right: 0; margin: 0; padding: 0; list-style: none; justify-content: space-around; }
.lights li { width: 12px; height: 20px; border-radius: 50% 50% 45% 45%; margin-top: 14px; background: var(--c); box-shadow: 0 6px 18px 2px var(--c); animation: blink 1.6s infinite alternate; animation-delay: var(--d); position: relative; }
.lights li::before { content: ''; position: absolute; top: -6px; left: 3px; width: 6px; height: 6px; background: #3a3a3a; border-radius: 2px; }
:root[data-theme="christmas"] .lights { display: flex; }

/* Hanukkah menorah on the hill */
.menorah { display: none; position: absolute; right: 10vw; bottom: calc(24vh - 30px); width: clamp(120px, 16vw, 200px); }
:root[data-theme="hanukkah"] .menorah { display: block; }
.menorah .stand { fill: #e8b923; stroke: #7a5c00; stroke-width: 2; }
.menorah .candle { fill: #dbe7ff; stroke: #3a5ba0; stroke-width: 1.5; }
.menorah .flame { fill: #ffb703; filter: drop-shadow(0 0 6px #ffd60a); transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 0.4s infinite alternate; }

/* ---------- header + menu ---------- */
.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; padding: 14px clamp(16px, 4vw, 40px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .logo { width: 64px; height: 54px; display: block; }
.brand-name { font-family: var(--title-font); font-size: 28px; color: var(--pop); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
.menu { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.squiggle { width: 34px; height: 14px; flex: none; }
.squiggle path { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }

.blob {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--title-font); font-size: 17px; letter-spacing: 0.3px; text-decoration: none;
  color: var(--ink); background: var(--paper); border: 3px solid var(--ink); border-radius: var(--wobble);
  padding: 8px 16px 7px; box-shadow: 3px 4px 0 var(--ink); cursor: pointer;
  transition: transform 0.15s cubic-bezier(.3,1.6,.5,1), background 0.2s, box-shadow 0.15s;
}
.blob:hover { transform: translateY(-3px) rotate(-2deg) scale(1.05); background: var(--second); }
.blob:active { transform: translateY(2px) scale(0.97); box-shadow: 1px 1px 0 var(--ink); }
.blob.active { background: var(--pop); color: var(--on-pop); }
:root[data-mode="night"] .blob:hover, :root[data-mode="night"] .blob.active { color: #241a33; }
.blob:focus-visible, .chip:focus-visible, a:focus-visible { outline: 3px dashed var(--pop); outline-offset: 3px; }
.ico { font-size: 0.95em; }

/* ---------- logos ---------- */
.logo-svg { width: 100%; height: 100%; overflow: visible; }
.l-badge { fill: var(--second); stroke: #241a33; stroke-width: 5; }
.l-swish path, .l-arm, .l-tail, .l-smile { fill: none; stroke: #241a33; stroke-linecap: round; }
.l-swish path { stroke-width: 4; }
.l-arm { stroke-width: 13; stroke: #241a33; }
.l-tail { stroke-width: 6; fill: var(--main); stroke-linejoin: round; }
.l-hand, .l-head { fill: #ffe0bd; stroke: #241a33; stroke-width: 4; }
.l-body { fill: var(--pop); stroke: #241a33; stroke-width: 4.5; stroke-linejoin: round; }
.l-eye { fill: #241a33; }
.l-smile { stroke: #241a33; stroke-width: 3; }
.l-ca { font-family: var(--title-font); font-size: 28px; fill: #241a33; }
.brand:hover .logo { animation: wave 0.6s ease-in-out 2; }

/* ---------- layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 26vh; }
.page { animation: pop-in 0.45s cubic-bezier(.3,1.4,.5,1); }
.hero { text-align: center; padding: 10px 0 18px; }
.hero-logo { width: clamp(150px, 22vw, 230px); height: clamp(125px, 18vw, 190px); margin: 0 auto -6px; animation: float 4s ease-in-out infinite; }
.big-title, .page-title {
  font-family: var(--title-font); font-weight: 400; margin: 0; line-height: 1;
  color: var(--pop); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 5px 6px 0 var(--main);
}
.big-title { font-size: clamp(64px, 13vw, 150px); letter-spacing: 2px; }
.page-title { font-size: clamp(44px, 8vw, 84px); text-align: center; margin: 12px 0 28px; }
.big-title .ch, .page-title .ch { display: inline-block; animation: drop 0.7s cubic-bezier(.3,1.6,.5,1) both; animation-delay: calc(var(--i) * 55ms); }
.tagline { color: var(--on-sky); font-size: clamp(19px, 2.4vw, 25px); font-weight: 800; margin: 16px auto 6px; max-width: 30ch; }
.season-note { display: inline-block; margin: 6px 0 0; padding: 4px 16px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; font-weight: 700; box-shadow: 2px 3px 0 var(--ink); }

.two-pictures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 4vw, 44px); margin-top: 30px; }
.picture-card { display: block; text-decoration: none; background: var(--paper); border: 4px solid var(--ink); border-radius: 26px 32px 24px 30px; padding: 12px; box-shadow: 8px 9px 0 var(--ink); transition: transform 0.2s cubic-bezier(.3,1.6,.5,1); }
.picture-card:hover { transform: rotate(0deg) translateY(-6px) scale(1.03) !important; }
.tilt-l { transform: rotate(-2.5deg); } .tilt-r { transform: rotate(2deg); }
.picture { display: block; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; border: 3px solid var(--ink); background: var(--paper-2); }
.picture img { width: 100%; height: 100%; object-fit: cover; }
.picture.film { display: grid; place-items: center; background: var(--main); }
.picture.film svg { width: 78%; }
.film-body { fill: #241a33; } .film-holes rect { fill: var(--second); }
.film-play { fill: var(--pop); stroke: #fff; stroke-width: 3; } .film-tri { fill: #fff; }
.picture-label { display: block; text-align: center; font-family: var(--title-font); font-size: clamp(20px, 2.6vw, 28px); padding: 12px 4px 2px; }

/* ---------- cards (games + videos) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 34px 30px; }
.card { background: var(--paper); border: 4px solid var(--ink); border-radius: 24px 30px 26px 28px; padding: 16px; box-shadow: 7px 8px 0 var(--ink); }
.item-card { display: flex; flex-direction: column; gap: 12px; }
.item-card:nth-child(odd) { transform: rotate(-1deg); } .item-card:nth-child(even) { transform: rotate(1deg); }
.item-name { font-family: var(--title-font); font-weight: 400; font-size: 28px; margin: 0; line-height: 1.1; text-align: center; }
.item-words { margin: -6px 0 0; text-align: center; font-weight: 700; opacity: 0.85; }
.soon { display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 16px; border: 3px dashed var(--ink); background: repeating-linear-gradient(45deg, var(--paper-2) 0 14px, transparent 14px 28px); font-family: var(--title-font); font-size: 26px; text-align: center; padding: 10px; }
.soon span { display: block; font-size: 46px; animation: bob 1.6s ease-in-out infinite; }
video.vid { width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; border: 3px solid var(--ink); background: #000; }

/* the controller-shaped PLAY button Coan drew */
.play { display: block; width: 210px; margin: 2px auto 0; text-decoration: none; transition: transform 0.15s cubic-bezier(.3,1.6,.5,1); }
.play svg { width: 100%; overflow: visible; filter: drop-shadow(3px 4px 0 var(--ink)); }
.play .pad { fill: var(--pop); stroke: var(--ink); stroke-width: 4; }
.play .dpad { fill: var(--ink); }
.play .btns circle { fill: var(--second); stroke: var(--ink); stroke-width: 2.5; }
.play text { font-family: var(--title-font); font-size: 30px; fill: var(--on-pop); stroke: none; }
.play:hover { transform: scale(1.08) rotate(-3deg); }
.play:active { transform: scale(0.95); }
.play.off { opacity: 0.5; pointer-events: none; }

/* ---------- comments ---------- */
.comments { border-top: 3px dashed var(--ink); padding-top: 10px; }
.comments-toggle { width: 100%; justify-content: center; font-size: 16px; }
.comments-body { margin-top: 12px; display: grid; gap: 10px; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.comment { position: relative; background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: 16px 18px 16px 4px; padding: 7px 12px; }
.comment b { font-family: var(--title-font); font-weight: 400; color: var(--main); }
:root[data-mode="night"] .comment b { color: var(--second); }
.comment p { margin: 2px 0 0; overflow-wrap: anywhere; }
.comment .when { font-size: 13px; opacity: 0.65; }
.comment .zap { position: absolute; top: 6px; right: 8px; border: 2px solid var(--ink); background: #ff6b6b; color: #fff; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; font-weight: 800; }
.no-comments { margin: 0; text-align: center; opacity: 0.75; font-weight: 700; }
.comment-form { display: grid; gap: 8px; }
.comment-form input, .comment-form textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--paper);
  border: 2.5px solid var(--ink); border-radius: 14px; padding: 8px 12px; width: 100%;
}
.comment-form textarea { resize: vertical; min-height: 64px; }
.comment-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.comment-form .go { justify-content: center; background: var(--second); }
.form-msg { margin: 0; font-weight: 700; min-height: 1.2em; text-align: center; }
.form-msg.bad { color: #e03131; } .form-msg.good { color: #2b8a3e; }
:root[data-mode="night"] .form-msg.bad { color: #ff8787; } :root[data-mode="night"] .form-msg.good { color: #8ce99a; }

.grownup-bar { max-width: 1120px; margin: 0 auto 10px; padding: 0 clamp(16px, 4vw, 40px); }
.grownup-bar .card { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; font-weight: 700; }
.grownup-bar input { font: inherit; border: 2.5px solid var(--ink); border-radius: 12px; padding: 4px 10px; background: var(--paper); color: var(--ink); }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 26px; }
.setting { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.setting:first-child { grid-column: 1 / -1; }
.setting h2 { font-family: var(--title-font); font-weight: 400; font-size: 26px; margin: 0; }
.toggle { font-size: 22px; padding: 12px 28px 10px; min-width: 160px; justify-content: center; }
.toggle[aria-pressed="true"] { background: var(--pop); color: var(--on-pop); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip { font-family: var(--title-font); font-size: 16px; color: var(--ink); background: var(--paper-2); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 14px 5px; cursor: pointer; box-shadow: 2px 3px 0 var(--ink); transition: transform 0.15s cubic-bezier(.3,1.6,.5,1); }
.chip:hover { transform: translateY(-2px) scale(1.05); }
.chip[aria-pressed="true"] { background: var(--pop); color: var(--on-pop); }
:root[data-mode="night"] .chip:hover, :root[data-mode="night"] .chip[aria-pressed="true"] { color: #241a33; }

.secret-smile { display: block; width: 26px; margin: 46px auto 0; opacity: 0.35; transition: opacity 0.3s, transform 0.3s; }
.secret-smile svg { width: 100%; }
.secret-smile path { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.secret-smile:hover { opacity: 1; transform: scale(1.6) rotate(8deg); }

.secret { max-width: 620px; margin: 30px auto 0; text-align: center; background: repeating-linear-gradient(-45deg, var(--paper) 0 18px, var(--paper-2) 18px 36px); }
.secret-badge { font-size: 70px; animation: bob 1.4s ease-in-out infinite; }
.secret-words { font-size: 22px; font-weight: 800; margin: 0 0 10px; }
.secret-words.small { font-size: 18px; font-weight: 600; }
.secret .go { margin-top: 12px; }

.foot { width: fit-content; margin: -22vh auto 24px; position: relative; font-family: var(--title-font); font-size: 16px; padding: 4px 16px 3px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 2px 3px 0 var(--ink); }

/* ---------- silly mode ---------- */
body.silly .blob, body.silly .chip { animation: jiggle 0.9s ease-in-out infinite; }
body.silly .blob:nth-child(3n), body.silly .chip:nth-child(3n) { animation-delay: -0.3s; }
body.silly .item-card, body.silly .picture-card, body.silly .setting { animation: wobble 2.4s ease-in-out infinite; }
body.silly .item-card:nth-child(even), body.silly .picture-card:nth-child(even) { animation-delay: -1.2s; }
body.silly .big-title .ch, body.silly .page-title .ch { animation: hop 0.8s ease-in-out infinite; animation-delay: calc(var(--i) * 90ms); }
body.silly .hero-logo, body.silly .brand .logo { animation: spin-wobble 3s ease-in-out infinite; }
body.silly { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36'%3E%3Ctext y='28' font-size='28'%3E🤪%3C/text%3E%3C/svg%3E") 18 18, auto; }

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { from { opacity: 1; } to { opacity: 0.35; box-shadow: none; } }
@keyframes flicker { from { transform: scaleY(1) skewX(0); } to { transform: scaleY(1.15) skewX(4deg); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes drop { 0% { opacity: 0; transform: translateY(-60px) rotate(-20deg); } 100% { opacity: 1; transform: none; } }
@keyframes float { 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes wave { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes jiggle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) scale(1.04); } }
@keyframes wobble { 0%, 100% { transform: rotate(-2deg) skewX(0); } 33% { transform: rotate(2deg) skewX(3deg); } 66% { transform: rotate(-1deg) skewX(-3deg); } }
@keyframes hop { 0%, 100% { transform: translateY(0) rotate(0); } 40% { transform: translateY(-18px) rotate(-8deg); } }
@keyframes spin-wobble { 0%, 100% { transform: rotate(-10deg) scale(1); } 50% { transform: rotate(10deg) scale(1.12); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- phones ---------- */
@media (max-width: 720px) {
  body { font-size: 17px; }
  .top { justify-content: center; }
  .menu { justify-content: center; }
  .squiggle { width: 14px; }
  .blob { font-size: 15px; padding: 7px 11px 6px; }
  .two-pictures { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .comment-form .row { grid-template-columns: 1fr; }
  .big-title { -webkit-text-stroke-width: 2px; text-shadow: 3px 4px 0 var(--main); }
  .page-title { -webkit-text-stroke-width: 2px; text-shadow: 3px 4px 0 var(--main); }
  .sky-thing { top: auto; bottom: 30vh; right: 6vw; opacity: 0.8; }
}
@media (max-width: 420px) {
  .ico { display: none; }
  .squiggle { display: none; }
}
