/* ─── Samar's crayon desktop ───────────────────────────── */
:root {
  --paper: #fbf6ea;
  --paper-2: #f3ecdb;
  --ink: #1c1a17;
  --ink-soft: #5b554b;

  --red: #e5483a;
  --orange: #f39132;
  --yellow: #ffd23f;
  --green: #1f9a4b;
  --blue: #2f6fd8;
  --sky: #8cc7f2;
  --purple: #8b5cc8;
  --pink: #f48fb1;
  --brown: #9a6a3e;

  --win: #fffdf7;
  --shadow: rgba(28, 26, 23, 0.18);
  --line-soft: rgba(28, 26, 23, 0.3);
  --on-crayon: #1c1a17;
  --wall: var(--paper);
  --taskbar: var(--blue);

  --hand: 'Patrick Hand', 'Comic Sans MS', system-ui, sans-serif;
  --brush: 'Caveat Brush', 'Patrick Hand', cursive;
  --bar-h: 54px;
}

body[data-mode='traveler'] {
  --wall: #e6f2fb;
  --taskbar: var(--green);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--hand);
  font-size: 18px;
  line-height: 1.4;
  overflow: hidden;
  transition: background-color 0.6s ease;
}
button { font: inherit; color: inherit; }
a { color: inherit; }

/* Paper grain over everything */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.38  0 0 0 0 0.28  0 0 0 0.22 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
}

/* ─── Desktop + wallpaper doodles ──────────────────────── */
.desktop {
  position: fixed;
  inset: 0 0 var(--bar-h) 0;
  overflow: hidden;
}
.wallpaper { position: absolute; inset: 0; pointer-events: none; }
.wallpaper svg { position: absolute; overflow: visible; }
.wallpaper .sun { right: 5vmin; top: 4vmin; width: min(16vmin, 130px); height: auto; animation: sun-spin 40s linear infinite; }
@keyframes sun-spin { to { transform: rotate(360deg); } }
/* paper airplane drifting across now and then */
.plane {
  position: absolute;
  top: 30%;
  left: 0;
  width: 160px;
  animation: plane-fly 26s linear 4s infinite;
  transform: translateX(-200px);
  opacity: 0.9;
}
.plane-bob { animation: plane-bob 3.2s ease-in-out infinite alternate; }
.plane svg { width: 100%; height: auto; overflow: visible; }
@keyframes plane-fly {
  0% { transform: translateX(-200px) translateY(0); }
  45% { transform: translateX(110vw) translateY(-60px); }
  100% { transform: translateX(110vw) translateY(-60px); }
}
@keyframes plane-bob { from { transform: translateY(-10px) rotate(-3deg); } to { transform: translateY(12px) rotate(4deg); } }

/* ─── Widgets: small crayon windows on the right ───────── */
.widgets {
  position: absolute;
  top: calc(4vmin + min(16vmin, 130px) + 6px);
  right: 24px;
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 2;
}
.gadget {
  position: relative;
  background: var(--win);
  border-radius: 14px;
  box-shadow: 6px 7px 0 var(--shadow);
  animation: widget-in 0.6s cubic-bezier(.2,1.4,.4,1) 0.4s both;
}
.gadget + .gadget { animation-delay: 0.55s; }
.gadget::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  filter: url(#rough);
  pointer-events: none;
}
@keyframes widget-in { from { opacity: 0; transform: translateY(16px); } }
.gadget.flash { animation: wiggle 0.6s ease; }
@keyframes wiggle { 25% { transform: rotate(2deg) scale(1.03); } 60% { transform: rotate(-2deg); } }

.gadget-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px 6px;
  color: #fff;
  isolation: isolate;
}
.gadget-bar::before {
  content: '';
  position: absolute;
  inset: 3px 3px 0 3px;
  z-index: -1;
  border-radius: 11px 11px 4px 4px;
  background: var(--bar, var(--blue));
  filter: url(#crayon);
}
.gadget-title {
  font-family: var(--brush);
  font-size: 1.25rem;
  line-height: 1;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
}
.live {
  font-size: 0.85rem;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--win);
  color: var(--red);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.45; } }

