/* HOT POTATO. One kitchen: a tiled wall, a steel counter, one potato on it.
   Colour, grid and letter weight are read off his plate (HOTPOTATO/reference.jpg); the ground is
   inverted to bone white so this does not stand next to THE PIT (LOOK.md 3.3). */

:root {
  --tile: #EDE9E0;
  --tile-2: #E2DDD2;
  --grout: #C2BCB0;
  --ink: #17181A;
  --dim: #6D6F72;
  --steel: #9EA3A6;
  --dark: #16181A;
  --dark-2: #22262A;
  --acid: #C8F53C;
  --ember: #FF6A1F;
  --char: #2A2724;
  --display: "Archivo", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --gutter: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--tile);
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.55;
  font-synthesis: none;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 1.1; margin: 0 0 10px; }
h2 { font-size: clamp(20px, 2.4vw, 27px); }
p { margin: 0 0 14px; }
code { font-family: var(--mono); font-size: 0.92em; }

a, button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 20;
  background: var(--dark); color: var(--tile); padding: 12px 18px; font-family: var(--mono);
}
.skip:focus { left: 8px; top: 8px; }

/* ---------------------------------------------------------------- the wall */

/* The name is not printed on the wall, it IS the wall: the same kitchen, one band higher. */
.wall { background: var(--tile); }

.wall__name {
  display: block;
  width: 100%;
  height: clamp(104px, 11vw, 190px);
  object-fit: cover;
  object-position: center 46%;
}

.wall__strip {
  background-color: var(--tile-2);
  background-image: url("art/tile.webp");
  background-size: 660px 660px;
  border-top: 2px solid var(--grout);
  border-bottom: 3px solid var(--grout);
  padding: 14px var(--gutter);
  display: grid;
  justify-items: center;
  gap: 10px;
}

.wall__tiles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }

.wall__nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: min(760px, 100%);
}

