:root {
  --cream: #f6efe2;
  --cream-soft: #fbf6ed;
  --ink: #11100e;
  --muted: rgba(17, 16, 14, 0.68);
  --line: rgba(17, 16, 14, 0.34);
  --line-soft: rgba(17, 16, 14, 0.14);
  --red: #c20f0f;
  --red-deep: #9f1110;
  --orange: #df9650;
  --blue: #4c9aa3;
  --green: #758f58;
  color-scheme: light;
  font-family:
    "Courier New", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  display: grid;
  height: 100vh;
  min-height: 720px;
  grid-template-rows: 64px minmax(0, 1fr) 92px 32px;
  border: 2px solid var(--ink);
  background: rgba(246, 239, 226, 0.82);
  overflow: hidden;
}

.top-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(22px, 3.4vw, 48px);
  border-bottom: 1px solid var(--ink);
  font-size: clamp(0.78rem, 0.95vw, 0.96rem);
}

.brand-system,
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.system-emblem,
.button-mark {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--cream-soft);
  background: var(--red);
  font-weight: 700;
  line-height: 1;
}

.sound-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  letter-spacing: 0;
}

.sound-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 22px;
  height: 14px;
}

.sound-bars i {
  display: block;
  width: 2px;
  background: var(--ink);
}

.sound-bars i:nth-child(1) { height: 6px; }
.sound-bars i:nth-child(2) { height: 10px; }
.sound-bars i:nth-child(3) { height: 13px; }
.sound-bars i:nth-child(4) { height: 8px; }
.sound-bars i:nth-child(5) { height: 5px; }

[data-sound-state="on"] .sound-bars i {
  animation: equalizer-wave 680ms steps(4, end) infinite;
}

[data-sound-state="on"] .sound-bars i:nth-child(2) {
  animation-delay: 90ms;
}

[data-sound-state="on"] .sound-bars i:nth-child(3) {
  animation-delay: 180ms;
}

[data-sound-state="on"] .sound-bars i:nth-child(4) {
  animation-delay: 270ms;
}

[data-sound-state="on"] .sound-bars i:nth-child(5) {
  animation-delay: 360ms;
}

.sound-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
}

.sound-dot-ink {
  background: var(--ink);
}

.sound-dot-red {
  background: var(--red);
}

.sound-toggle:hover,
.sound-toggle:focus-visible,
.site-nav a:hover,
.site-nav a:focus-visible,
.cup-button:hover,
.cup-button:focus-visible {
  color: var(--red);
  animation: link-glitch 260ms steps(2, end) both;
}

.sound-toggle:focus-visible,
.site-nav a:focus-visible,
.cup-button:focus-visible {
  outline: 1px solid var(--red);
  outline-offset: 4px;
}

.hero-grid {
  position: relative;
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(300px, 31vw) minmax(360px, 1fr) minmax(220px, 18vw);
  column-gap: clamp(24px, 3vw, 54px);
  padding: clamp(26px, 3.8vw, 56px) clamp(28px, 3.5vw, 52px) clamp(18px, 2vw, 30px);
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
}

.copy-panel,
.object-stage,
.right-panel {
  position: relative;
  z-index: 1;
}

.copy-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

h1 {
  margin: 0;
  color: var(--red);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(4.2rem, 7.7vw, 7.6rem);
  font-weight: 860;
  line-height: 0.86;
  letter-spacing: 0;
}

.subheading {
  width: min(100%, 360px);
  margin: clamp(20px, 2.5vh, 28px) 0 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
  font-size: clamp(0.88rem, 1.02vw, 1.06rem);
  font-weight: 700;
  line-height: 1.35;
}

.description {
  width: min(100%, 360px);
  margin: 26px 0 0;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink);
  font-size: clamp(0.86rem, 0.96vw, 1rem);
  line-height: 1.62;
}

.product-specs {
  display: grid;
  width: min(100%, 360px);
  gap: 8px;
  margin: 26px 0 clamp(22px, 3.8vh, 40px);
  font-size: clamp(0.72rem, 0.8vw, 0.82rem);
}