.gadget-body { display: block; width: 100%; padding: 12px 14px 14px; }
.air-body { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; min-height: 64px; }
.air-face svg { width: 54px; height: 54px; display: block; }
.air-num { font-family: var(--brush); font-size: 2.2rem; line-height: 0.9; }
.air-num small { font-family: var(--hand); font-size: 0.95rem; color: var(--ink-soft); }
.air-label { font-size: 1rem; }
.air-meta { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 1px; font-size: 0.92rem; color: var(--ink-soft); margin-top: 4px; }
.air-meta .link-btn { align-self: flex-start; color: var(--ink); font-size: 0.95rem; margin-top: 2px; }

/* the note sits inside its window like a sticky note on paper */
.sticky-widget {
  position: relative;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 1.04rem;
  line-height: 1.3;
  isolation: isolate;
}
.sticky-widget::before {
  content: '';
  position: absolute;
  inset: 8px 8px 8px 8px;
  z-index: -1;
  background: var(--c, var(--yellow));
  opacity: 0.55;
  border-radius: 6px;
  filter: url(#crayon);
  transition: background-color 0.3s ease;
}
.sticky-widget .note-text { display: block; margin-bottom: 8px; }
.note-next { font-size: 0.92rem; color: var(--ink-soft); transition: transform 0.2s ease; display: inline-block; }
.sticky-widget:hover .note-next { transform: translateX(4px); color: var(--ink); }
.sticky-widget.flip .note-text { animation: flip 0.35s ease; }
@keyframes flip { 50% { opacity: 0; transform: translateY(6px); } }

@media (max-width: 720px) {
  .wallpaper .sun { display: none; }
  .widgets {
    top: 236px;
    left: 10px;
    right: 10px;
    width: auto;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
  }
  .gadget { flex: 1; min-width: 0; }
  .gadget-title { font-size: 1.1rem; }
  .gadget-body { padding: 10px 12px 12px; }
  .sticky-widget { font-size: 0.95rem; }
  .air-body { grid-template-columns: 1fr; }
  .air-face svg { width: 42px; height: 42px; }
  .air-num { font-size: 1.8rem; }
  .plane { top: 72%; width: 120px; }
}
/* short screens: keep the desktop calm */
@media (max-height: 560px) and (min-width: 721px) { .widgets { display: none; } }

/* ─── Desktop icons ────────────────────────────────────── */
.icons {
  position: absolute;
  top: 18px;
  left: 14px;
  bottom: 14px;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 108px);
  grid-auto-columns: 104px;
  gap: 6px 8px;
  z-index: 1;
}
.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 104px;
  padding: 6px 4px;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.25s cubic-bezier(.2,1.6,.4,1);
}
.icon svg { width: 62px; height: 54px; overflow: visible; }
.icon:hover { transform: translateY(-3px) rotate(-2deg); }
.icon:nth-child(even):hover { transform: translateY(-3px) rotate(2deg); }
.icon:active { transform: scale(0.94); }
.icon-label {
  font-size: 1rem;
  line-height: 1.1;
  padding: 1px 6px;
  border-radius: 6px;
}
.icon:focus-visible { outline: none; }
.icon:focus-visible .icon-label,
.icon.selected .icon-label { background: var(--yellow); }
.icon.pop { animation: icon-pop 0.55s cubic-bezier(.2,1.5,.4,1) both; animation-delay: calc(var(--i) * 55ms); }
@keyframes icon-pop { from { opacity: 0; transform: translateY(14px) scale(0.7) rotate(-8deg); } }

