:root {
  --paper: #f0f5f5;
  --ink: #121212;
  --bar: #f0f5f5;
  --when: 0.5;
  --gap: 11px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bar);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Main paper surface so Safari status bar can use --bar while content sits on --paper */
#page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: var(--paper);
  padding: clamp(56px, 10vh, 108px) clamp(20px, 5vw, 44px) calc(148px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-head,
.wishlist,
.page-foot {
  width: 100%;
  max-width: 660px;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(44px, 7vh, 72px);
}

.page-head:has(+ .domain-note) {
  margin-bottom: 18px;
}

.domain-note {
  width: 100%;
  max-width: 660px;
  margin: 0 0 clamp(40px, 6.5vh, 64px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.domain-note p {
  margin: 0;
  line-height: 1.55;
}

.domain-note p:nth-child(1) {
  font-size: 13.5px;
  opacity: 0.78;
}

.domain-note p:nth-child(2) {
  font-size: 12px;
  opacity: 0.56;
}

.domain-note p:nth-child(3) {
  font-size: 10.5px;
  opacity: 0.42;
}

.page-head h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

a,
a:visited {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, var(--ink) 76%, transparent);
  transition: opacity 0.18s ease, text-decoration-color 0.18s ease;
}

a:hover {
  text-decoration-color: var(--ink);
}

a:focus-visible {
  outline: 1.5px solid color-mix(in srgb, var(--ink) 65%, transparent);
  outline-offset: 3px;
  border-radius: 2px;
}

.home-link {
  font-size: 13px;
  opacity: 0.56;
  text-decoration-color: color-mix(in srgb, var(--ink) 38%, transparent);
}

.home-link:hover {
  opacity: 0.92;
}

.wishlist {
  display: flex;
  flex-direction: column;
  gap: clamp(60px, 9vh, 88px);
}

.section {
  display: flex;
  flex-direction: column;
}

.section-heading {
  margin: 0 0 28px;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.65;
  opacity: 0.62;
}

.section-heading::before {
  content: "* ";
  opacity: 0.72;
}

.items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Consistent left-photo / right-details rows for effortless scanning */
.entry {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  column-gap: 32px;
  align-items: center;
  padding: 24px 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
}

.entry:first-child {
  padding-top: 0;
  border-top: 0;
}

.entry:last-child {
  padding-bottom: 0;
}

.entry-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.group-label {
  margin: 0 0 2px;
  font-size: 13px;
  opacity: 0.56;
}

.group-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.item-row.is-addon {
  padding-left: 16px;
  font-size: 14px;
  opacity: 0.85;
}

.item-link {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}

.item-store {
  font-size: 11.5px;
  opacity: 0;
  text-decoration: none;
  transition: opacity 0.18s ease;
  white-space: nowrap;
}

.item-row:hover .item-store,
.item-row:focus-within .item-store,
.entry.is-lit .item-store {
  opacity: 0.46;
}

.item-leader {
  flex: 1 1 24px;
  min-width: 14px;
  border-bottom: 1px dotted color-mix(in srgb, var(--ink) 24%, transparent);
  transform: translateY(-3.5px);
  transition: border-color 0.18s ease;
}

.item-row:hover .item-leader,
.entry.is-lit .item-leader {
  border-bottom-color: color-mix(in srgb, var(--ink) 48%, transparent);
}

.item-prices {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.item-was {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  opacity: 0.4;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.item-price {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.88;
}

.item-code {
  align-self: flex-start;
  margin: -2px 0 0;
  padding: 1px 6px;
  border: 1px dashed color-mix(in srgb, var(--ink) 28%, transparent);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font: 400 12px / 1.5 var(--mono);
  opacity: 0.72;
  cursor: pointer;
  transition: opacity 0.18s ease, border-color 0.18s ease;
}

.item-code:hover {
  opacity: 1;
  border-color: color-mix(in srgb, var(--ink) 60%, transparent);
}

.item-code:focus-visible {
  outline: 1.5px solid color-mix(in srgb, var(--ink) 65%, transparent);
  outline-offset: 2px;
}

.item-desc {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.55;
  opacity: 0.58;
}

/* Tactile paper prints */
.print-slot {
  display: flex;
  align-items: center;
  justify-content: center;
}

.print {
  position: relative;
  display: block;
  width: 120px;
  background: #ffffff;
  padding: 7px;
  border-radius: 3.5px;
  text-decoration: none;
  box-shadow:
    0 0.7px 1.4px rgba(0, 0, 0, 0.18),
    0 1.8px 4.8px rgba(0, 0, 0, 0.07);
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  will-change: filter;
  transition: box-shadow 0.2s ease;
}

a.print {
  cursor: pointer;
}

.print img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 1.5px;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.page-foot {
  margin-top: clamp(64px, 9vh, 96px);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12.5px;
  opacity: 0.46;
}

.foot-mark {
  user-select: none;
}

/* Scattered monospace asterisks around the page whitespace */
#stars {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  user-select: none;
}

.star {
  position: absolute;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1;
  transform-origin: center center;
  will-change: transform, opacity;
}

/* Daylight + drifting cloud shadow layer */
#atmosphere {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 10;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* Floating bottom time-of-day slider, clock, and ambient sound toggle */
.controls {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#clock {
  height: 18px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  color: rgba(255, 255, 255, 0.92);
  font: 500 11px / 14px var(--mono);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease;
}

body.night #clock,
body.night #time,
body.night #sound {
  background-color: rgba(255, 255, 255, 0.14);
}

.controls-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-wrap {
  position: relative;
  width: 132px;
  height: 26px;
}

#time {
  width: 132px;
  height: 26px;
  margin: 0;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease;
}

#time::-webkit-slider-runnable-track {
  height: 26px;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.35) calc(10px + var(--when, 0.5) * 96px - var(--gap, 11px)),
    transparent 0 calc(10px + var(--when, 0.5) * 96px + var(--gap, 11px)),
    rgba(255, 255, 255, 0.35) 0
  ) center / 100% 1px no-repeat;
}

