/* Pixel Companions homepage. One landscape from morning to night; features are pixel windows the characters stand on.
   Palette is taken from the sprites. Fonts: our own bitmap headlines (canvas), Pixelify Sans for UI, Atkinson Hyperlegible for text. */
:root {
  --ink: #1d1724;
  --paper: #f7f3ea;
  --paper2: #ece5d6;
  --dawn: #f6b58c;
  --dawn2: #f9d6b2;
  --day: #9fdcff;
  --noon: #c4eaff;
  --dusk: #c97a8a;
  --dusk2: #6e5a8e;
  --night: #24305c;
  --night2: #171d3b;
  --grass: #4f9a5a;
  --grass2: #3e7d47;
  --earth: #6b4a32;
  --tomato: #d8454b;
  --tomato2: #b23338;
  --sun: #e8c14a;
  --teal: #2fa3a0;
  --blue: #3f6fd1;
  --muted: #5b5463;
  --text: var(--ink);
  --winbg: var(--paper);
  --ui: "Pixelify Sans", ui-monospace, monospace;
  --body: "Atkinson Hyperlegible", Verdana, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #2a2533; --paper2: #221e2a; --winbg: #2a2533; --text: #efe9f5; --muted: #b6adc2;
    --dawn: #8a4e5c; --dawn2: #5a3b55; --day: #2d4a78; --noon: #33557f; --dusk: #4a3561; --dusk2: #322750;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--night2); color: var(--text); font: 18px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
h3 { font: 600 20px/1.25 var(--ui); margin: 14px 0 6px; letter-spacing: .2px; }
p { margin: 0 0 10px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(14px, 4vw, 40px); background: var(--dawn2); border-bottom: 3px solid var(--ink); color: var(--ink); }
@media (prefers-color-scheme: dark) { .topbar { color: var(--text); } }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 19px var(--ui); white-space: nowrap; }
.brandmark { width: 32px; height: 32px; }
.topnav { display: flex; align-items: center; gap: 18px; font: 400 17px var(--ui); }
.topnav .plain { text-decoration: none; }
.topnav .plain:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* ---------- chunky pixel buttons ---------- */
.pxbtn { display: inline-flex; align-items: center; justify-content: center; font: 600 18px/1 var(--ui); color: #fff; text-decoration: none;
  background: var(--tomato); border: 3px solid var(--ink); padding: 12px 18px 11px; cursor: pointer; position: relative;
  box-shadow: inset -3px -3px 0 var(--tomato2), inset 3px 3px 0 #ee7a72, 0 4px 0 var(--ink); transform: translateY(0);
  clip-path: polygon(3px 0, calc(100% - 3px) 0, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 0 calc(100% - 3px), 0 3px); }