/* ─── Windows ──────────────────────────────────────────── */
.windows { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.win {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  max-width: calc(100vw - 16px);
  max-height: calc(100% - 16px);
  background: var(--win);
  border-radius: 14px;
  box-shadow: 7px 8px 0 var(--shadow);
  animation: win-open 0.35s cubic-bezier(.2,1.4,.4,1) both;
}
/* hand-drawn outline */
.win::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  filter: url(#rough);
  pointer-events: none;
}
@keyframes win-open { from { opacity: 0; transform: scale(0.85) rotate(-1.5deg); } }
.win.closing { animation: win-close 0.2s ease forwards; }
@keyframes win-close { to { opacity: 0; transform: scale(0.9) rotate(1deg); } }
.win.minimized { display: none; }
.win.maximized {
  left: 8px !important;
  top: 8px !important;
  width: calc(100vw - 16px) !important;
  height: calc(100% - 16px) !important;
}

.win-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  color: #fff;
  cursor: grab;
  user-select: none;
  touch-action: none;
  flex-shrink: 0;
}
.win-bar:active { cursor: grabbing; }
/* waxy crayon fill behind the title */
.win-bar::before {
  content: '';
  position: absolute;
  inset: 3px 3px 0 3px;
  border-radius: 11px 11px 4px 4px;
  background: var(--bar, var(--blue));
  filter: url(#crayon);
}
.win:not(.focused) .win-bar::before { opacity: 0.55; }
.win-bar > * { position: relative; }
.win-icon svg { width: 26px; height: 24px; display: block; }
.win-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: var(--brush);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
}
.win-btns { display: flex; gap: 5px; }
.win-btns button {
  position: relative;
  width: 30px;
  height: 28px;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  display: grid;
  place-items: center;
}
.win-btns button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--win);
  border: 2.5px solid var(--ink);
  border-radius: 7px;
  filter: url(#rough);
  z-index: -1;
  transition: transform 0.15s ease;
}
.win-btns button:hover::before { transform: rotate(-4deg) scale(1.06); }
.win-btns button[data-act='close']::before { background: var(--red); }
.win-btns button[data-act='close'] { color: #fff; }
.win-btns button span { position: relative; }

.win-body {
  flex: 1;
  overflow: auto;
  padding: 18px 20px 22px;
  overscroll-behavior: contain;
}

/* ─── Window content bits ──────────────────────────────── */
.crayon-h {
  font-family: var(--brush);
  font-weight: 400;
  font-size: 2.3rem;
  line-height: 1;
  margin: 0 0 10px;
}
.mark {
  background: linear-gradient(transparent 55%, var(--hl, var(--yellow)) 55%, var(--hl, var(--yellow)) 88%, transparent 88%);
  padding: 0 3px;
}
.soft { color: var(--ink-soft); }
.small { font-size: 0.92rem; }

.about { display: grid; grid-template-columns: auto 1fr; gap: 16px 18px; align-items: start; }
.avatar { width: 86px; height: 86px; }
.about-copy p { margin: 0 0 10px; }
.short-h { font-family: var(--brush); font-weight: 400; font-size: 1.35rem; margin: 14px 0 4px; line-height: 1; }
.short-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.short-list li { position: relative; padding-left: 24px; line-height: 1.3; }
.short-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.42em;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--c, var(--orange));
  filter: url(#crayon);
}
.short-list li:nth-child(3n+2)::before { --c: var(--blue); }
.short-list li:nth-child(3n)::before { --c: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.crayon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 0;
  background: none;
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  isolation: isolate;
  transition: transform 0.2s cubic-bezier(.2,1.6,.4,1);
}
.crayon-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c, var(--yellow));
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  filter: url(#rough);
}
.crayon-btn:hover { transform: rotate(-3deg) scale(1.05); }

/* notepad */
.notepad {
  margin: -18px -20px -22px;
  padding: 18px 20px 22px 54px;
  min-height: 100%;
  background:
    linear-gradient(90deg, transparent 40px, rgba(229, 72, 58, 0.5) 40px, rgba(229, 72, 58, 0.5) 42px, transparent 42px),
    repeating-linear-gradient(var(--win) 0 31px, rgba(47, 111, 216, 0.22) 31px 32px);
  line-height: 32px;
}
.notepad ul { margin: 0; padding: 0; list-style: none; }
.notepad li::before { content: '✎ '; color: var(--blue); }

