/* ===================================================
   Nick Small — personal site stylesheet
   
   Edit the --variables below to tweak colors globally.
   Everything else builds on top of them.
   =================================================== */

:root {
  --bg: #0A0A0A;
  --text: #F0EFE8;
  --cyan: #1EC4F0;
  --green: #3DE065;
  --yellow: #FDC700;
  --red: #DC2E2E;
  --muted: rgba(240, 239, 232, 0.55);
  --border-thick: 2px;
  --shadow-offset: 6px;

  --font-display: 'Archivo Black', 'Impact', 'Arial Black', sans-serif;
  --font-hand: 'Caveat', 'Comic Sans MS', cursive;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: var(--font-mono);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ===== Hazard tape strip ===== */
.hazard-tape {
  height: 18px;
  background: repeating-linear-gradient(
    -45deg,
    var(--bg) 0 14px,
    var(--yellow) 14px 28px
  );
  border-bottom: 2px solid var(--text);
}

/* ===== Canvas (max-width wrapper) ===== */
.canvas {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 48px 56px;
}

/* ===== Meta line ===== */
.meta-line {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cyan);
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 16px;
}

.caret {
  display: inline-block;
  animation: caret 1s step-end infinite;
}

@keyframes caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ===== Hero ===== */
.hero {
  font-family: var(--font-display);
  font-size: clamp(42px, 13vw, 150px);
  text-align: center;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 12px 0 32px;
  user-select: none;
}

.letter {
  display: inline-block;
  color: var(--text);
  transform: rotate(var(--rot)) translateY(var(--y));
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  animation: tumbleIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.letter-space {
  display: inline-block;
  width: 0.5em;
}

.letter.accent-cyan {
  color: var(--cyan);
  cursor: pointer;
}

.letter.accent-green {
  color: var(--green);
  cursor: pointer;
}

.letter.accent-cyan:hover,
.letter.accent-green:hover {
  transform: rotate(0deg) translateY(-8px) scale(1.15);
}

/* Staggered tumble-in entrance */
.hero .letter:nth-child(1)  { animation-delay: 0.05s; }
.hero .letter:nth-child(2)  { animation-delay: 0.15s; }
.hero .letter:nth-child(3)  { animation-delay: 0.25s; }
.hero .letter:nth-child(4)  { animation-delay: 0.35s; }
.hero .letter:nth-child(6)  { animation-delay: 0.45s; }
.hero .letter:nth-child(7)  { animation-delay: 0.55s; }
.hero .letter:nth-child(8)  { animation-delay: 0.65s; }
.hero .letter:nth-child(9)  { animation-delay: 0.75s; }
.hero .letter:nth-child(10) { animation-delay: 0.85s; }

@keyframes tumbleIn {
  0%   { transform: translateY(-220px) rotate(180deg); opacity: 0; }
  70%  { opacity: 1; }
  100% { transform: rotate(var(--rot)) translateY(var(--y)); opacity: 1; }
}

/* ===== Divider + stamp ===== */
.divider {
  border-top: var(--border-thick) solid var(--text);
  margin: 32px 0 48px;
  position: relative;
}

.stamp {
  position: absolute;
  left: 50%;
  top: -14px;
  transform: translateX(-50%) rotate(-4deg);
  background: var(--yellow);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border: var(--border-thick) solid var(--text);
  letter-spacing: 1.5px;
}

/* ===== Section scaffolding ===== */
.section {
  margin-bottom: 72px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
}

/* ===== Sticky note base ===== */
.sticky {
  display: block;
  font-family: var(--font-hand);
  border: var(--border-thick) solid var(--text);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--text);
  color: var(--bg);
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.sticky-cyan  { background: var(--cyan); }
.sticky-green { background: var(--green); }
.sticky-yellow { background: var(--yellow); }
.sticky-white { background: var(--text); }

/* ===== Now Building section ===== */
.now-building {
  display: flex;
  gap: 36px;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  flex-wrap: wrap;
}

.mascot {
  width: 130px;
  height: auto;
  color: var(--text);
  animation: peek 4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes peek {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-6px) rotate(2deg); }
}

.sticky-feature {
  width: 360px;
  min-height: 170px;
  padding: 24px 28px;
  transform: rotate(-2deg);
}

.sticky-feature:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.03);
}

.sperm-icon {
  width: 1.1em;
  height: 1.1em;
  vertical-align: middle;
  margin-right: 8px;
  display: inline-block;
}

.sticky-title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.05;
}

.sticky-sub {
  font-size: 18px;
  margin-top: 8px;
  opacity: 0.75;
}

.sticky-link {
  font-size: 13px;
  margin-top: 22px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-decoration: underline;
  letter-spacing: 0.5px;
}

/* ===== Archive ===== */
.archive {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px 40px;
  padding: 24px 0;
}