.pxbtn:active { transform: translateY(4px); box-shadow: inset -3px -3px 0 var(--tomato2), inset 3px 3px 0 #ee7a72, 0 0 0 var(--ink); }
.pxbtn.ghost { background: var(--paper); color: var(--ink); box-shadow: inset -3px -3px 0 var(--paper2), inset 3px 3px 0 #fff, 0 4px 0 var(--ink); }
.pxbtn.ghost:active { box-shadow: inset -3px -3px 0 var(--paper2), inset 3px 3px 0 #fff, 0 0 0 var(--ink); }
@media (prefers-color-scheme: dark) { .pxbtn.ghost { color: var(--text); box-shadow: inset -3px -3px 0 var(--paper2), inset 3px 3px 0 #3a3445, 0 4px 0 var(--ink); } }
.pxbtn.small { font-size: 16px; padding: 9px 13px 8px; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 22px 0 8px; }
.cta.center { justify-content: center; margin-top: 34px; }

/* ---------- the sky: one landscape down the page, dithered between times of day ---------- */
.sky { position: relative; padding: clamp(46px, 7vw, 86px) clamp(14px, 4vw, 40px); }
.sky + .sky::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
  background: repeating-conic-gradient(var(--next) 0 25%, transparent 0 50%) 0 0 / 8px 8px; }
.dawn { background: linear-gradient(var(--dawn) 0 40%, var(--dawn2)); }
.day { background: var(--day); --next: var(--day); }
.noon { background: var(--noon); --next: var(--noon); }
.dusk { background: linear-gradient(var(--dusk), var(--dusk2)); --next: var(--dusk); color: #fbf3f6; }
.night { background: linear-gradient(var(--night), var(--night2)); --next: var(--night); color: #e9e6f6; }
.wrap { max-width: 1120px; margin: 0 auto; position: relative; }
.wrap.narrow { max-width: 720px; }

/* section titles: drawn with our own pixel font (canvas); the text stays for screen readers */
.pxtitle { margin: 0 0 18px; font: 600 40px/1.1 var(--ui); }
.pxtitle canvas { max-width: 100%; height: auto; }
.pxtitle .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.intro { max-width: 62ch; font-size: 19px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: clamp(20px, 4vw, 52px); align-items: end;
  padding-bottom: 0; max-width: none; }
.hero-copy { padding-bottom: 54px; max-width: 560px; justify-self: end; color: var(--ink); }
@media (prefers-color-scheme: dark) { .hero-copy { color: var(--text); } }
.lede { font-size: 20px; max-width: 46ch; }
.fine { font: 400 15px var(--ui); color: var(--muted); }
@media (prefers-color-scheme: dark) { .fine { color: #e7d8de; } }
.hero-scene { margin: 0; align-self: end; }
.hero-scene canvas { margin: 0 auto; }
.ground-edge { grid-column: 1 / -1; height: 26px; margin: 0 calc(-1 * clamp(14px, 4vw, 40px));
  background: linear-gradient(var(--grass) 0 10px, var(--grass2) 10px 14px, var(--earth) 14px); border-top: 3px solid var(--ink); }

/* ---------- pixel windows ---------- */
.pxwin { background: var(--winbg); border: 3px solid var(--ink); box-shadow: 6px 6px 0 rgba(29, 23, 36, .9); position: relative; color: var(--text);
  clip-path: none; }
.titlebar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--blue); color: #fff;
  border-bottom: 3px solid var(--ink); font: 600 17px var(--ui); }
.titlebar .ico { width: 20px; height: 20px; }
.titlebar .dots { margin-left: auto; display: flex; gap: 5px; }
.titlebar .dots i { width: 10px; height: 10px; background: #fff; border: 2px solid var(--ink); display: block; }
.titlebar .dots i:last-child { background: var(--tomato); }
.win-body { padding: 16px 18px 18px; }
.win-body .demo { margin: 0 auto 4px; }
.win-body p { color: var(--text); }
.split { display: grid; grid-template-columns: minmax(0, 470px) 1fr; gap: 26px; align-items: center; }
.split.rev { grid-template-columns: 1fr minmax(0, 400px); }
.split.rev .demo { order: 2; }
.split .txt h3 { margin-top: 0; }

.wins { display: grid; grid-template-columns: repeat(12, 1fr); gap: 34px 28px; margin-top: 28px; }
.wins > *, .split > *, .hero > * { min-width: 0; }
.demo, .hero-scene canvas { max-width: 100%; }
.w-wide { grid-column: 1 / -1; }
.w-msg { grid-column: span 5; }
.w-week { grid-column: span 7; }
.w-circle { grid-column: span 7; }
.w-update { grid-column: span 5; }
.w-status { grid-column: 1 / -1; }
.w-street { grid-column: 1 / -1; }
/* not every window the same colour: title bars follow the cloth palette */
.w-msg .titlebar { background: var(--tomato); }
.w-week .titlebar { background: var(--teal); }
.w-circle .titlebar { background: #8a5ad0; }
.w-status .titlebar { background: var(--grass); }
.w-street .titlebar { background: #2a3a6a; }
.w-update .titlebar { background: #ef8a3c; }

/* gallery */
.gallery-win { margin-top: 26px; }
.gallery { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 6px; padding: 22px 18px;
  background: repeating-conic-gradient(var(--paper2) 0 25%, var(--paper) 0 50%) 0 0 / 16px 16px; }
.gallery figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
.gallery figcaption { font: 400 14px var(--ui); color: var(--muted); }
.gallery-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 14px 18px; border-top: 3px solid var(--ink); }
.hint { font-size: 15px; color: var(--muted); }

/* week grid */
.weekgrid { display: grid; grid-template-columns: 84px repeat(7, 1fr); gap: 3px; font: 400 14px var(--ui); }
.weekgrid .h { text-align: center; color: var(--muted); padding-bottom: 2px; }
.weekgrid .who { display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; }
.weekgrid .who canvas { width: 24px; height: 27px; flex: none; }
.weekgrid .c { min-height: 34px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink); }
.weekgrid .c canvas { width: 20px; height: 20px; }
.c.home { background: #cfe8c8; } .c.school { background: #f6dc9c; } .c.work { background: #c9d6f2; } .c.off { background: #f7c9d5; }
@media (prefers-color-scheme: dark) { .c.home { background: #36533a; } .c.school { background: #5c4a22; } .c.work { background: #2f3d63; } .c.off { background: #5a3242; } }

/* ---------- how ---------- */
.signposts { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px;
  position: relative; }
.signposts::before { content: ""; position: absolute; left: 4%; right: 4%; top: 30px; height: 6px;
  background: repeating-linear-gradient(90deg, #f2efe6 0 12px, transparent 12px 22px); opacity: .7; }
.signposts li { position: relative; display: flex; flex-direction: column; gap: 10px; }
.signposts .post { width: 64px; height: 64px; display: grid; place-items: center; font: 600 32px var(--ui); color: var(--ink);
  background: var(--sun); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); position: relative; }
.signposts h3 { margin: 4px 0 4px; color: #fff; }
.signposts p { color: #f7eef2; }

/* ---------- night ---------- */
.night .pxtitle { color: #fff; }
.night p { color: #dcd8ee; }
.stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pxlist { list-style: none; padding: 0; margin: 14px 0 18px; }
.pxlist li { position: relative; padding-left: 28px; margin: 10px 0; color: #ece9f8; }
.pxlist li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 10px; background: var(--sun); box-shadow: 2px 2px 0 var(--ink); }

/* ---------- footer as a taskbar ---------- */
.taskbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px clamp(14px, 4vw, 40px); background: #3a4166; color: #fff; border-top: 3px solid var(--ink); font: 400 16px var(--ui); }
.tb-left { display: flex; align-items: center; gap: 10px; }
.tb-right { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-right a { text-decoration: none; padding: 6px 12px; background: #4c5480; border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 #6a73a3; }
.tb-right a:hover { background: #5a6394; }
.heart { color: #ff7a8a; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { justify-self: start; padding-bottom: 8px; }
  .wins { grid-template-columns: 1fr; gap: 30px; }
  .wins > * { grid-column: 1 / -1 !important; }
  .split { grid-template-columns: 1fr; }
  .split.rev .demo { order: 0; }
  .split, .split.rev { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .signposts { grid-template-columns: 1fr; }
  .signposts::before { display: none; }
  .signposts li { flex-direction: row; align-items: flex-start; gap: 16px; }
  .signposts .post { flex: none; width: 52px; height: 52px; font-size: 26px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .topbar { padding: 8px 12px; }
  .topnav { gap: 10px; font-size: 14px; }
  .topnav .pxbtn.small { font-size: 14px; padding: 7px 9px 6px; }
  .brand span { display: none; }
  .lede { font-size: 18px; }
  .weekgrid { grid-template-columns: 62px repeat(7, 1fr); font-size: 12px; }
  .weekgrid .who span { display: none; }
}

/* after deleting an account (welcome.html?deleted=1) */
.deleted-note{margin:0;padding:12px 16px;text-align:center;background:#1d1724;color:#f2efe6;font-family:"Pixelify Sans",monospace}
/* privacy.html: a long page in the night sky */
.policy{padding-bottom:64px}
.policy h2.pxtitle{margin-top:36px}
.policy a{color:inherit;text-decoration:underline}
.policy .wrap{position:relative;background:rgba(18,20,44,.88);border:3px solid #0d0b14;box-shadow:4px 4px 0 #0d0b14;padding:28px 28px 36px}
@media (max-width:600px){.policy .wrap{padding:20px 16px 28px;border-width:2px}}

/* the join page */
.join { min-height: calc(100vh - 64px); }
.joinwin { margin: 0 auto 22px; max-width: 520px; }
.joinwin .win-body { padding: 26px 24px 22px; text-align: center; }
.joinchar { width: 128px; height: 176px; image-rendering: pixelated; display: block; margin: 0 auto 10px; }
.jointitle { font: 600 clamp(24px, 5vw, 32px)/1.15 var(--ui); margin: 0 0 10px; }
.joinactions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.joinerr { color: #b8323a; min-height: 1.2em; margin-top: 12px; }