/* file list (writing, projects) */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: center;
  border-radius: 12px;
  transition: transform 0.2s cubic-bezier(.2,1.6,.4,1), background-color 0.2s ease;
}
.file:hover { transform: translateY(-3px) rotate(-1.5deg); background: rgba(255, 210, 63, 0.25); }
.file svg { width: 58px; height: 64px; }
.file-name { font-size: 1.05rem; line-height: 1.15; }
.file-meta { font-size: 0.85rem; color: var(--ink-soft); }

/* project cards */
.projects { display: grid; gap: 16px; }
.project {
  position: relative;
  padding: 16px 18px;
  isolation: isolate;
}
.project::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c, var(--sky));
  border-radius: 12px;
  filter: url(#crayon);
  opacity: 0.55;
}
.project::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  filter: url(#rough);
  pointer-events: none;
}
.project h3 { font-family: var(--brush); font-weight: 400; font-size: 1.7rem; margin: 0 0 4px; line-height: 1; }
.project p { margin: 0 0 6px; }
.project img { display: block; width: 100%; border-radius: 8px; margin-bottom: 10px; border: 2px solid var(--ink); }
.stamp {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--brush);
  font-size: 1.05rem;
  padding: 0 10px;
  border: 2.5px solid currentColor;
  border-radius: 8px;
  transform: rotate(6deg);
  color: var(--red);
  filter: url(#rough);
}
.stamp-shipped { color: var(--green); }
.stamp-building { color: var(--blue); }

.doodle { margin: 4px 0 10px; }
.doodle svg { display: block; width: 100%; max-width: 360px; height: auto; overflow: visible; }
.doodle text { font-family: var(--hand); font-size: 11px; fill: var(--ink); }
.doodle .doodle-note { font-size: 12px; fill: var(--ink-soft); }
.mini-stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.mini-crayon {
  position: relative;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 0.88rem;
  padding: 2px 12px 2px 9px;
  isolation: isolate;
  transition: transform 0.2s cubic-bezier(.2,1.6,.4,1);
}
.mini-crayon::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--win);
  border: 2px solid var(--ink);
  border-left: 7px solid var(--c);
  border-radius: 4px 12px 12px 4px;
  filter: url(#rough);
}
.mini-crayon:hover { transform: rotate(-3deg) translateY(-1px); }
.project-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }

/* crayon box (stack) */
.box-group { font-family: var(--brush); font-weight: 400; font-size: 1.5rem; margin: 14px 0 6px; line-height: 1; }
.crayons { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.crayon-stick {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px 0 22px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.35);
  transform: rotate(var(--r, 0deg));
  transition: transform 0.25s cubic-bezier(.2,1.6,.4,1);
  isolation: isolate;
}
/* crayon body */
.crayon-stick::before {
  content: '';
  position: absolute;
  inset: 0 0 0 14px;
  z-index: -1;
  background: var(--c);
  border: 2.5px solid var(--ink);
  border-radius: 3px 10px 10px 3px;
  filter: url(#crayon);
}
/* pointed tip */
.crayon-stick .tip {
  position: absolute;
  left: 0;
  top: 50%;
  width: 18px;
  height: 22px;
  transform: translateY(-50%);
  background: var(--c);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  filter: url(#crayon);
}
.crayon-stick[style*='--yellow'], .crayon-stick[style*='--sky'] { color: var(--ink); text-shadow: none; }
.crayon-stick .wrap { position: relative; padding: 0 4px; }
.crayon-stick .wrap::before, .crayon-stick .wrap::after {
  content: '';
  position: absolute;
  top: -11px;
  bottom: -11px;
  width: 2px;
  background: rgba(0, 0, 0, 0.3);
}
.crayon-stick .wrap::before { left: -6px; }
.crayon-stick .wrap::after { right: -6px; }
.crayon-stick:hover { transform: rotate(0) translateX(-4px); }
.crayon-stick.picked { transform: rotate(0) translateX(-8px) scale(1.08); }
.crayon-stick.picked::before { box-shadow: 0 0 0 3px var(--yellow); }
.tool-info {
  margin-top: 18px;
  padding: 12px 14px;
  border: 2.5px dashed var(--line-soft);
  border-radius: 12px;
  min-height: 64px;
}
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline wavy var(--orange);
  text-underline-offset: 3px;
}

/* sticky notes (thoughts) */
.stickies { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px 18px; padding: 6px; }
.sticky {
  position: relative;
  padding: 26px 18px 16px;
  font-size: 1.12rem;
  line-height: 1.3;
  transform: rotate(var(--r, -1.5deg));
  transition: transform 0.25s cubic-bezier(.2,1.6,.4,1);
  isolation: isolate;
}
.sticky::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c, var(--yellow));
  filter: url(#crayon);
  box-shadow: 3px 4px 0 rgba(0,0,0,0.12);
}
.sticky::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  width: 70px;
  height: 22px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0,0,0,0.08);
}
.sticky:hover { transform: rotate(0deg) scale(1.04); z-index: 1; }
.sticky .tag { display: block; margin-top: 10px; font-size: 0.9rem; opacity: 0.7; }