.product-specs div,
.readout-panel div {
  display: grid;
  grid-template-columns: 176px 1fr;
  gap: 12px;
}

.product-specs dt,
.product-specs dd,
.readout-panel dt,
.readout-panel dd {
  margin: 0;
}

.product-specs dt,
.cup-status strong {
  color: var(--red);
}

.cup-button {
  display: inline-grid;
  min-width: 260px;
  min-height: 62px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  background: rgba(255, 251, 242, 0.62);
  cursor: pointer;
  font-size: clamp(1rem, 1.2vw, 1.22rem);
  letter-spacing: 0;
}

.cup-button small {
  color: var(--red);
  font-size: 0.72rem;
}

.object-stage {
  display: grid;
  min-height: 0;
  place-items: center;
  isolation: isolate;
}

.object-stage::before {
  content: "";
  position: absolute;
  width: min(48vw, 590px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6), transparent 66%);
  z-index: -2;
}

.ambient-marks {
  position: absolute;
  inset: 3% 8%;
  z-index: -1;
  pointer-events: none;
}

.ambient-marks i {
  position: absolute;
  width: 12px;
  height: 12px;
}

.ambient-marks i::before,
.ambient-marks i::after {
  content: "";
  position: absolute;
  background: rgba(223, 150, 80, 0.58);
}

.ambient-marks i::before {
  left: 5px;
  width: 3px;
  height: 12px;
  animation: star-flicker 2.8s steps(2, end) infinite;
}

.ambient-marks i::after {
  top: 5px;
  width: 12px;
  height: 3px;
  animation: star-flicker 2.8s steps(2, end) infinite;
}

.ambient-marks i:nth-child(1) { left: 16%; top: 8%; }
.ambient-marks i:nth-child(2) { left: 28%; top: 3%; transform: scale(0.7); }
.ambient-marks i:nth-child(3) { right: 22%; top: 12%; transform: scale(0.55); }
.ambient-marks i:nth-child(4) { left: 9%; top: 30%; transform: scale(0.8); }
.ambient-marks i:nth-child(5) { left: 14%; bottom: 32%; transform: scale(0.72); }
.ambient-marks i:nth-child(6) { right: 12%; bottom: 28%; transform: scale(0.82); }
.ambient-marks i:nth-child(7) { left: 6%; bottom: 42%; transform: scale(0.62); }
.ambient-marks i:nth-child(8) { right: 35%; top: 4%; transform: scale(0.45); }

.ambient-marks i:nth-child(2)::before,
.ambient-marks i:nth-child(2)::after { animation-delay: 420ms; }
.ambient-marks i:nth-child(3)::before,
.ambient-marks i:nth-child(3)::after { animation-delay: 860ms; }
.ambient-marks i:nth-child(4)::before,
.ambient-marks i:nth-child(4)::after { animation-delay: 1.25s; }
.ambient-marks i:nth-child(5)::before,
.ambient-marks i:nth-child(5)::after { animation-delay: 1.7s; }
.ambient-marks i:nth-child(6)::before,
.ambient-marks i:nth-child(6)::after { animation-delay: 2.05s; }
.ambient-marks i:nth-child(7)::before,
.ambient-marks i:nth-child(7)::after { animation-delay: 2.42s; }
.ambient-marks i:nth-child(8)::before,
.ambient-marks i:nth-child(8)::after { animation-delay: 620ms; }

.cup-figure {
  position: relative;
  margin: 0;
  animation: cup-bob 5.8s ease-in-out infinite;
}

.cup-figure:hover {
  animation: cup-bob 5.8s ease-in-out infinite, cup-jitter 160ms steps(2, end) infinite;
}