.photo-sticky {
  width: 140px;
  padding: 10px 10px 14px;
  border: var(--border-thick) solid var(--text);
  box-shadow: 5px 5px 0 var(--text);
  background: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transform: rotate(var(--rot));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.photo-img {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  border: 1.5px solid var(--bg);
  background: #4A4A42;
}

.photo-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-sticky .photo-label {
  font-family: var(--font-hand);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-top: 6px;
  color: var(--bg);
  line-height: 1;
}

/* Five individual wobble rhythms cycled via nth-child */
.photo-sticky:nth-child(5n+1) { animation: wobA 3.6s ease-in-out infinite; }
.photo-sticky:nth-child(5n+2) { animation: wobB 4.2s ease-in-out infinite; }
.photo-sticky:nth-child(5n+3) { animation: wobC 3.8s ease-in-out infinite; }
.photo-sticky:nth-child(5n+4) { animation: wobD 4.5s ease-in-out infinite; }
.photo-sticky:nth-child(5n)   { animation: wobE 3.4s ease-in-out infinite; }

@keyframes wobA {
  0%, 100% { transform: rotate(var(--rot)) translateY(0); }
  50%      { transform: rotate(calc(var(--rot) + 2deg)) translateY(-4px); }
}
@keyframes wobB {
  0%, 100% { transform: rotate(var(--rot)) translateY(0); }
  50%      { transform: rotate(calc(var(--rot) + 2deg)) translateY(-3px); }
}
@keyframes wobC {
  0%, 100% { transform: rotate(var(--rot)) translateY(0); }
  50%      { transform: rotate(calc(var(--rot) - 2deg)) translateY(-5px); }
}
@keyframes wobD {
  0%, 100% { transform: rotate(var(--rot)) translateY(0); }
  50%      { transform: rotate(calc(var(--rot) - 2deg)) translateY(-3px); }
}
@keyframes wobE {
  0%, 100% { transform: rotate(var(--rot)) translateY(0); }
  50%      { transform: rotate(calc(var(--rot) + 3deg)) translateY(-4px); }
}

.photo-sticky:hover {
  animation-play-state: paused;
  transform: rotate(0deg) translateY(-10px) scale(1.1);
  z-index: 10;
  position: relative;
}

.photo-sticky,
.photo-sticky:focus,
.photo-sticky:focus-visible,
.photo-img img,
.photo-img img:focus,
.photo-img img:focus-visible,
.photo-img img:active {
  outline: none !important;
}

.photo-sticky[data-age="17"] .photo-label {
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.photo-label.glow-highlight {
  color: var(--bg);
  text-shadow: 0 0 8px rgba(253, 199, 0, 0.95), 0 0 18px rgba(253, 199, 0, 0.8), 0 0 34px rgba(253, 199, 0, 0.55), 0 0 56px rgba(253, 199, 0, 0.28);
  animation: glowPulse 1.8s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  from {
    text-shadow: 0 0 10px rgba(253, 199, 0, 0.75), 0 0 22px rgba(253, 199, 0, 0.55), 0 0 40px rgba(253, 199, 0, 0.32);
  }
  to {
    text-shadow: 0 0 20px rgba(253, 199, 0, 1), 0 0 36px rgba(253, 199, 0, 0.75), 0 0 60px rgba(253, 199, 0, 0.45);
  }
}

.archive-hint {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 20px;
  letter-spacing: 0.5px;
}

/* ===== Footer ===== */
.footer {
  border-top: var(--border-thick) solid var(--text);
  padding-top: 20px;
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.socials {
  display: flex;
  gap: 22px;
}

.socials a {
  color: var(--cyan);
  text-decoration: underline;
  transition: color 0.2s;
}

.socials a:hover {
  color: var(--green);
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 32px;
}

.lightbox.open {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 70vh;
  border: 3px solid var(--text);
  box-shadow: none;
  display: block;
  margin: 0 auto;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-content img:focus,
.lightbox-content img:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox-caption {
  font-family: var(--font-hand);
  font-size: 28px;
  color: var(--text);
  margin-top: 20px;
  font-weight: 700;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: transparent;
  border: 2px solid var(--text);
  color: var(--text);
  font-size: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  line-height: 1;
  padding: 0;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: var(--cyan);
  color: var(--bg);
  border-color: var(--cyan);
  transform: scale(1.08);
}

.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev  { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 24px; top: 50%; transform: translateY(-50%); }

.lightbox-prev:hover { transform: translateY(-50%) scale(1.08); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.08); }

/* ===== Rattle easter egg (triggered by clicking accent letters) ===== */
@keyframes rattle {
  0%, 100% { transform: translate(0); }
  10% { transform: translate(-3px, 1px); }
  20% { transform: translate(3px, -1px); }
  30% { transform: translate(-2px, 2px); }
  40% { transform: translate(2px, -2px); }
  50% { transform: translate(-3px, -1px); }
  60% { transform: translate(3px, 1px); }
  70% { transform: translate(-1px, -2px); }
  80% { transform: translate(1px, 2px); }
  90% { transform: translate(-1px, 0); }
}

body.rattle {
  animation: rattle 0.6s ease-in-out;
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .canvas {
    padding: 20px 18px 36px;
  }
  .meta-line {
    font-size: 10px;
    letter-spacing: 0.5px;
  }
  .hero {
    font-size: clamp(38px, 14vw, 120px);
  }
  .section-label {
    font-size: 11px;
  }
  .now-building {
    gap: 20px;
  }
  .mascot {
    width: 100px;
  }
  .sticky-feature {
    width: 100%;
    max-width: 340px;
    padding: 20px 22px;
  }
  .sticky-title { font-size: 28px; }
  .sticky-sub   { font-size: 16px; }
  .photo-sticky {
    width: 118px;
  }
  .photo-img {
    height: 118px;
  }
  .archive {
    gap: 24px 20px;
  }
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .lightbox-nav { width: 42px; height: 42px; font-size: 22px; }
  .lightbox-close { width: 42px; height: 42px; font-size: 22px; top: 16px; right: 16px; }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
}

/* ===== Respect reduced motion preference ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