#time::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  border: 0;
  background: none;
  box-shadow: none;
  opacity: 0;
}

#time::-moz-range-track {
  height: 26px;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.35) calc(10px + var(--when, 0.5) * 96px - var(--gap, 11px)),
    transparent 0 calc(10px + var(--when, 0.5) * 96px + var(--gap, 11px)),
    rgba(255, 255, 255, 0.35) 0
  ) center / 100% 1px no-repeat;
}

#time::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  opacity: 0;
}

#time:focus {
  outline: none;
}

#time:focus-visible {
  box-shadow: rgba(255, 255, 255, 0.55) 0 0 0 1.5px;
}

#knob {
  position: absolute;
  left: calc(7px + var(--when, 0.5) * 96px);
  top: 2px;
  width: 22px;
  height: 22px;
  overflow: visible;
  pointer-events: none;
}

#sound {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 6h3l4-3v10l-4-3H2z' fill='white' fill-opacity='.9'/%3E%3Cpath d='M11 5.5a3.5 3.5 0 0 1 0 5M12.8 3.8a6 6 0 0 1 0 8.4' fill='none' stroke='white' stroke-opacity='.9' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat rgba(0, 0, 0, 0.34);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease;
}

#sound.off {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 6h3l4-3v10l-4-3H2z' fill='white' fill-opacity='.9'/%3E%3Cpath d='M11 6l4 4M15 6l-4 4' stroke='white' stroke-opacity='.9' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E");
}

#sound:focus {
  outline: none;
}

#sound:focus-visible {
  box-shadow: rgba(255, 255, 255, 0.55) 0 0 0 1.5px;
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .entry {
    grid-template-columns: 84px minmax(0, 1fr);
    column-gap: 18px;
    align-items: start;
    padding: 20px 0;
  }

  .print {
    width: 84px;
    padding: 5px;
  }

  .item-row.is-addon {
    padding-left: 12px;
    font-size: 13px;
  }

  .item-store {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  a,
  .item-store,
  .item-leader,
  .print,
  #clock,
  #time,
  #sound {
    transition: none;
  }
}