.cup-gif {
  display: block;
  width: min(31vw, 395px);
  min-width: 320px;
  max-height: 68vh;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.vertical-lock {
  position: absolute;
  right: 1.8vw;
  top: 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.vertical-label {
  margin: 0;
  color: var(--red);
  font-size: clamp(1.05rem, 1.55vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.55;
  writing-mode: vertical-rl;
}

.cat-mark {
  width: 31px;
  height: 26px;
  transform: translateX(3px);
}

.cat-icon {
  display: block;
  width: 36px;
  height: 30px;
  object-fit: contain;
}

.cat-icon-filled {
  display: block;
  width: 34px;
  height: 30px;
  object-fit: contain;
}

.steam-field {
  position: absolute;
  top: 8%;
  left: 50%;
  z-index: 3;
  width: 170px;
  height: 230px;
  transform: translateX(-52%);
  pointer-events: none;
}

.steam-field i {
  position: absolute;
  bottom: 0;
  width: 7px;
  height: 7px;
  background: rgba(76, 154, 163, 0.5);
  image-rendering: pixelated;
  opacity: 0;
  animation: steam-rise 4.8s linear infinite;
}

.steam-field i:nth-child(1) { left: 30%; animation-delay: 0s; }
.steam-field i:nth-child(2) { left: 43%; width: 5px; height: 5px; background: rgba(194, 15, 15, 0.34); animation-delay: 0.9s; }
.steam-field i:nth-child(3) { left: 55%; animation-delay: 1.8s; }
.steam-field i:nth-child(4) { left: 65%; width: 5px; height: 5px; background: rgba(117, 143, 88, 0.44); animation-delay: 2.7s; }
.steam-field i:nth-child(5) { left: 39%; animation-delay: 3.4s; }
.steam-field i:nth-child(6) { left: 72%; width: 4px; height: 4px; animation-delay: 4.2s; }

[data-cup-state="opened"] .steam-field i {
  animation-duration: 2.25s;
}

.right-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(28px, 4.5vh, 54px);
}

.readout-panel {
  width: min(100%, 212px);
  border: 1px solid var(--ink);
  background: rgba(255, 251, 242, 0.5);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
}

.status-light {
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
}

.readout-panel dl {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 26px 20px;
  font-size: 0.82rem;
}

.readout-panel div {
  grid-template-columns: 58px 1fr;
}

.cup-status {
  display: grid;
  gap: 8px;
  padding: 17px 20px 21px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}

.code-marks {
  display: flex;
  align-items: center;
  gap: 42px;
}

.code-marks img:first-child {
  width: 74px;
  height: 34px;
}

.code-marks img:last-child {
  width: 44px;
  height: 44px;
}

.warning-card {
  display: grid;
  width: min(100%, 186px);
  min-height: 90px;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--ink);
}

.warning-icon {
  display: block;
  width: 48px;
  height: 42px;
  object-fit: contain;
}

.warning-card p,
.origin-stamp {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.42;
}

.origin-stamp {
  width: min(100%, 186px);
}

.site-nav {
  display: grid;
  grid-template-columns: 120px repeat(6, 1fr) 100px;
  border-bottom: 0;
}

.site-nav a {
  display: grid;
  min-width: 0;
  place-items: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--ink);
  font-size: clamp(0.82rem, 1.05vw, 1.08rem);
}

.site-nav a:first-child {
  border-left: 0;
}

.site-nav a:nth-child(2) {
  color: var(--red);
}

.nav-icon,
.cat-outline {
  color: var(--red);
  font-weight: 700;
}

.cat-outline .cat-icon {
  width: 38px;
  height: 32px;
}

.cat-outline .cat-icon-filled {
  width: 38px;
  height: 32px;
}

.ticker {
  overflow: hidden;
  color: var(--cream-soft);
  background: var(--red);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 28s linear infinite;
}

.ticker span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  font-size: 0.86rem;
  white-space: nowrap;
}

@keyframes cup-bob {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -8px, 0);
  }
}

@keyframes cup-jitter {
  0%,
  100% {
    filter: none;
    margin-left: 0;
  }

  50% {
    filter: contrast(1.04);
    margin-left: 2px;
  }
}

