/* ==========================================================
   Matthew Tang — shared styles for every page
   Robot-lab theme: clean white boxes, chunky display type for
   big words, little robot mascots perched on things.
   ========================================================== */

:root{
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --ink: #1F2430;
  --muted: #6B7080;
  --line: #E3DFD5;
  --red: #E23B3B;
  --teal: #2BB3A6;
  --orange: #F28C28;
  --yellow: #F5C842;
  --text: #1F2430;
  --dot: rgba(31,36,48,0.07);
  --cell-hidden: #E8ECF1;
  --cell-hover: #DCE3EA;
  --cell-revealed: #FFFFFF;
  --grid-line: #CDD5DE;
  --radius: 18px;
}


/* ---------- Dark mode ----------
   Follows the device setting until the visitor picks one with the
   sun/moon button; their choice is remembered on that browser. */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg: #171A22;
    --surface: #222736;
    --ink: #07090D;
    --text: #ECEAE4;
    --muted: #9AA0AE;
    --line: #343A4B;
    --red: #EA5A52;
    --teal: #36C4B6;
    --dot: rgba(255,255,255,0.06);
    --cell-hidden: #2E3445;
    --cell-hover: #384055;
    --cell-revealed: #1B1F2A;
    --grid-line: #12151C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"]{
    --bg: #171A22;
    --surface: #222736;
    --ink: #07090D;
    --text: #ECEAE4;
    --muted: #9AA0AE;
    --line: #343A4B;
    --red: #EA5A52;
    --teal: #36C4B6;
    --dot: rgba(255,255,255,0.06);
    --cell-hidden: #2E3445;
    --cell-hover: #384055;
    --cell-revealed: #1B1F2A;
    --grid-line: #12151C;
    color-scheme: dark;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', system-ui, sans-serif;
}
body{
  min-height: 100vh;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
}
img{ max-width: 100%; display: block; }
a{ color: inherit; }

/* ---------- Page frame: sidebar + main ---------- */
.page{
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 0;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 32px;
}

