/* =========================================================
   brigger.dk — a birthday gift
   ========================================================= */

:root {
  --bg-0: #0b0b1f;
  --bg-1: #1b1340;
  --bg-2: #3b1b6a;
  --ink: #f6f3ea;
  --ink-dim: #cfc9d9;
  --accent: #ffd166;          /* ribbon gold */
  --accent-2: #ef476f;        /* ribbon pink */
  --accent-3: #06d6a0;        /* confetti green */
  --accent-4: #4cc9f0;        /* confetti blue */
  --box: #ef476f;             /* the gift box itself */
  --box-dark: #b8304f;
  --paper: #fff8ec;
  --radius: 18px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 900; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0 0 1rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.35rem; }
p  { line-height: 1.6; }
a  { color: var(--accent); }

/* =========================================================
   SCENE 1 — Gift box
   ========================================================= */
#gift-scene {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(1200px 700px at 50% 40%, rgba(99, 58, 168, 0.55), transparent 60%),
    radial-gradient(900px 600px at 20% 90%, rgba(239, 71, 111, 0.25), transparent 60%),
    radial-gradient(900px 600px at 80% 10%, rgba(76, 201, 240, 0.22), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 60%, #140a30);
  z-index: 100;
  overflow: hidden;
  transition: opacity 700ms ease, transform 700ms ease;
}
#gift-scene.done { opacity: 0; pointer-events: none; transform: scale(1.04); }

.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent),
    radial-gradient(1px 1px at 30% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 70% 40%, #fff, transparent),
    radial-gradient(1px 1px at 85% 80%, #fff, transparent),
    radial-gradient(1px 1px at 55% 15%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 42% 50%, #fff, transparent),
    radial-gradient(1px 1px at 92% 33%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 15% 55%, #fff, transparent);
  opacity: 0.55;
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 0.75; } }

.gift-stage {
  position: relative;
  display: grid; place-items: center;
  gap: 1.5rem;
  perspective: 1200px;
}

/* Name tag */
.tag {
  position: absolute;
  top: -180px;
  left: 55%;
  transform: rotate(-8deg);
  background: var(--paper);
  color: #3a2b10;
  padding: 0.6rem 1.1rem 0.7rem;
  border-radius: 6px;
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  display: grid;
  line-height: 1.2;
}
.tag::before {
  content: "";
  position: absolute;
  top: -34px; left: 50%;
  width: 2px; height: 34px;
  background: var(--accent);
}
.tag strong { font-weight: 700; }

/* The box */
.gift-box {
  position: relative;
  width: 260px;
  height: 240px;
  transform-style: preserve-3d;
  cursor: pointer;
  animation: float 4s ease-in-out infinite;
}
.gift-box:focus-visible { outline: 3px dashed var(--accent); outline-offset: 14px; border-radius: 8px; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.box-body {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 220px; height: 170px;
  background: linear-gradient(160deg, var(--box) 0%, var(--box-dark) 100%);
  border-radius: 8px;
  box-shadow: var(--shadow), inset 0 -20px 30px rgba(0,0,0,0.25);
}
.box-lid {
  position: absolute;
  top: 40px; left: 50%;
  transform: translateX(-50%);
  width: 240px; height: 44px;
  background: linear-gradient(160deg, var(--box) 0%, var(--box-dark) 100%);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35), inset 0 -6px 10px rgba(0,0,0,0.25);
  transform-origin: 50% 100%;
  transition: transform 900ms cubic-bezier(.2,.8,.2,1.2), opacity 900ms ease;
  z-index: 3;
}

/* Ribbons */
.box-body .ribbon-v {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 26px;
  transform: translateX(-50%);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.1);
}
.box-body .ribbon-h {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 26px;
  transform: translateY(-50%);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.1);
}
.box-lid .ribbon-h {
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  width: 26px; height: 100%;
  background: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.1);
}

/* Bow on top of lid */
.bow {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 100px; height: 50px;
  z-index: 4;
  transition: transform 900ms cubic-bezier(.2,.8,.2,1.2), opacity 500ms ease;
}
.bow-left, .bow-right {
  position: absolute;
  top: 0;
  width: 46px; height: 46px;
  background: var(--accent);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: inset -4px -6px 10px rgba(0,0,0,0.2);
}
.bow-left  { left: -4px;  transform: rotate(-20deg) scaleX(0.85); }
.bow-right { right: -4px; transform: rotate(20deg)  scaleX(0.85); }
.bow-knot {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 22px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: inset -3px -4px 8px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.3);
}

.glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,209,102,0.35), transparent 60%);
  filter: blur(16px);
  z-index: -1;
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(0.95); opacity: 0.7; }
  50%      { transform: scale(1.08); opacity: 1; }
}

.unwrap-hint {
  font-family: "Caveat", cursive;
  font-size: 1.7rem;
  color: var(--ink);
  margin: 1rem 0 0;
  text-align: center;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* Opened state */
.gift-box.opened .box-lid {
  transform: translateX(-50%) translateY(-200px) rotate(-25deg);
  opacity: 0;
}
.gift-box.opened .bow {
  transform: translateX(-50%) translateY(-260px) rotate(30deg);
  opacity: 0;
}
.gift-box.opened { animation: none; transform: translateY(6px); }

/* Confetti canvas */
#confetti {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* =========================================================
   SCENE 2 — The site
   ========================================================= */
#site {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 800ms ease 200ms, transform 800ms ease 200ms;
}
#site.live {
  opacity: 1;
  transform: none;
}

/* Hero */
.hero {
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 4rem 1.25rem;
  background:
    radial-gradient(800px 500px at 50% 30%, rgba(239,71,111,0.22), transparent 60%),
    radial-gradient(900px 600px at 80% 80%, rgba(76,201,240,0.18), transparent 60%),
    linear-gradient(180deg, #140a30 0%, #1b1340 50%, #0b0b1f 100%);
  text-align: center;
  position: relative;
}
.hero-inner { max-width: 820px; }
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
  color: var(--accent);
  margin: 0 0 1rem;
}
.hero h1 {
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 1.02;
  margin: 0;
}
.hero h1 .wish {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 60%, var(--accent-4));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  min-width: 6ch;
}
.hero h1 .wish-comma { color: var(--ink); }
.hero h1 .name {
  font-style: italic;
  color: var(--ink);
}
.hero .sub {
  margin: 1.5rem auto 0;
  max-width: 540px;
  color: var(--ink-dim);
  font-size: 1.1rem;
}

.scroll-cue {
  display: inline-block;
  margin-top: 3rem;
  width: 24px; height: 40px;
  border: 2px solid var(--ink-dim);
  border-radius: 14px;
  position: relative;
}
.scroll-cue span {
  position: absolute;
  top: 6px; left: 50%;
  width: 3px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scroll 1.8s ease-in-out infinite;
}
@keyframes scroll {
  0%   { transform: translate(-50%, 0);   opacity: 1; }
  70%  { transform: translate(-50%, 14px); opacity: 0; }
  100% { transform: translate(-50%, 0);   opacity: 0; }
}

/* Generic section */
.section {
  padding: 6rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}
.section > h2 {
  text-align: center;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.section > p { text-align: center; color: var(--ink-dim); }

/* About cards */
.cards {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}
.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1.25rem 1.1rem 1.1rem;
  transition: transform 300ms ease, border-color 300ms ease, background 300ms ease;
  backdrop-filter: blur(6px);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,209,102,0.5);
  background: rgba(255,255,255,0.06);
}
.card .emoji { font-size: 1.8rem; display: block; margin-bottom: 0.5rem; }
.card p { color: var(--ink-dim); margin: 0; font-size: 0.95rem; }

/* Gallery */
.gallery-sub { margin-bottom: 2rem; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  cursor: zoom-in;
  transition: transform 300ms ease, box-shadow 300ms ease;
  border: 1px solid rgba(255,255,255,0.1);
}
.photo-grid img:hover { transform: scale(1.03); box-shadow: var(--shadow); }
.photo-placeholder {
  display: grid; place-items: center;
  padding: 3rem 1rem;
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: var(--radius);
  color: var(--ink-dim);
  text-align: center;
}
.photo-placeholder .ph-emoji { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.photo-placeholder.hidden { display: none; }

.gallery-cta {
  margin-top: 2.5rem;
  text-align: center;
}

/* Standalone gallery page */
.gallery-page {
  background: var(--bg-0);
  min-height: 100vh;
}
.gallery-page .gallery-header {
  padding: 3rem 1.25rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.gallery-page .back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 150ms ease;
}
.gallery-page .back-link:hover { color: var(--accent); }
.gallery-page h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0.25rem 0 0.5rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.gallery-page .sub {
  color: var(--ink-dim);
  margin: 0 0 1rem;
}
.gallery-page main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem 5rem;
}