/* a glazed tile: the only surface this world has for a word */
.tile {
  --lift: 3px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 10px 16px;
  background-color: #F6F4EE;
  background-image: linear-gradient(#FBFAF6, #E9E5DB);
  border: 2px solid var(--grout);
  border-radius: 2px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.75), inset 0 -2px 0 rgba(0,0,0,.06), 0 var(--lift) 0 var(--grout);
  color: var(--ink);
  font-family: var(--mono); font-weight: 600; font-size: 16px; letter-spacing: -.02em;
  text-decoration: none; cursor: pointer;
  transition: transform .06s, box-shadow .06s;
}
.tile:hover { background-image: linear-gradient(#FFFFFF, #F2EFE7); }
.tile:active { transform: translateY(var(--lift)); box-shadow: inset 0 2px 0 rgba(255,255,255,.6); }
.tile img { display: block; }
.tile--mark { width: 58px; padding: 10px; }
.tile--buy { font-weight: 700; }
.tile[aria-disabled="true"], .tile.is-off {
  color: #9A968D; background-color: var(--tile-2); cursor: not-allowed; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
  transform: none;
}
.tile.is-off img { opacity: .35; }

.tile--nav { font-family: var(--display); font-weight: 700; font-size: 17px; padding: 10px 8px; }
.tile--nav.is-on {
  background-color: var(--dark); background-image: none; color: var(--tile);
  border-color: var(--dark); box-shadow: inset 0 3px 0 rgba(255,255,255,.08);
  transform: translateY(var(--lift));
}

/* --------------------------------------------------------------- the stage */

.stage { position: relative; background: var(--char); }
.stage__hero {
  display: block; width: 100%; height: auto;
  height: clamp(300px, 52vh, 620px); object-fit: cover; object-position: 50% 50%;
  transition: opacity .5s;
}
.stage__hero--over { position: absolute; inset: 0; opacity: 0; }

.stage__read {
  position: absolute; left: 50%; top: 3%; transform: translateX(-50%);
  width: min(720px, 90%); text-align: center;
}
.read__who { margin: 0 0 2px; font-family: var(--mono); font-size: 15px; color: var(--dim); }
.read__label { text-transform: lowercase; }
.read__addr { color: var(--ink); font-weight: 700; }
.read__eth {
  margin: 0; font-family: var(--display); font-weight: 900;
  font-size: clamp(40px, 7.2vw, 92px); line-height: 1; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.read__unit { font-size: .34em; letter-spacing: 0; vertical-align: .55em; }
.read__note { margin: 4px 0 0; font-family: var(--mono); font-size: 14px; color: var(--dim); }
.stage.is-over .read__eth { color: var(--ember); }
.stage.is-over .read__who, .stage.is-over .read__note { color: var(--ink); text-shadow: 0 1px 0 rgba(255,255,255,.55); }

/* ----------------------------------------------------------- the steel lip */

.lip {
  position: relative;
  background-color: var(--dark);
  border-top: 3px solid var(--char);
  padding: 18px var(--gutter);
  overflow: hidden;
}
.lip::before {
  content: ""; position: absolute; inset: 0;
  background: url("art/steel.webp") center / cover; opacity: .17; pointer-events: none;
}
.lip__clocks {
  position: relative;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  max-width: 1180px; margin: 0 auto 14px;
}
.clock { display: grid; gap: 2px; min-width: 0; }
.clock__k { font-family: var(--mono); font-size: 13px; color: #8E948A; letter-spacing: -.02em; }
.clock__v {
  font-family: var(--mono); font-weight: 700; font-size: clamp(18px, 2.2vw, 26px);
  color: var(--acid); font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.lip.is-over .clock__v { color: var(--ember); }

.lip__ca {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  max-width: 1180px; margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px;
}
.ca__k { font-family: var(--mono); font-size: 13px; color: #8E948A; }
.ca__v {
  flex: 1 1 320px; min-width: 0;
  font-family: var(--mono); font-size: 15px; color: #E8ECE2; overflow-wrap: anywhere; user-select: all;
}
.ca__v.is-empty { color: #8E948A; user-select: none; }
.stamp {
  min-height: 48px; padding: 0 20px;
  background: linear-gradient(#DDE1E0, #A9AEAD); border: 2px solid #0D0F10; border-radius: 2px;
  color: var(--dark); font-family: var(--mono); font-weight: 700; font-size: 15px;
  cursor: pointer; box-shadow: 0 3px 0 #0D0F10;
  transition: transform .06s, box-shadow .06s;
}
.stamp:active { transform: translateY(3px); box-shadow: none; }
.stamp:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* -------------------------------------------------------------- the panels */

.panel { max-width: 1180px; margin: 0 auto; padding: 26px var(--gutter) 60px; }
.panel:focus { outline: none; }
.page[hidden] { display: none; }

.acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.acts--minor { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.act {
  display: grid; gap: 4px; place-content: center; text-align: center;
  min-height: 74px; padding: 14px 16px;
  background: var(--dark); color: var(--tile);
  border: 2px solid var(--dark); border-radius: 2px;
  font-family: var(--display); font-weight: 900; font-size: 19px; letter-spacing: -.01em;
  cursor: pointer; box-shadow: 0 4px 0 var(--char);
  transition: transform .06s, box-shadow .06s, background .12s;
}
.act small { font-family: var(--mono); font-weight: 400; font-size: 13px; color: #A8ADA2; letter-spacing: -.02em; }
.act:hover:not(:disabled) { background: var(--dark-2); }
.act:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.act--primary { background: var(--ember); border-color: var(--ember); color: #1A0C03; box-shadow: 0 4px 0 #A83F0B; }
.act--primary small { color: #5B2A0B; }
.act--primary:hover:not(:disabled) { background: #FF7D3B; }
.act--small { min-height: 56px; font-size: 16px; }
.act:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

.hint { margin: 14px 0 0; font-family: var(--mono); font-size: 15px; color: var(--dim); min-height: 24px; }

.mine {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  margin-top: 18px; padding: 16px; background: var(--dark); border-radius: 2px;
}

.lede { max-width: 70ch; }

.clip { margin-top: 26px; }
.clip {
  display: block; width: 100%; max-width: 900px; margin: 0 auto 22px;
  border: 3px solid var(--ink); background: var(--char);
}

.log { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 15px; }
.log caption { text-align: left; font-family: var(--display); font-weight: 700; padding-bottom: 10px; }
.log th, .log td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--grout); overflow-wrap: anywhere; }
.log th { font-weight: 700; font-size: 13px; color: var(--dim); }
.log tbody tr:nth-child(odd) { background: var(--tile-2); }
.log__empty { color: var(--dim); }

.line { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: hand; }
.line li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--tile-2); border: 2px solid var(--grout);
  font-family: var(--mono); font-size: 15px; overflow-wrap: anywhere;
}
.line li::before {
  counter-increment: hand; content: counter(hand);
  min-width: 34px; height: 34px; display: grid; place-content: center;
  background: var(--dark); color: var(--acid); font-weight: 700; flex: none;
}
.line li.is-holder { border-color: var(--ember); background: #FFF1E7; }

.how { max-width: 72ch; }
.how h2 { margin-top: 26px; }
.how__addr { font-family: var(--mono); font-size: 14px; color: var(--dim); }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--dark); color: var(--tile); border: 2px solid var(--char);
  padding: 14px 20px; font-family: var(--mono); font-size: 15px; max-width: 92vw; z-index: 30;
}

/* --------------------------------------------------------------- the phone */

@media (max-width: 860px) {
  .wall { padding: 16px var(--gutter) 14px; gap: 12px; }
  .wall__nav { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; width: 100%; }
  .tile--nav { font-size: 16px; padding: 10px 2px; min-height: 50px; }
  .tile--buy { flex: 1 1 170px; font-size: 15px; }
  .wall__name { height: clamp(76px, 20vw, 120px); }
  .wall__strip { padding: 10px var(--gutter); gap: 8px; }
  .stage__hero { aspect-ratio: 4 / 5; max-height: none; object-position: 50% 62%; }
  .stage__read { top: 4%; }
  .lip__clocks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acts, .acts--minor { grid-template-columns: 1fr; }
  .mine { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .log th:nth-child(5), .log td:nth-child(5) { display: none; }
}

/* Under about 520px five tiles across stop fitting a readable word, so the wall runs two complete
   rows instead of five cramped ones: two tiles above, three below, both edge to edge. */
@media (max-width: 520px) {
  .wall__strip { padding: 9px var(--gutter); gap: 6px; }
  .tile { min-height: 48px; }
  .wall__tiles { width: 100%; flex-wrap: nowrap; gap: 8px; }
  .tile--buy { flex: 1 1 auto; min-width: 0; font-size: 14px; padding: 10px; }
  .tile--mark { width: 52px; }
  .wall__nav { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .tile--nav { font-size: 17px; padding: 10px 4px; }
  .tile--nav:nth-child(1), .tile--nav:nth-child(2) { grid-column: span 3; }
  .tile--nav:nth-child(3), .tile--nav:nth-child(4), .tile--nav:nth-child(5) { grid-column: span 2; }
}

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

.line li { justify-content: space-between; flex-wrap: wrap; }
.line__who { flex: 1 1 260px; min-width: 0; }
.line__give { min-height: 48px; padding: 0 16px; flex: none; }