/* ---------- Sidebar nav (//01 Home etc.) ---------- */
.side-nav{
  position: sticky;
  top: 40px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
}
.side-nav a{
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  width: fit-content;
  font-family: 'Bungee', sans-serif;
  font-size: 15px;
  text-decoration: none;
  color: var(--muted);
  padding: 8px 14px;
  border: 2px solid transparent;
  border-radius: 12px;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.side-nav a .num{
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 12px;
  color: var(--red);
}
.side-nav a:hover{ color: var(--text); border-color: var(--line); background: var(--surface); }
.side-nav a[aria-current="page"]{
  color: var(--text);
  background: var(--surface);
  border-color: var(--text);
  box-shadow: 0 3px 0 var(--ink);
}
/* a robot sits on whichever page you're on */
.side-nav a[aria-current="page"]::before{
  content: "";
  position: absolute;
  right: 10px;
  bottom: calc(100% - 3px);
  width: 30px;
  height: 27px;
  background: url(bots/bolt.svg) no-repeat center / contain;
}

/* ---------- Top bar with the five link buttons ---------- */
.topbar{
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}
.links{
  display: flex;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.link-btn{
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
}
.link-btn:hover, .link-btn:focus-visible{
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--ink);
  color: #fff;
  outline: none;
}
.link-btn.github:hover,    .link-btn.github:focus-visible   { background: var(--ink); }
.link-btn.linkedin:hover,  .link-btn.linkedin:focus-visible { background: #2F6FC4; }
.link-btn.resume:hover,    .link-btn.resume:focus-visible   { background: var(--teal); }
.link-btn.instagram:hover, .link-btn.instagram:focus-visible{ background: var(--orange); }
.link-btn.email:hover,     .link-btn.email:focus-visible    { background: var(--red); }

/* resume isn't ready yet: greyed out until site.js gets a link */
.link-btn.is-disabled{ opacity: .45; cursor: not-allowed; }
.link-btn.is-disabled:hover{ transform: none; box-shadow: 0 3px 0 var(--ink); background: var(--surface); color: var(--text); }

/* little label under each button on hover */
.link-btn .tip{
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  color: #1F2430;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 2px 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 5;
}
.link-btn:hover .tip, .link-btn:focus-visible .tip{ opacity: 1; transform: translateX(-50%); }

/* ---------- Headings ---------- */
.hero{ margin: 10px 0 48px; }
h1{
  font-family: 'Bungee', sans-serif;
  font-weight: 400;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.02;
  margin: 0 0 14px;
  color: var(--red);
  text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 var(--yellow);
}
.tagline{
  font-weight: 800;
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 12px;
  letter-spacing: .3px;
}
.tagline b{ color: var(--teal); }
.blurb{
  font-size: 19px;
  line-height: 1.5;
  margin: 0;
  max-width: 40ch;
}
h2{
  font-family: 'Bungee', sans-serif;
  font-weight: 400;
  font-size: clamp(22px, 3.4vw, 30px);
  margin: 0 0 30px;
  color: var(--text);
}
h2 .accent{ color: var(--red); }

/* ---------- Shared card ---------- */
.card{
  position: relative;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--ink);
}
.card-img{
  width: 100%;
  object-fit: cover;
  background: var(--line);
}

/* robot perched on a card's top edge */
.perch::before{
  content: "";
  position: absolute;
  bottom: calc(100% - 3px);
  right: 24px;
  width: 44px;
  height: 40px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  transform-origin: bottom center;
  transition: transform .25s cubic-bezier(.3,1.6,.5,1);
  z-index: 2;
}
.perch.left::before{ right: auto; left: 24px; }
.perch:hover::before{ transform: translateY(-3px) rotate(-6deg); }
.bot-bolt::before { background-image: url(bots/bolt.svg); }
.bot-visor::before{ background-image: url(bots/visor.svg); }
.bot-gear::before { background-image: url(bots/gear.svg); }

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Bungee', sans-serif;
  font-size: 13px;
  text-decoration: none;
  color: #fff;
  background: var(--red);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.btn:active{ transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:focus-visible{ outline: 3px solid var(--teal); outline-offset: 3px; }
.btn.ghost{ background: var(--surface); color: var(--text); }

/* ---------- Home: featured projects ---------- */
.featured{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  margin-bottom: 70px;
}
.feature{
  display: block;
  text-decoration: none;
  transition: transform .15s ease;
}
.feature:hover{ transform: translateY(-3px); }
.feature .card-img{
  aspect-ratio: 16 / 10;
  border-radius: 16px 16px 0 0;
  border-bottom: 2px solid var(--ink);
}
.feature .caption{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
}
.feature .caption strong{
  font-family: 'Bungee', sans-serif;
  font-weight: 400;
  font-size: 17px;
}
.feature .caption .arrow{
  font-weight: 900;
  color: var(--red);
  transition: transform .15s ease;
}
.feature:hover .caption .arrow{ transform: translateX(4px); }

/* ---------- Home: hobby slider ("drag me") ---------- */
.drag-hint{
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 6px;
  letter-spacing: .5px;
}
.drag-hint span{ display: inline-block; margin: 0 10px; color: var(--red); }

.hobbies{
  position: relative;
  overflow: hidden;
  cursor: grab;
  padding: 26px 0 64px;
  margin: 0 -24px;
  border-top: 2px dashed var(--line);
  border-bottom: 2px dashed var(--line);
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  /* fade the edges */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.hobbies.dragging{ cursor: grabbing; }
.hobby-track{
  display: flex;
  gap: 44px;
  width: max-content;
  padding: 0 22px;
  will-change: transform;
}
.hobby{
  position: relative;
  flex: 0 0 auto;
  width: 120px;
  outline: none;
}
.hobby img{
  width: 120px;
  height: 120px;
  object-fit: contain;
  -webkit-user-drag: none;
  /* sticker look: white outline + soft shadow */
  filter:
    drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff)
    drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff)
    drop-shadow(0 8px 10px rgba(31,36,48,.18));
  transition: transform .25s cubic-bezier(.3,1.6,.5,1);
}
.hobby:hover img, .hobby:focus-visible img{ transform: translateY(-6px) rotate(-4deg) scale(1.06); }
.hobby .label{
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  width: max-content;
  max-width: 190px;
  text-align: center;
  transform: translateX(-50%) translateY(-4px);
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.hobby .label small{
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--red);
}
.hobby .label span{
  display: block;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}
.hobby:hover .label, .hobby:focus-visible .label{ opacity: 1; transform: translateX(-50%); }

/* ---------- Articles list ---------- */
.article-list{ display: flex; flex-direction: column; gap: 34px; }
.article-row{
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: visible;
}
.article-row .card-img{
  height: 100%;
  min-height: 170px;
  border-radius: 16px 0 0 16px;
  border-right: 2px solid var(--ink);
}
.article-row .body{
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.article-row .top{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.article-row .kicker{
  font-size: 12px;
  font-weight: 900;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: .6px;
}
.article-row p{
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 700;
}

/* ---------- Projects grid ---------- */
.project-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.project{
  display: flex;
  flex-direction: column;
}
.project .card-img{
  aspect-ratio: 4 / 4.2;
  border-radius: 16px 16px 0 0;
  border-bottom: 2px solid var(--ink);
}
.project .body{
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 20px;
}
.project h3{
  font-family: 'Bungee', sans-serif;
  font-weight: 400;
  font-size: 20px;
  margin: 0 0 6px;
}
.project p{ margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); font-weight: 700; }
.project .btn{ align-self: flex-end; }

/* ---------- Article placeholder pages ---------- */
.coming-soon{
  padding: 34px 28px;
  margin-top: 44px;
}
.coming-soon p{ margin: 0 0 20px; font-size: 18px; line-height: 1.5; }

/* ---------- Article pages ---------- */
.article{ display: flex; flex-direction: column; gap: 44px; }
.article-section{ padding: 28px 28px 30px; }
.article-section h2{ margin: 0 0 18px; }
.article-section h3{
  font-family: 'Bungee', sans-serif;
  font-weight: 400;
  font-size: 18px;
  margin: 26px 0 10px;
}
.article-section p,
.article-section li{ font-size: 17px; line-height: 1.6; }
.article-section p{ margin: 0 0 14px; }
.article-section p:last-child{ margin-bottom: 0; }
.article-section ul{ margin: 0 0 14px; padding-left: 22px; }
.article-section li{ margin-bottom: 8px; }
.article-section li::marker{ color: var(--red); }
.article-section code{
  font-family: ui-monospace, Consolas, monospace;
  font-size: .9em;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
.article-section pre{
  overflow-x: auto;
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 12px;
}
.article-section pre code{
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.55;
}
.article-figure{ margin: 6px 0 20px; }
.article-figure > img,
.model-grid img{
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
}
.model-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.model-grid img{ aspect-ratio: 4 / 3; object-fit: contain; background: #2B303B; }
.article-figure figcaption{
  margin-top: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 600px){
  .model-grid{ grid-template-columns: 1fr 1fr; }
}
.article-section a{ color: var(--red); font-weight: 800; }
.table-wrap{
  overflow-x: auto;
  margin: 0 0 16px;
  border: 2px solid var(--ink);
  border-radius: 12px;
}
.article-section table{
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.article-section th,
.article-section td{
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 2px solid var(--line);
  line-height: 1.45;
}
.article-section tr:last-child td{ border-bottom: none; }
.article-section th{
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #1F2430;
  background: var(--yellow);
  border-bottom: 2px solid var(--ink);
}
.article-section td.num{ font-weight: 900; color: var(--red); white-space: nowrap; }
.article-section td:first-child{ font-weight: 800; }

/* ---------- Footer ---------- */
footer{
  grid-column: 1 / -1;
  margin-top: 60px;
  padding: 18px 0 30px;
  border-top: 2px dashed var(--line);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Small screens ---------- */
@media (max-width: 820px){
  .page{ grid-template-columns: 1fr; gap: 10px; padding-top: 24px; }
  .side-nav{
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 30px;
  }
  .side-nav a{ font-size: 13px; padding: 6px 10px; }
  .topbar{ justify-content: flex-start; order: -1; }
  .featured, .project-grid{ grid-template-columns: 1fr; }
  .article-row{ grid-template-columns: 1fr; }
  .article-row .card-img{
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-radius: 16px 16px 0 0;
    border-right: none;
    border-bottom: 2px solid var(--ink);
  }
  .hobbies{ margin: 0 -16px; }
  .article-section{ padding: 22px 18px 24px; }
}
@media (max-width: 480px){
  .page{ padding-left: 16px; padding-right: 16px; }
  .link-btn{ width: 40px; height: 40px; font-size: 16px; }
  .links{ gap: 8px; }
}

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; }
}

/* keep wide content (the hobby slider) from stretching the page */
main{ min-width: 0; }
@media (max-width: 820px){
  .featured, .project-grid{ row-gap: 52px; }
}

/* ---------- Email button: copies address ---------- */
button.link-btn{ padding: 0; font: inherit; font-size: 18px; cursor: pointer; }
/* last button sits at the right edge, so its label lines up to the right */
.link-btn.email .tip{ left: auto; right: -6px; transform: translateY(-4px); }
.link-btn.email:hover .tip, .link-btn.email:focus-visible .tip,
.link-btn.email.copied .tip{ opacity: 1; transform: none; }
.link-btn.email.copied .tip{ background: var(--teal); color: #fff; }

/* ==========================================================
   //04 Game — Minefield
   ========================================================== */
.game-hero{
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.status-chip{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}
.led{ width: 11px; height: 11px; border-radius: 50%; background: var(--orange); flex-shrink: 0; transition: background-color .2s ease; }
.led.won { background: #3E9B5A; }
.led.lost{ background: var(--red); }

.game{ max-width: 760px; }
.difficulty-row{ display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.diff-btn{
  position: relative;
  flex: 1 1 150px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .15s ease;
}
.diff-btn:hover{ border-color: var(--text); }
.diff-btn .name{ display: block; font-family: 'Bungee', sans-serif; font-size: 15px; }
.diff-btn .meta{ display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.diff-btn::before{
  content: "";
  position: absolute;
  right: 14px;
  bottom: calc(100% - 3px);
  width: 30px;
  height: 27px;
  background: url(bots/gear.svg) no-repeat center / contain;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .25s cubic-bezier(.3,1.6,.5,1);
}
.diff-btn[aria-pressed="true"]{ border-color: var(--text); box-shadow: 0 4px 0 var(--ink); }
.diff-btn[aria-pressed="true"]::before{ opacity: 1; transform: none; }
.diff-btn[aria-pressed="true"] .meta{ color: var(--red); }
.diff-btn:focus-visible, .reset-btn:focus-visible, .cell:focus-visible{ outline: 3px solid var(--teal); outline-offset: 2px; }

.readout-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 36px 0 40px;
  flex-wrap: wrap;
}
.lcd-wrap{ text-align: center; }
.lcd{
  font-family: 'Bungee', sans-serif;
  font-size: 22px;
  letter-spacing: 2px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 6px 14px;
  min-width: 92px;
}
.lcd-label{ font-size: 11px; font-weight: 800; color: var(--muted); margin-top: 5px; text-transform: uppercase; letter-spacing: .5px; }
.reset-btn{
  position: relative;
  font-family: 'Bungee', sans-serif;
  font-size: 17px;
  background: var(--red);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
  padding: 10px 24px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.reset-btn.perch::before{ right: 50%; margin-right: -22px; }
.reset-btn:hover{ transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.reset-btn:active{ transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }

.game .perch{ position: relative; }
.board-scroll{
  overflow-x: auto;
  padding: 12px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--ink);
}
.grid{
  display: grid;
  gap: 2px;
  background: var(--grid-line);
  border: 2px solid var(--grid-line);
  border-radius: 6px;
  overflow: hidden;
  width: max-content;
  margin: 0 auto;
}
.cell{
  width: var(--cell-size);
  height: var(--cell-size);
  background: var(--cell-hidden);
  border: none;
  padding: 0;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: calc(var(--cell-size) * 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.cell:hover:not([data-revealed="true"]):not([disabled]){ background: var(--cell-hover); }
.cell[data-revealed="true"]{ background: var(--cell-revealed); cursor: default; }
.cell[data-flagged="true"]{ color: var(--red); }
.cell[data-mine-hit="true"]{ background: var(--red); color: #fff; }
.cell[data-wrong-flag="true"]{ color: var(--red); }
.cell[data-num="1"]{ color: #2F6FC4; }
.cell[data-num="2"]{ color: #3E9B5A; }
.cell[data-num="3"]{ color: #E23B3B; }
.cell[data-num="4"]{ color: #6A4FB0; }
.cell[data-num="5"]{ color: #B4562A; }
.cell[data-num="6"]{ color: #1E9A8E; }
.cell[data-num="7"]{ color: var(--text); }
.cell[data-num="8"]{ color: #6B7080; }
.status-line{ margin: 16px 0 6px; font-size: 14px; font-weight: 800; color: var(--muted); min-height: 18px; }
.status-line.won { color: #3E9B5A; }
.status-line.lost{ color: var(--red); }
.game-help{ margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* ---------- Light/dark toggle ---------- */
.topbar{ gap: 10px; align-items: center; }
/* only one icon at a time: moon in light mode, sun in dark mode */
.theme-toggle i{ display: none !important; }
.theme-toggle .fa-moon{ display: inline-block !important; }
:root[data-theme="dark"] .theme-toggle .fa-moon{ display: none !important; }
:root[data-theme="dark"] .theme-toggle .fa-sun{ display: inline-block !important; }
.link-btn.theme-toggle:hover, .link-btn.theme-toggle:focus-visible{ background: var(--yellow); color: #1F2430; }

/* ---------- Home hero with photo ---------- */
.hero.with-photo{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}
.hero.with-photo .hero-text{ flex: 1; min-width: 0; padding-top: 10px; }
/* keep "I'm Matthew!" on one line */
.hero.with-photo h1{ font-size: clamp(30px, 5.4vw, 60px); }
.nowrap{ white-space: nowrap; }
.me{
  flex: 0 0 auto;
  width: 230px;
  margin-top: 16px;
  transition: transform .2s ease;
}
.me:hover{ transform: translateY(-3px); }
.me img{
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
  border-radius: 16px;
}
@media (max-width: 1020px){
  .me{ width: 190px; }
  .hero.with-photo h1{ font-size: clamp(30px, 4.2vw, 60px); }
}
@media (max-width: 820px){
  .hero.with-photo{ flex-direction: column-reverse; gap: 22px; }
  .hero.with-photo h1{ font-size: clamp(28px, 8.5vw, 52px); }
  .me{ width: 100%; max-width: 220px; margin-top: 30px; }
}

/* ---------- Dark mode touch-ups ---------- */
/* thin light outline so the robots don't vanish on dark backgrounds */
:root[data-theme="dark"] .perch::before,
:root[data-theme="dark"] .side-nav a::before,
:root[data-theme="dark"] .diff-btn::before{
  filter:
    drop-shadow(1.5px 0 0 #ECEAE4) drop-shadow(-1.5px 0 0 #ECEAE4)
    drop-shadow(0 1.5px 0 #ECEAE4) drop-shadow(0 -1.5px 0 #ECEAE4);
}
/* brighter minefield numbers */
:root[data-theme="dark"] .cell[data-num="1"]{ color: #6FA8F0; }
:root[data-theme="dark"] .cell[data-num="2"]{ color: #6BCB86; }
:root[data-theme="dark"] .cell[data-num="3"]{ color: #F2706A; }
:root[data-theme="dark"] .cell[data-num="4"]{ color: #B49CF0; }
:root[data-theme="dark"] .cell[data-num="5"]{ color: #E59A6C; }
:root[data-theme="dark"] .cell[data-num="6"]{ color: #5FD6C9; }
:root[data-theme="dark"] .cell[data-num="8"]{ color: #B5BAC6; }


/* ==========================================================
   Page transitions (the animation itself lives in site.js)
   ========================================================== */
/* //01 //02 //03: keep the page hidden until the drop-in starts;
   the sidebar stays put */
html[data-pt="1"] main, html[data-pt="1"] footer,
html[data-pt="2"] main, html[data-pt="2"] footer,
html[data-pt="3"] main, html[data-pt="3"] footer{ visibility: hidden; }

/* //04: hide the whole page and paint the cell colour so nothing
   flashes between the two pages */
html[data-pt="4"] body{ visibility: hidden; }
html[data-pt="4"]{ background: #3A4152; }

.pt{
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  visibility: visible;
  cursor: progress;
}
.pt-stage{ position: absolute; inset: 0; }
.pt-label{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  text-align: center;
  color: #fff;
  pointer-events: none;
}
.pt-label .fa-bomb{ font-size: clamp(34px, 6vw, 60px); color: #E23B3B; }
.pt-num{
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(15px, 2.2vw, 22px);
  letter-spacing: .25em;
}
.pt-name{
  font-family: 'Bungee', sans-serif;
  font-size: clamp(38px, 10vw, 118px);
  line-height: 1;
  white-space: nowrap;
}
.pt-cell{
  position: absolute;
  display: grid;
  place-items: center;
  font-family: 'Bungee', sans-serif;
  font-size: 22px;
  color: transparent;
  background: #3A4152;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.13), inset -3px -3px 0 rgba(0,0,0,.35);
}