/* Photo lightbox */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  display: none;
  place-items: center;
  z-index: 500;
  padding: 2rem;
  cursor: zoom-out;
}
#lightbox.visible { display: grid; }
#lightbox img {
  max-width: calc(100vw - 4rem);
  max-height: calc(100dvh - 4rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: default;
}
.lb-btn {
  position: fixed;
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  font-family: "Fraunces", serif;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease, border-color 150ms ease;
  display: grid; place-items: center;
  line-height: 1;
  padding: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lb-btn:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.5); }
.lb-prev, .lb-next {
  top: 50%;
  width: 56px; height: 56px;
  font-size: 2.4rem;
  transform: translateY(-50%);
}
.lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.08); }
.lb-prev { left: 1.5rem; }
.lb-next { right: 1.5rem; }
.lb-close {
  top: 1.25rem; right: 1.25rem;
  width: 44px; height: 44px;
  font-size: 1.8rem;
}
.lb-close:hover { transform: scale(1.08); }
@media (max-width: 600px) {
  .lb-prev, .lb-next { width: 44px; height: 44px; font-size: 1.9rem; }
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }
}

/* Timeline */
.timeline-sub { margin-bottom: 3rem; }
.timeline {
  list-style: none;
  margin: 0 auto; padding: 0;
  max-width: 720px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 80px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--accent-4));
  opacity: 0.5;
}
.timeline li {
  position: relative;
  padding: 1rem 0 1rem 120px;
}
.timeline .yr {
  position: absolute;
  left: 0; top: 1.1rem;
  width: 60px;
  font-family: "Fraunces", serif;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--accent);
  text-align: right;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 73px; top: 1.4rem;
  width: 16px; height: 16px;
  background: var(--bg-0);
  border: 3px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,209,102,0.15);
}
.timeline li p { color: var(--ink-dim); margin: 0; }

/* CV section */
.cv { text-align: center; }
.cv-actions {
  display: flex; gap: 1rem; flex-wrap: wrap;
  justify-content: center;
  margin-top: 2rem;
}
.btn {
  display: inline-block;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 150ms ease, box-shadow 200ms ease;
}
.btn.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #2a0b18;
  box-shadow: 0 10px 24px -8px rgba(239,71,111,0.6);
}
.btn.ghost {
  border: 2px solid var(--accent);
  color: var(--accent);
}
.btn:hover { transform: translateY(-2px); }

/* Note from Dad */
.note { max-width: 720px; }
.note-card {
  background: linear-gradient(160deg, #fff8ec, #fbe7c6);
  color: #2a1a06;
  border-radius: 22px;
  padding: 3rem 2rem;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0,0,0,0.04);
  font-family: "Caveat", cursive;
  font-size: 1.45rem;
  line-height: 1.5;
  transform: rotate(-0.5deg);
}
.note-card h2 {
  font-family: "Fraunces", serif;
  color: #8a1538;
  text-align: left;
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: 2rem;
  margin-bottom: 1rem;
}
.note-card em { font-style: italic; color: #8a1538; }
.note-card .sig {
  text-align: right;
  font-size: 1.8rem;
  margin-top: 1.5rem;
  color: #8a1538;
}

/* Footer */
.footer {
  text-align: center;
  padding: 3rem 1rem 4rem;
  color: var(--ink-dim);
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 4rem;
}
.footer .tiny { font-size: 0.75rem; opacity: 0.5; margin-top: 0.5rem; }

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Small screens */
@media (max-width: 600px) {
  .tag { top: -150px; left: 50%; transform: translateX(-20%) rotate(-8deg); }
  .gift-box { width: 220px; height: 210px; }
  .box-body { width: 190px; height: 145px; }
  .box-lid { width: 208px; top: 34px; }
  .timeline::before { left: 12px; }
  .timeline li { padding-left: 50px; }
  .timeline .yr { position: static; display: block; margin-bottom: 0.3rem; }
  .timeline li::before { left: 5px; }
  .section { padding: 4rem 1rem; }
}