/* stickers (interests) */
.stickers { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; padding: 8px; }
.sticker {
  position: relative;
  width: 190px;
  padding: 18px 16px;
  text-align: center;
  transform: rotate(var(--r, 2deg));
  transition: transform 0.25s cubic-bezier(.2,1.6,.4,1);
  isolation: isolate;
}
.sticker::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c, var(--pink));
  border: 3px solid var(--ink);
  border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%;
  filter: url(#rough);
}
.sticker:hover { transform: rotate(0) scale(1.06); }
.sticker h3 { font-family: var(--brush); font-weight: 400; font-size: 1.6rem; margin: 0 0 4px; line-height: 1; }
.sticker p { margin: 0; font-size: 0.98rem; line-height: 1.25; }

/* places */
.map-box {
  position: relative;
  height: 280px;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
}
.map-box::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--ink);
  border-radius: 12px;
  filter: url(#rough);
  pointer-events: none;
  z-index: 500;
}
.map-box .leaflet-container { width: 100%; height: 100%; font-family: var(--hand); }
.place-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.place-list button {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: baseline;
  text-align: left;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}
.place-list button:hover, .place-list button.active { background: rgba(140, 199, 242, 0.45); }
.place-list strong { font-family: var(--brush); font-weight: 400; font-size: 1.35rem; min-width: 95px; }

/* essay reader */
.reader-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.reader-bar .spacer { flex: 1; }
.lang button[aria-pressed='true'] { --c: var(--yellow); }
.lang button[aria-pressed='false'] { --c: var(--win); }
.essay { max-width: 66ch; margin: 0 auto; }
.essay h1 { font-family: var(--brush); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1; margin: 0 0 6px; }
.essay .sub { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 12px; }
.essay .essay-copy { display: none; }
.essay .essay-copy.active { display: block; }
.essay .essay-copy p { margin: 0 0 1em; font-size: 1.12rem; line-height: 1.6; }
.essay .essay-section-heading { font-family: var(--brush); font-size: 1.6rem !important; line-height: 1.1 !important; margin: 1.4em 0 0.4em !important; }
.essay .essay-section-heading strong { font-weight: 400; }

/* trash */
.trash { text-align: center; padding: 10px 0 4px; }
.trash svg { width: 120px; height: 120px; }