@keyframes steam-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 106px, 0) scale(1);
  }

  15% {
    opacity: 0.7;
  }

  100% {
    opacity: 0;
    transform: translate3d(14px, -82px, 0) scale(0.66);
  }
}

@keyframes link-glitch {
  0% {
    transform: translate(0, 0);
  }

  45% {
    transform: translate(1px, -1px);
  }

  70% {
    transform: translate(-1px, 1px);
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes star-flicker {
  0%,
  100% {
    opacity: 0.18;
  }

  25% {
    opacity: 0.82;
  }

  50% {
    opacity: 0.38;
  }

  75% {
    opacity: 0.68;
  }
}

@keyframes equalizer-wave {
  0% {
    height: 5px;
  }

  25% {
    height: 13px;
  }

  50% {
    height: 8px;
  }

  75% {
    height: 11px;
  }

  100% {
    height: 6px;
  }
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1120px) {
  .site-shell {
    height: auto;
    grid-template-rows: 64px auto auto 32px;
    overflow: visible;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.95fr);
    row-gap: 28px;
  }

  .hero-grid::before,
  .hero-grid::after {
    display: none;
  }

  .copy-panel {
    grid-column: 1 / 3;
    align-items: flex-start;
  }

  h1 {
    font-size: clamp(4.2rem, 11vw, 7rem);
  }

  .object-stage {
    grid-column: 1;
  }

  .right-panel {
    grid-column: 2;
    align-items: flex-end;
  }

  .cup-gif {
    width: min(44vw, 390px);
  }

  .site-nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-icon,
  .cat-outline {
    display: none !important;
  }

  .site-nav a {
    min-height: 70px;
  }
}

@media (max-width: 700px) {
  body {
    background: var(--cream);
  }

  .site-shell {
    height: auto;
    width: 100vw;
    max-width: 100vw;
    min-height: 100vh;
    grid-template-rows: auto auto auto 32px;
    border-width: 1px;
    overflow: visible;
  }

  .top-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 126px;
    width: 100vw;
    max-width: 100vw;
    min-height: 58px;
    padding: 12px 16px;
    align-items: center;
    gap: 10px;
    font-size: 0.62rem;
  }

  .brand-system {
    min-width: 0;
    overflow: hidden;
  }

  .brand-system span:last-child {
    overflow: hidden;
    text-overflow: clip;
  }

  .brand-system,
  .sound-toggle {
    gap: 7px;
  }

  .sound-toggle::after {
    display: none;
  }

  .sound-toggle {
    position: absolute;
    left: 250px;
    width: 126px;
    min-width: 0;
    max-width: 126px;
    z-index: 10;
    transform: none;
    gap: 5px;
    padding: 0;
    justify-self: end;
    justify-content: flex-end;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 30px 16px 24px;
  }

  h1 {
    font-size: clamp(2.75rem, 14.6vw, 4.7rem);
  }

  .subheading,
  .description,
  .product-specs {
    width: min(100%, 360px);
  }

  .product-specs div {
    grid-template-columns: 150px 1fr;
  }

  .cup-button {
    width: min(100%, 310px);
    min-width: 0;
  }

  .object-stage {
    min-height: 560px;
    overflow: hidden;
  }

  .object-stage::before {
    width: 96vw;
  }

  .cup-gif {
    width: min(82vw, 340px);
    min-width: 260px;
    max-height: 62vh;
  }

  .vertical-lock {
    display: none;
  }

  .right-panel {
    align-items: stretch;
    gap: 22px;
  }

  .readout-panel,
  .warning-card,
  .origin-stamp {
    width: 100%;
  }

  .code-marks {
    justify-content: center;
  }

  .site-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-nav a {
    min-height: 56px;
  }
}

@media (max-width: 360px) {
  .brand-system span:last-child {
    max-width: 132px;
    overflow: hidden;
    text-overflow: clip;
  }

  .sound-toggle {
    left: 214px;
    width: 112px;
    min-width: 0;
    max-width: 112px;
    font-size: 0.55rem;
  }
}
