/* ============================================
   DOT LINE PLAY — Global Styles
   ============================================ */

:root {
  /* Palette */
  --bg: #000000;
  --text: #111111;
  --text-dim: #999999;
  --border: rgba(0, 0, 0, 0.1);

  /* Product colors */
  --color-letterwalk: #ff6b4a;
  --color-brushoff: #4ecdc4;

  /* Typography */
  --font-sans: 'Geist Sans', 'Geist', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-lg: 1.5rem;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.4;
  cursor: none;
  overflow: hidden;
  user-select: none;
}

* {
  cursor: none !important;
}

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

::selection {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
}

/* ============================================
   Layout
   ============================================ */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.site {
  position: relative;
  z-index: 1;
  max-width: 320px;
  width: 100%;
  padding: var(--space-lg);
  background: #ffffff;
  border-radius: 16px;
}

/* ============================================
   Intro Animation
   ============================================ */
.site.intro-shrink {
  clip-path: circle(72px at 50% 50%);
  animation: intro-shrink 800ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.site.intro-morph {
  animation: intro-morph 750ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.site.intro-done {
  clip-path: none;
}

@keyframes intro-shrink {
  0%   { clip-path: circle(72px at 50% 50%); transform: scale(1); }
  100% { clip-path: circle(8px at 50% 50%); transform: scale(0.6); }
}

@keyframes intro-morph {
  0%   { clip-path: circle(8px at 50% 50%); transform: scale(0.6); }
  100% { clip-path: circle(500px at 50% 50%); transform: scale(1); }
}

.site-content {
  opacity: 0;
  filter: blur(8px);
}

.site.intro-morph .site-content {
  opacity: 1;
  filter: blur(0);
  transition: opacity 800ms cubic-bezier(0.215, 0.61, 0.355, 1),
              filter 800ms cubic-bezier(0.215, 0.61, 0.355, 1);
}

.site.intro-done .site-content {
  opacity: 1;
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .site.intro-shrink,
  .site.intro-morph {
    animation: none;
    clip-path: none;
  }

  .site-content {
    opacity: 1;
    filter: none;
    transition: none;
  }

  .spark {
    display: none;
  }

  .cursor {
    display: none;
  }

  body {
    cursor: auto !important;
  }
}

/* ============================================
   Header
   ============================================ */
.header {
  margin-bottom: var(--space-sm);
}

.brand-name {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 3.5vw, 1.3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-xs);
  color: var(--text);
}

.tagline {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 400;
}

/* ============================================
   Products
   ============================================ */
.product-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-sm);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.product-item:hover {
  background-color: #f5f5f5;
}

.product-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.product-shape {
  flex-shrink: 0;
}

.shape--circle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--shape-color);
}

.shape--square {
  width: 8px;
  height: 8px;
  background: var(--shape-color);
}

.product-name {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1;
}

.product-description {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 400;
  line-height: 1.4;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding-top: var(--space-sm);
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 400;
  line-height: 1.5;
}

.footer-link {
  color: var(--text-dim);
  font-weight: 600;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 480px) {
  .brand-name {
    font-size: 1.1rem;
  }

}

/* ============================================
   Drawing Canvas
   ============================================ */
.draw-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   Custom Cursor
   ============================================ */
.cursor {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.15s ease, height 0.15s ease, border-radius 0.15s ease;
  will-change: left, top;
  background: #fff;
  mix-blend-mode: difference;
}

.cursor--square {
  width: 16px;
  height: 16px;
}

.cursor--line {
  width: 3px;
  height: 26px;
  border-radius: 1px;
}

.cursor--play {
  width: 0;
  height: 0;
  background: transparent;
  border-left: 16px solid #fff;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  transform: translate(-4px, -50%);
}

/* ============================================
   Click Sparks
   ============================================ */
.spark {
  position: absolute;
  width: 10px;
  height: 4px;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: 1050;
  animation: spark-fly 400ms ease-out both;
  transform-origin: center center;
}

@keyframes spark-fly {
  0% {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(6px);
    opacity: 1;
  }
  65% {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(22px) scale(0.5, 0.75);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(28px) scale(0, 0);
    opacity: 0;
  }
}

/* ============================================
   Intro Burst Sparks
   ============================================ */
.burst-spark {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  animation: burst-fly 600ms ease-out both;
  transform-origin: center center;
}

@keyframes burst-fly {
  0% {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(8px);
    opacity: 1;
  }
  60% {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--dist)) scale(0.7, 0.8);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--dist)) scale(0, 0);
    opacity: 0;
  }
}

/* Hide custom cursor on touch devices */
@media (pointer: coarse) {
  .cursor {
    display: none;
  }
  body {
    cursor: auto !important;
  }
}
