:root {
  --bg: #ffffff;
  --ink: #1b1b1b;
  --muted: #666666;
  --line: #d8d8d8;
  --panel: #fbfbf8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(17px, 0.95vw, 22px);
  display: flex;
  flex-direction: column;
}

.identity-marquee {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  background: #ffffff;
  color: var(--ink);
  white-space: nowrap;
}

.identity-marquee-track {
  width: max-content;
  display: flex;
  align-items: center;
  gap: clamp(44px, 5vw, 92px);
  min-height: clamp(64px, 4.8vw, 92px);
  animation: identity-marquee 64s linear infinite;
  will-change: transform;
}

.identity-marquee:hover .identity-marquee-track {
  animation-play-state: paused;
}

.identity-marquee button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(0.9rem, 1.35vw, 1.35rem);
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 0;
}

.identity-marquee button:hover,
.identity-marquee button:focus-visible {
  text-decoration: underline;
  text-underline-offset: 6px;
}

@keyframes identity-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .identity-marquee-track { animation: none; }
}

.page {
  flex: 1;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 12px;
  padding: 1.5vh 2vw 10px;
}

.main-carousel,
.slide-thumbs,
.iv-grid {
  width: 74vw;
}

.main-slides {
  width: 100%;
  min-width: 0;
}

.main-slide {
  width: 100%;
  height: min(72vh, 920px);
  min-height: 460px;
  overflow: hidden;
}

.main-slide.active { display: grid; }
.main-slide[hidden] { display: none; }

