/* ============================================================
   ANDi.dog — main screen
   ============================================================ */

:root {
  --bg: #141414;
  --pink: #f778c4;
  --border: #626262;
  --white: #ffffff;
  --font: 'Roboto Mono', ui-monospace, 'Cascadia Mono', monospace;
  --page-pad: 20px;
  --footer-h: 52px;
  --mascot-inset: 36px;
  --mascot-width: clamp(620px, 82vw, 980px);
  --title-top: 21.2vh;
  --title-width: min(570px, 80vw);
  --title-size: clamp(26px, 3.06vw, 44px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font);
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

body::-webkit-scrollbar {
  width: 6px;
}
body::-webkit-scrollbar-track {
  background: var(--bg);
}
body::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}
body::-webkit-scrollbar-thumb:hover {
  background: var(--pink);
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--pink);
  color: var(--bg);
}

.dimmable {
  transition: opacity 0.5s ease;
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
  position: fixed;
  top: var(--page-pad);
  left: var(--page-pad);
  right: var(--page-pad);
  z-index: 40;
  display: grid;
  grid-template-columns: 309px 265px 1fr 340px;
  align-items: start;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.brand-name {
  font-weight: 500;
}
.brand-sub {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 4px;
}

.contacts {
  display: flex;
  flex-direction: column;
}
.contacts-label {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 4px;
}
.contacts-link {
  transition: color 0.25s ease;
  width: fit-content;
}
.contacts-link:hover {
  color: var(--pink);
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
}

.bg-logo {
  position: absolute;
  left: 50%;
  top: 60%;
  width: max(101vw, 1000px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  will-change: transform;
}
.bg-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.mascot {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--mascot-width);
  max-width: none;
  pointer-events: none;
  will-change: transform, filter;
  z-index: 3;
}
.mascot img,
.mascot svg {
  display: block;
  width: 100%;
  height: auto;
}

.mascot.glitch {
  animation: glitch 0.36s steps(2, jump-none) both;
}
@keyframes glitch {
  0% {
    filter: none;
    clip-path: none;
  }
  15% {
    filter: drop-shadow(-6px 0 rgba(247, 120, 196, 0.7));
    clip-path: none;
  }
  30% {
    filter: drop-shadow(5px 0 rgba(97, 154, 234, 0.6));
    clip-path: inset(12% 0 31% 0);
  }
  45% {
    filter: drop-shadow(-4px 0 rgba(247, 120, 196, 0.8));
    clip-path: inset(52% 0 8% 0);
  }
  60% {
    filter: drop-shadow(6px 0 rgba(255, 97, 27, 0.5));
    clip-path: none;
  }
  100% {
    filter: none;
    clip-path: none;
  }
}

.hero-title {
  position: absolute;
  left: var(--page-pad);
  top: var(--title-top);
  width: var(--title-width);
  max-width: calc(100% - var(--page-pad) * 2);
  font-size: var(--title-size);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.18;
  z-index: 5;
}

.t-word {
  display: inline-block;
}
.t-underscore {
  display: inline-block;
  color: var(--pink);
  animation: caret-blink 1.1s steps(1) infinite;
}

@keyframes caret-blink {
  0%,
  55% {
    opacity: 1;
  }
  56%,
  100% {
    opacity: 0;
  }
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 var(--page-pad) max(var(--page-pad), env(safe-area-inset-bottom));
  font-size: 12px;
  letter-spacing: 0.02em;
  z-index: 40;
  pointer-events: none;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 8px rgba(247, 120, 196, 0.9);
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.78);
    opacity: 0.6;
  }
}

.live-label {
  font-weight: 500;
  text-transform: uppercase;
  opacity: 0.9;
}
.ticker {
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-timer {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  opacity: 0.9;
}
.timer-square {
  width: 12px;
  height: 12px;
  border-radius: 1px;
  background: var(--pink);
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-transform: uppercase;
}
.footer-status .status-label {
  font-weight: 500;
  opacity: 0.9;
}
.footer-status .status-label em {
  font-style: normal;
  color: var(--pink);
}
.footer-status .status-text {
  color: rgba(255, 255, 255, 0.7);
}

.ibeam {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.85);
  animation: caret-blink 1.3s steps(1) infinite;
}

/* ============================================================
   Overlays
   ============================================================ */

.page-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}
@keyframes grain-shift {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-2%, 3%);
  }
  50% {
    transform: translate(3%, -2%);
  }
  75% {
    transform: translate(-3%, -3%);
  }
  100% {
    transform: translate(2%, 2%);
  }
}

/* ============================================================
   Mobile landscape — rotate prompt
   ============================================================ */

body.rotate-lock {
  overflow: hidden;
}

.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.rotate-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.rotate-overlay__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 320px;
}

.rotate-device {
  width: 88px;
  height: 88px;
  color: var(--white);
  transform-origin: center center;
}

.rotate-device svg {
  display: block;
  width: 100%;
  height: 100%;
}

.rotate-title {
  font-size: clamp(16px, 4.5vw, 20px);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
}

.rotate-underscore {
  color: var(--pink);
  animation: caret-blink 1.1s steps(1) infinite;
}

.rotate-hint {
  font-size: 12px;
  letter-spacing: 0.03em;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .rotate-device {
    transform: rotate(0deg) !important;
  }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1180px) {
  :root {
    --title-top: 17vh;
    --title-width: min(480px, 72vw);
    --title-size: clamp(24px, 3.4vw, 38px);
    --mascot-width: clamp(520px, 92vw, 820px);
    --mascot-inset: 28px;
  }

  .bg-logo {
    width: 100vw;
    top: 45%;
  }

  .footer-left {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 1180px) and (max-height: 820px) {
  :root {
    --title-top: 13vh;
    --mascot-width: clamp(460px, 68vw, 700px);
    --mascot-inset: 18px;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  :root {
    --title-top: 112px;
    --title-width: calc(100% - var(--page-pad) * 2);
    --title-size: clamp(22px, 5.2vw, 32px);
    --mascot-width: min(128vw, 680px);
    --mascot-inset: 16px;
    --footer-h: 72px;
  }

  .site-header {
    flex-direction: column;
    gap: 10px;
    font-size: 12px;
    grid-template-columns: 1fr 1fr;
  }

  .brand-sub {
    margin-top: 2px;
  }

  .contacts-label {
    margin-bottom: 0;
  }

  .hero {
    min-height: 0;
  }

  .bg-logo {
    width: 100vw;
    top: 35%;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .footer-left,
  .footer-right {
    width: 100%;
  }

  .footer-right {
    align-self: flex-end;
  }

  .ticker {
    display: none;
  }
}

@media (max-width: 480px) {
  :root {
    --page-pad: 16px;
    --title-top: 96px;
    --title-size: clamp(18px, 5.8vw, 24px);
    --mascot-width: min(100vw, 560px);
    --mascot-inset: 8px;
    --footer-h: 80px;
  }

  .footer-left .ibeam,
  .footer-right .ibeam {
    display: none;
  }

  .live-label {
    font-size: 11px;
  }

  .footer-timer {
    gap: 8px;
    font-size: 11px;
  }
}