/* ─── Taskbar ──────────────────────────────────────────── */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  z-index: 100;
  isolation: isolate;
}
.taskbar::before {
  content: '';
  position: absolute;
  inset: 3px 0 0 0;
  z-index: -1;
  background: var(--taskbar);
  filter: url(#crayon);
  transition: background-color 0.6s ease;
}
.taskbar::after {
  content: '';
  position: absolute;
  left: -4px; right: -4px; top: 2px;
  border-top: 3px solid var(--ink);
  filter: url(#rough);
  z-index: -1;
}

.start-btn {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px 0 12px;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--brush);
  font-size: 1.5rem;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
  isolation: isolate;
  transition: transform 0.2s cubic-bezier(.2,1.6,.4,1);
}
.start-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--green);
  border: 3px solid var(--ink);
  border-radius: 8px 22px 22px 8px;
  filter: url(#rough);
}
body[data-mode='traveler'] .start-btn::before { background: var(--orange); }
.start-btn:hover, .start-btn[aria-expanded='true'] { transform: scale(1.05) rotate(-2deg); }
.start-blob {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(var(--red) 0 25%, var(--yellow) 0 50%, var(--blue) 0 75%, var(--pink) 0);
  border: 2px solid var(--ink);
  animation: spin 9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.task-list { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.task-list::-webkit-scrollbar { display: none; }
.task {
  position: relative;
  flex-shrink: 0;
  max-width: 180px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 0;
  background: none;
  cursor: pointer;
  color: #fff;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
}
.task::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(28, 26, 23, 0.6);
  border-radius: 8px;
  filter: url(#rough);
}
.task.active::before { background: rgba(28, 26, 23, 0.35); border-color: var(--ink); }
.task svg { width: 20px; height: 18px; flex-shrink: 0; }
.task span { overflow: hidden; text-overflow: ellipsis; }

/* quick launch */
.quick { display: flex; align-items: center; gap: 2px; flex-shrink: 0; padding: 0 8px 0 4px; position: relative; }
.quick::after {
  content: '';
  position: absolute;
  right: 0;
  top: 6px;
  bottom: 6px;
  border-right: 2.5px dashed rgba(255, 255, 255, 0.55);
}
.quick-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.2s cubic-bezier(.2,1.6,.4,1), background-color 0.2s ease;
}
.quick-btn svg { width: 28px; height: 26px; overflow: visible; }
.quick-btn:hover { transform: translateY(-3px) rotate(-6deg); background: rgba(255, 255, 255, 0.2); }

/* "now:" ticker, only while no windows are open */
.task-list:empty { display: none; }
.task-list:not(:empty) + .ticker { display: none; }
.ticker {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 1.05rem;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker-track {
  display: inline-flex;
  gap: 18px;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
}
.ticker-label { font-family: var(--brush); font-size: 1.25rem; color: var(--yellow); }
.ticker .dot { color: var(--yellow); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* live AQI in the tray */
.aqi-pill {
  position: relative;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 3px 10px;
  color: var(--ink);
  isolation: isolate;
}
.aqi-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c, var(--yellow));
  border: 2px solid var(--ink);
  border-radius: 999px;
  filter: url(#rough);
}

.tray { display: flex; align-items: center; gap: 10px; flex-shrink: 0; color: #fff; }
.mode {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(28, 26, 23, 0.25);
}
.mode button {
  border: 0;
  background: none;
  cursor: pointer;
  color: #fff;
  font-size: 0.98rem;
  padding: 3px 10px;
  border-radius: 999px;
}
.mode button[aria-pressed='true'] { background: var(--win); color: var(--ink); }
.clock { font-size: 1.05rem; min-width: 4.6em; text-align: right; }

/* ─── Start menu ───────────────────────────────────────── */
.start-menu {
  position: fixed;
  left: 8px;
  bottom: calc(var(--bar-h) + 6px);
  width: min(360px, calc(100vw - 16px));
  z-index: 200;
  background: var(--win);
  border-radius: 14px;
  box-shadow: 7px 8px 0 var(--shadow);
  animation: menu-up 0.3s cubic-bezier(.2,1.4,.4,1) both;
}
.start-menu::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  filter: url(#rough);
  pointer-events: none;
}
@keyframes menu-up { from { opacity: 0; transform: translateY(16px); } }
.menu-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #fff;
  isolation: isolate;
}
.menu-head::before {
  content: '';
  position: absolute;
  inset: 3px 3px 0 3px;
  z-index: -1;
  border-radius: 11px 11px 4px 4px;
  background: var(--taskbar);
  filter: url(#crayon);
}
.menu-head svg { width: 48px; height: 48px; }
.menu-head strong { font-family: var(--brush); font-weight: 400; font-size: 1.9rem; line-height: 1; text-shadow: 1px 1px 0 rgba(0,0,0,0.3); }
.menu-list { list-style: none; margin: 0; padding: 8px; }
.menu-list button, .menu-list a {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  font-size: 1.08rem;
  border-radius: 8px;
}
.menu-list button:hover, .menu-list a:hover { background: rgba(255, 210, 63, 0.45); }
.menu-list svg { width: 30px; height: 28px; flex-shrink: 0; }
.menu-foot { padding: 8px 18px 14px; font-size: 0.9rem; color: var(--ink-soft); border-top: 2px dashed var(--line-soft); }

/* ─── Phones ───────────────────────────────────────────── */
@media (max-width: 720px) {
  :root { --bar-h: 58px; }
  body { font-size: 17px; }
  .icons {
    right: 8px;
    left: 8px;
    top: 12px;
    bottom: auto;
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    grid-auto-columns: auto;
  }
  .icon { width: auto; }
  .icon svg { width: 54px; height: 48px; }
  .icon-label { font-size: 0.95rem; }
  .win {
    left: 6px !important;
    top: 6px !important;
    width: calc(100vw - 12px) !important;
    height: calc(100% - 12px) !important;
  }
  .win-bar { cursor: default; }
  .win-btns button[data-act='max'] { display: none; }
  .win-body { padding: 14px 14px 18px; }
  .notepad { margin: -14px -14px -18px; padding-left: 50px; }
  .about { grid-template-columns: 1fr; }
  .crayon-h { font-size: 2rem; }
  .mode button { padding: 3px 7px; font-size: 0.9rem; }
  .clock { display: none; }
  .start-btn { font-size: 1.3rem; padding: 0 12px 0 10px; }
  .task span { display: none; }
  .quick, .aqi-pill { display: none !important; }
  .ticker { font-size: 0.95rem; }
  .task { padding: 0 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ─── Middle check-in widget ───────────────────────────── */
.middle {
  position: absolute;
  z-index: 2;
}
.checkin .gadget-body { padding: 14px 16px 16px; }
.checkin .air-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  align-items: center;
  min-height: 56px;
  padding-bottom: 12px;
  border-bottom: 2.5px dashed var(--line-soft);
}
.checkin .air-num { font-size: 2.1rem; }
.checkin .air-num small { font-size: 1rem; }
.checkin .air-meta { grid-column: auto; margin-top: 2px; }
.checkin .air-link { grid-column: 1 / -1; justify-self: start; font-size: 0.95rem; }
.mood-q { margin: 12px 0 8px; font-family: var(--brush); font-size: 1.35rem; line-height: 1.1; }
.mood-faces { display: flex; justify-content: space-between; gap: 4px; }
.mood-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  transition: transform 0.25s cubic-bezier(.2,1.8,.4,1);
}
.mood-face svg { width: 46px; height: 46px; }
.mood-face:hover { transform: translateY(-4px) rotate(-6deg) scale(1.08); }
.mood-face:nth-child(even):hover { transform: translateY(-4px) rotate(6deg) scale(1.08); }
.mood-face[aria-checked='true'] { transform: scale(1.18); color: var(--ink); font-weight: 700; }
.mood-face[aria-checked='true'] svg { filter: drop-shadow(0 0 0 transparent); }
.mood-faces:has([aria-checked='true']) .mood-face[aria-checked='false'] { opacity: 0.45; }
.mood-msg {
  position: relative;
  margin: 12px 0 0;
  padding: 10px 12px;
  min-height: 44px;
  line-height: 1.35;
  isolation: isolate;
}
.mood-msg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 10px;
  background: var(--c, transparent);
  opacity: 0.35;
  filter: url(#crayon);
}
.mood-msg.pop { animation: mood-pop 0.45s cubic-bezier(.2,1.5,.4,1); }
@keyframes mood-pop { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
.mood-tip { display: block; margin-top: 6px; font-size: 0.92rem; color: var(--ink-soft); }

/* In the right-hand column (narrower screens) */
.widgets .checkin .mood-face svg { width: 38px; height: 38px; }

/* ─── Theme button + moon ──────────────────────────────── */
.theme-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(28, 26, 23, 0.25);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(.2,1.6,.4,1);
}
.theme-btn:hover { transform: rotate(-20deg) scale(1.08); }
.theme-btn svg { width: 24px; height: 24px; overflow: visible; }
.theme-btn .i-sun { display: none; }
html[data-theme='dark'] .theme-btn .i-sun { display: block; }
html[data-theme='dark'] .theme-btn .i-moon { display: none; }

.wallpaper .moon { right: 5vmin; top: 4vmin; width: min(15vmin, 120px); height: auto; display: none; }
html[data-theme='dark'] .wallpaper .moon { display: block; }
html[data-theme='dark'] .wallpaper .sun { display: none; }

/* ─── Dark mode: crayon on dark paper ──────────────────── */
html[data-theme='dark'] {
  --ink: #f1ead9;
  --ink-soft: #bdb3a2;
  --win: #2a2732;
  --shadow: rgba(0, 0, 0, 0.45);
  --line-soft: rgba(241, 234, 217, 0.28);
  color-scheme: dark;
}
html[data-theme='dark'] body { --wall: #1d1b23; }
html[data-theme='dark'] body[data-mode='traveler'] { --wall: #15202b; }
html[data-theme='dark'] body::after { mix-blend-mode: screen; opacity: 0.08; }
/* text that sits on bright crayon fills stays dark in both themes */
.crayon-btn, .sticker, .aqi-pill, .icon.selected .icon-label, .icon:focus-visible .icon-label { color: var(--on-crayon); }
.crayon-stick[style*='--yellow'], .crayon-stick[style*='--sky'] { color: var(--on-crayon); }
.lang button[aria-pressed='false'] { color: var(--ink); }
html[data-theme='dark'] .mark { background: none; color: var(--yellow); }
html[data-theme='dark'] .mode button[aria-pressed='true'] { color: var(--ink); }
html[data-theme='dark'] .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9); }
html[data-theme='dark'] .leaflet-tooltip { background: var(--win); color: var(--ink); border-color: var(--line-soft); }
html[data-theme='dark'] .map-box .leaflet-control-attribution { background: rgba(0,0,0,0.5); color: #ccc; }
html[data-theme='dark'] .map-box .leaflet-control-attribution a { color: #ddd; }

@media (max-width: 720px) {
  .widgets { flex-wrap: wrap; }
  .widgets .checkin { flex-basis: 100%; }
  .widgets .gadget:not(.checkin) { display: none; } /* phones: just the check-in, no clutter */
  .widgets .checkin .air-body { grid-template-columns: auto 1fr; }
  .theme-btn { width: 32px; height: 32px; }
}

/* ─── One combined widget: air + note on top, mood below ─ */
.checkin-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
  padding-bottom: 12px;
  border-bottom: 2.5px dashed var(--line-soft);
}
.checkin .checkin-top .air-body { border-bottom: 0; padding-bottom: 0; align-content: start; }
.note-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px 10px;
  font-size: 0.98rem;
}
.note-cell::before { inset: 0 !important; opacity: 0.45 !important; border-radius: 10px !important; }
.cell-title { font-family: var(--brush); font-size: 1.1rem; line-height: 1; margin-bottom: 6px; color: var(--ink-soft); }
.note-cell .note-text { flex: 1; }
.middle .checkin .mood-face svg { width: 50px; height: 50px; }

@media (max-width: 720px) {
  .desktop { overflow-y: auto; overscroll-behavior: contain; }
  .widgets { top: 12px; }
  .checkin-top { gap: 10px; }
  .widgets .checkin .air-body { grid-template-columns: auto 1fr; }
  .widgets .checkin .air-face svg { width: 36px; height: 36px; }
  .widgets .checkin .air-num { font-size: 1.6rem; }
  .widgets .checkin .air-num small { display: block; font-size: 0.85rem; }
  .widgets .checkin .air-meta { grid-column: 1 / -1; font-size: 0.85rem; }
  .note-cell { font-size: 0.88rem; padding: 8px 10px; }
  .cell-title { font-size: 1rem; }
  .mood-q { font-size: 1.2rem; margin-top: 10px; }
  .widgets .checkin .mood-face svg { width: 40px; height: 40px; }
}