.chat-window {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: clamp(16px, 1.15vw, 26px);
  display: grid;
  gap: clamp(10px, 0.75vw, 18px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.chat-header {
  justify-self: start;
  width: 100%;
  text-align: left !important;
}

.chat-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.chat-header h1 {
  margin: 0;
  text-align: left;
  font-size: clamp(2.2rem, 5.8vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.chat-header p {
  margin: 8px 0 0;
  max-width: 680px;
  text-align: left;
  color: var(--muted);
  font-size: 1rem;
}

.device-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.sun-mark {
  width: 28px;
  height: 28px;
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
}

.battery-bars {
  display: inline-grid;
  grid-template-columns: repeat(4, 8px);
  gap: 3px;
  align-items: end;
}

.battery-bars i {
  height: 18px;
  border: 2px solid var(--ink);
  background: var(--ink);
}

.eyebrow,
.field {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

input, textarea {
  font: inherit;
  font-size: clamp(1.35rem, 1.35vw, 2rem);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.channel-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.channel-button {
  min-height: clamp(56px, 3.8vw, 76px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: clamp(0.9rem, 1.35vw, 1.35rem);
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.channel-button.active {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

textarea { resize: vertical; }

.messages-shell {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.messages {
  position: absolute;
  inset: 0 18px 0 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -ms-overflow-style: none;
  scrollbar-width: none;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #ffffff;
  padding: clamp(12px, 0.9vw, 20px);
}

.messages-scrollbar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 18px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #eeeeee;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.messages-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 3px;
  right: 3px;
  min-height: 34px;
  border-radius: 999px;
  background: var(--ink);
  cursor: grab;
}

.messages-scrollbar-thumb.dragging {
  cursor: grabbing;
}

.messages::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.msg {
  white-space: pre-wrap;
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 1.35vw, 2rem);
  line-height: 1.45;
}

.msg:last-child { margin-bottom: 0; }

.msg.user { font-weight: 600; }

.chat-form {
  display: grid;
  gap: 10px;
}

.photo-panel {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: clamp(16px, 1.15vw, 26px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(14px, 1vw, 24px);
  overflow: auto;
}

.photo-panel figure {
  margin: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
}

.pix-open {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  padding: 0;
}

.pix-open:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.photo-panel img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.photo-panel figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.3;
}

.pix-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 14px;
  padding: clamp(16px, 3vw, 42px);
  background: rgba(0, 0, 0, 0.88);
}

.pix-lightbox[hidden] { display: none; }

.pix-lightbox img {
  max-width: min(100%, 1500px);
  max-height: 82vh;
  min-height: 0;
  object-fit: contain;
  align-self: center;
  border-radius: 8px;
  background: #111111;
}

.pix-lightbox-close {
  justify-self: end;
  border: 1px solid #ffffff;
  border-radius: 999px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 8px 14px;
  text-transform: uppercase;
}

.pix-lightbox-caption {
  margin: 0;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.3;
  text-align: center;
}

.lightbox-open { overflow: hidden; }

.reel-carousel {
  width: 100%;
  height: 100%;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.reel-slides {
  display: flex;
  height: 100%;
  gap: 14px;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  padding: 0 0 10px;
  min-width: 0;
}

.reel-slide {
  flex: 0 0 min(540px, 88vw);
  justify-items: center;
  align-content: center;
  gap: 10px;
  min-height: calc(min(84vh, 1080px) - 24px);
  max-height: 100%;
  display: grid;
  scroll-snap-align: center;
}

.instagram-media {
  min-width: 280px !important;
  max-width: 540px !important;
  width: 100% !important;
}

.reel-link {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.slide-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.slide-thumb {
  height: clamp(78px, 5.2vw, 106px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}

.slide-thumb.active {
  border-color: #111111;
  box-shadow: inset 0 0 0 2px #111111;
}

.thumb-chat,
.thumb-pix,
.thumb-reel {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-align: center;
  font-size: clamp(0.9rem, 1.35vw, 1.35rem);
  line-height: 1.1;
  padding: 0 8px;
}

.thumb-chat,
.thumb-pix { background: var(--panel); }
.thumb-reel { background: var(--panel); }

.slide-thumb:hover .thumb-chat,
.slide-thumb:hover .thumb-pix,
.slide-thumb:hover .thumb-reel,
.slide-thumb:focus-visible .thumb-chat,
.slide-thumb:focus-visible .thumb-pix,
.slide-thumb:focus-visible .thumb-reel {
  background: #111111;
  color: #ffffff;
}

.iv-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(22px, 2.5vw, 42px) clamp(16px, 2vw, 32px);
  margin-top: clamp(42px, 7vw, 96px);
}

.iv-card {
  min-width: 0;
  background: var(--bg);
}

.curve-frame {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.curve-frame svg {
  width: 92%;
  height: 92%;
  overflow: visible;
}

.curve-point {
  fill: var(--ink);
}

.curve-label {
  position: absolute;
  left: 0;
  bottom: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.iv-info {
  display: grid;
  gap: 8px;
  padding: 12px 0 0;
}

.buy-button {
  width: 100%;
  border: 2px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  padding: 7px 12px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.buy-button:hover,
.buy-button:focus-visible {
  background: var(--ink);
  color: var(--bg);
}

.song-title {
  margin: 0;
  font-size: clamp(1rem, 1.2vw, 1.35rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.light-source,
.fingerprint {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(0.72rem, 0.9vw, 0.86rem);
  line-height: 1.35;
}

.fingerprint span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer {
  text-align: center;
  font-size: calc(0.85rem + 5px);
  color: #777777;
  padding: 8px 0 10px;
}

@media (max-width: 1100px) {
  .iv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .page { padding: 1.5vh 10px 10px; }
  .main-carousel,
  .slide-thumbs,
  .iv-grid { width: min(92vw, 100%); }
  .main-slide,
  .chat-window,
  .photo-panel,
  .reel-carousel {
    height: min(82vh, 760px);
    min-height: 0;
  }
  .chat-window,
  .photo-panel { padding: 12px; }
  .channel-options { grid-template-columns: 1fr; }
  .messages { min-height: 0; }
  input, textarea,
  .msg { font-size: 1rem; }
  .channel-button { font-size: clamp(0.78rem, 2.4vw, 0.95rem); }
  .photo-panel { grid-template-columns: 1fr; overflow: auto; }
  .photo-panel img { min-height: 220px; max-height: 340px; }
  .reel-slide { min-height: calc(min(82vh, 760px) - 24px); }
  .slide-thumb { height: 64px; }
  .iv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
}

@media (max-width: 420px) {
  .page { padding: 1.5vh 6px 10px; }
  .main-carousel,
  .slide-thumbs,
  .iv-grid { width: min(94vw, 100%); }
  .chat-header h1 { font-size: clamp(1.5rem, 11vw, 2.4rem); }
  .slide-thumbs { gap: 6px; }
  .slide-thumb { height: 58px; }
  .iv-grid { grid-template-columns: 1fr; }
}
