/* ══════════════════════════════════════════
   SFRNK.ART — Swiss grid, hidden chaos
   ══════════════════════════════════════════ */

@font-face {
  font-family: 'LabilGrotesk';
  src: url('LabilGrotesk-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:     #f4f2ec;
  --ink:    #101010;
  --mid:    #55524c;
  --dim:    #a09a92;
  --rule:   #d8d4cb;
  --blue:   #2231fe;
  --orange: #ff4d00;
  --bdim:   rgba(34,49,254,0.06);
  --odim:   rgba(255,77,0,0.07);
  --labil:  'LabilGrotesk', ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--labil);
  font-size: 15px;
  line-height: 1.55;
  cursor: none;
  overflow-x: hidden;
}

::selection { background: var(--orange); color: #fff; }

/* ── VISIBLE GRID OVERLAY ── */
.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  padding: 0 max(3rem, calc((100vw - 1360px) / 2));
  gap: 0;
}
.grid-overlay span {
  border-left: 1px solid rgba(16,16,16,0.035);
}
.grid-overlay span:last-child {
  border-right: 1px solid rgba(16,16,16,0.035);
}

/* ── CURSOR ── */
.cursor {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--blue);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%,-50%) rotate(45deg);
  transition: width .15s, height .15s, background .2s;
}
.cursor-ring {
  position: fixed;
  width: 30px; height: 30px;
  border: 1.5px solid var(--blue);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%,-50%) rotate(45deg);
  opacity: 0.3;
  transition: width .3s, height .3s, border-color .2s, transform .4s;
}
.trail-dot {
  position: fixed;
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%,-50%);
}


/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2.25rem;
  padding: 1.25rem max(3rem, calc((100vw - 1360px) / 2));
  background: rgba(244,242,236,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.nav-links { display: flex; gap: 2.25rem; list-style: none; }
.nav-links a {
  color: var(--mid);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.15s;
  position: relative;
}
.nav-links a::before {
  content: attr(data-i);
  color: var(--orange);
  font-size: 9px;
  margin-right: 0.4rem;
  vertical-align: super;
}
.nav-links a:hover { color: var(--blue); }

/* ── HERO ── */
.hero {
  min-height: 92vh;
  padding: 8rem max(3rem, calc((100vw - 1360px) / 2)) 4rem;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  padding-bottom: 0.75rem;
  margin-bottom: 3rem;
  font-variant-numeric: tabular-nums;
}
.hero-meta .hm-b { color: var(--blue); }
.hero-meta .hm-o { color: var(--orange); }

h1 {
  font-size: clamp(3.5rem, 9vw, 8.5rem);
  font-weight: normal;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-transform: uppercase;
  word-break: keep-all;
  overflow-wrap: normal;
}
h1 .h1-row {
  display: flex;
  align-items: baseline;
  gap: 2vw;
  white-space: nowrap;
}
h1 .h1-index {
  font-size: clamp(0.8rem, 1.4vw, 1.1rem);
  color: var(--orange);
  letter-spacing: 0.05em;
  transform: translateY(-2.5vw);
}
h1 .accent { color: var(--blue); }

/* the A that hides an easter egg */
.egg-a {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), color 0.2s;
  cursor: none;
}
.egg-a:hover { color: var(--orange); transform: rotate(-6deg); }

.hero-bottom {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  margin-top: 3rem;
  align-items: end;
}
.hero-bio {
  font-size: 15px;
  color: var(--mid);
  line-height: 1.7;
  max-width: 30rem;
  word-break: keep-all;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}
.pill {
  border: 1.5px solid var(--ink);
  padding: 0.3rem 0.85rem;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  transition: all 0.2s;
}
.pill:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem; left: max(3rem, calc((100vw - 1360px) / 2));
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.scroll-line {
  width: 3rem; height: 1px;
  background: var(--orange);
  transform-origin: left;
  animation: lineGrow 2.2s ease infinite;
}
@keyframes lineGrow {
  0%   { transform: scaleX(0.15); opacity: 0.4; }
  50%  { transform: scaleX(1);    opacity: 1; }
  100% { transform: scaleX(0.15); opacity: 0.4; }
}

/* ── SECTION BASE ── */
section { padding: 5rem max(3rem, calc((100vw - 1360px) / 2)); position: relative; z-index: 2; }

.sec-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 3.25rem;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1rem;
}
.sec-num {
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--blue);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.sec-title {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.sec-side {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

/* ── FOCUS ── */
#focus { border-top: 1px solid var(--rule); }
.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--ink);
  border: 1px solid var(--ink);
}
.focus-card {
  background: var(--bg);
  padding: 2.25rem 2rem 2.5rem;
  position: relative;
  transition: background 0.25s;
}
.focus-card:hover { background: #fff; }
.fc-index {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2rem;
}
.fc-num {
  font-size: 2.5rem;
  color: var(--ink);
  line-height: 1;
  display: inline-block;
}
.fc-marker {
  width: 10px; height: 10px;
  background: var(--blue);

}
.fc-title {
  font-size: 1.35rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 0.9rem;
  word-break: keep-all;
}
.fc-body { font-size: 13px; color: var(--mid); line-height: 1.7; }
.fc-tags { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.fc-tag {
  font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--rule);
  color: var(--dim);
  white-space: nowrap;
  transition: all 0.15s;
}

/* ── EXPERIENCE ── */
#work { border-top: 1px solid var(--rule); background: #efede6; }
.work-list { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.work-item {
  display: grid;
  grid-template-columns: 3rem 7.5rem 1fr auto;
  align-items: center;
  gap: 1.75rem;
  padding: 1.5rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  cursor: none;
  position: relative;
  transition: background 0.2s;
}
.work-item:hover { background: #fff; }
.wi-idx {
  font-size: 11px;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
}
.wi-year { font-size: 11px; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wi-title {
  font-size: clamp(1rem, 1.7vw, 1.4rem);
  color: var(--ink);
  transition: color 0.15s;
  word-break: keep-all;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.wi-right { display: flex; align-items: center; gap: 1rem; }
.wi-cat {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dim); white-space: nowrap;
}
.wi-arrow { display: none; }
.wi-sub {
  display: block;
  font-size: 11px;
  color: var(--dim);
  margin-top: 0.2rem;
  text-transform: none;
  letter-spacing: 0;
}

/* ── PRODUCTION ── */
#events { border-top: 1px solid var(--rule); }
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1px;
  background: var(--ink);
  border: 1px solid var(--ink);
}
.event-card {
  background: var(--bg);
  padding: 1.6rem 1.4rem;
  position: relative;
  transition: background 0.2s;
  overflow: hidden;
}
.event-card:hover { background: #fff; }
.ev-year {
  font-size: 10px; letter-spacing: 0.1em;
  color: var(--blue); text-transform: uppercase;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.ev-name {
  font-size: 1.1rem;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.35rem;
  word-break: keep-all;
  text-transform: uppercase;
}
.ev-role { font-size: 12px; color: var(--dim); }

/* ── ABOUT ── */
#about { border-top: 1px solid var(--rule); background: #efede6; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 4.5rem;
  align-items: start;
}
.about-frame {
  width: 100%; aspect-ratio: 4/5;
  border: 1px solid var(--ink);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.about-frame::before {
  content: 'FIG. 01 — PORTRAIT';
  position: absolute;
  top: 0.75rem; left: 0.75rem;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: #fff;
  mix-blend-mode: difference;
  z-index: 2;
}
.about-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  transition: filter 0.4s;
}
.about-frame:hover .about-photo { filter: grayscale(0%); }
.about-initials {
  font-size: 5rem;
  color: var(--orange);
  user-select: none;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.about-caption {
  margin-top: 0.75rem;
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}

.about-right p {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 1.4rem;
  word-break: keep-all;
}
.about-right p em {
  font-style: normal;
  color: var(--blue);
  border-bottom: 2px solid var(--orange);
}

/* ── CONTACT ── */
#contact {
  background: var(--ink);
  color: var(--bg);
  padding: 6rem max(3rem, calc((100vw - 1360px) / 2)) 5rem;
  position: relative;
  overflow: hidden;
}
.contact-num {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: 2rem;
}
.contact-head {
  font-size: clamp(2.5rem, 7vw, 6.5rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 3.5rem;
  word-break: keep-all;
}
.contact-head .accent { color: var(--blue); }
.contact-head .accent2 { color: var(--orange); }
.contact-row { display: flex; gap: 2rem; flex-wrap: wrap; align-items: center; }
.contact-link {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #8a857c; text-decoration: none;
  border-bottom: 1px solid #33302b; padding-bottom: 0.4rem;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.contact-link:hover { color: var(--orange); border-color: var(--orange); }

/* clickable star egg */
.contact-star {
  display: inline-block;
  color: var(--blue);
  font-size: 1.6rem;
  margin-left: 0.5rem;
  cursor: none;
  user-select: none;
  animation: starSpin 8s linear infinite;
  transition: color 0.2s;
}
.contact-star:hover { color: var(--orange); }
@keyframes starSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── FOOTER ── */
footer {
  padding: 1.4rem max(3rem, calc((100vw - 1360px) / 2));
  border-top: 1px solid #262421;
  background: var(--ink);
  display: flex;
  justify-content: space-between;
  font-size: 10px; color: #4a463f;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.footer-egg { cursor: none; transition: color 0.2s, letter-spacing 0.3s; }
.footer-egg:hover { color: var(--orange); letter-spacing: 0.25em; }

/* ── REVEAL ── */
.reveal {
  opacity: 0; transform: translateY(1.1rem);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22,1,0.36,1);
}
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: 0.07s; }
.d2 { transition-delay: 0.14s; }
.d3 { transition-delay: 0.21s; }
.d4 { transition-delay: 0.28s; }

/* ══════════════════════════════════════════
   PARTY MODE — full colour chaos
   ══════════════════════════════════════════ */
body.party {
  --bg:     #0d0221;
  --ink:    #ffffff;
  --mid:    #e0d5ff;
  --dim:    #a48fd8;
  --rule:   #3a2a6a;
  --blue:   #00f5d4;
  --orange: #ff2d78;
  background: linear-gradient(135deg, #0d0221 0%, #1a0533 50%, #240446 100%);
  color: var(--ink);
}
body.party nav {
  background: rgba(13,2,33,0.9);
  border-color: var(--rule);
}
body.party .nav-links a { color: #c8b8f0; }
body.party .nav-links a:hover { color: #00f5d4; }
body.party .nav-links a::before { color: #ffcc00; }
body.party #work,
body.party #about { background: rgba(255,255,255,0.03); }
body.party .focus-card,
body.party .event-card { background: rgba(255,255,255,0.04); }
body.party .focus-card:hover,
body.party .event-card:hover,
body.party .work-item:hover { background: rgba(255,255,255,0.09); }
body.party .focus-grid,
body.party .events-grid { background: var(--rule); border-color: var(--rule); }
body.party .work-list { border-color: var(--rule); }
body.party .work-item { border-color: var(--rule); }
body.party .sec-head { border-color: rgba(255,255,255,0.35); }
body.party .sec-num { color: #ffcc00; }
body.party .sec-title { color: #fff; }
body.party .fc-num { color: #00f5d4; }
body.party .fc-marker { background: #ff2d78; }
body.party .fc-title { color: #fff; }
body.party .ev-year { color: #ffcc00; }
body.party .wi-idx { color: #ff2d78; }
body.party .pill { border-color: #00f5d4; color: #00f5d4; }
body.party .pill:nth-child(2) { border-color: #ff2d78; color: #ff2d78; }
body.party .pill:nth-child(3) { border-color: #ffcc00; color: #ffcc00; }
body.party .pill:nth-child(4) { border-color: #b388ff; color: #b388ff; }
body.party .hero-meta .hm-b { color: #00f5d4; }
body.party .hero-meta .hm-o { color: #ff2d78; }
body.party .hero-meta { border-color: var(--rule); }
body.party h1 .accent { color: #00f5d4; }
body.party .about-frame { border-color: #ff2d78; background: rgba(255,255,255,0.04); }
body.party .about-right p em { color: #00f5d4; border-color: #ffcc00; }
body.party #contact {
  background: linear-gradient(135deg, #ff2d78 0%, #6300ff 55%, #00c8ff 100%);
}
body.party #contact .contact-link { color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.4); }
body.party #contact .contact-link:hover { color: #ffcc00; border-color: #ffcc00; }
body.party .contact-num { color: #ffcc00; }
body.party .contact-head .accent { color: #ffcc00; }
body.party .contact-head .accent2 { color: #0d0221; }
body.party footer {
  background: #0d0221;
  border-color: var(--rule);
  color: #a48fd8;
}
body.party .grid-overlay span { border-color: rgba(255,255,255,0.05); }
body.party h1 { animation: hueShift 3s linear infinite; }
@keyframes hueShift {
  0%   { color: #fff; }
  20%  { color: #ff2d78; }
  40%  { color: #ffcc00; }
  60%  { color: #00f5d4; }
  80%  { color: #b388ff; }
  100% { color: #fff; }
}
body.party .about-frame::before { content: 'FIG. 01 — PARTY MODE'; color: #ffcc00; }
body.party ::selection { background: #ffcc00; color: #0d0221; }
body.party .cursor { background: #00f5d4; }
body.party .cursor-ring { border-color: #ff2d78; }
body.party .scroll-line { background: #ffcc00; }

/* wobble everything briefly when party starts */
body.party.party-entry section,
body.party.party-entry .hero {
  animation: sectionWobble 0.7s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes sectionWobble {
  0%   { transform: rotate(0deg) scale(1); }
  30%  { transform: rotate(-0.8deg) scale(0.99); }
  60%  { transform: rotate(0.5deg) scale(1.005); }
  100% { transform: rotate(0deg) scale(1); }
}


/* ── COFFEE RAIN ── */
.coffee-drop {
  position: fixed;
  top: -3rem;
  font-size: 1.6rem;
  pointer-events: none;
  z-index: 9995;
  animation: coffeeFall linear forwards;
}
@keyframes coffeeFall {
  to { transform: translateY(110vh) rotate(360deg); }
}

/* ── TOAST (small message for eggs) ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.7rem 1.4rem;
  z-index: 9996;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
body.party .toast { background: var(--orange); color: #fff; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  nav { padding: 1rem 1.25rem; gap: 1.25rem; }
  .grid-overlay { padding: 0 1.25rem; }
  .grid-overlay span:nth-child(n+5) { display: none; }
  .grid-overlay { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: 7rem 1.25rem 4rem; }
  .hero-bottom { grid-template-columns: 1fr; gap: 2rem; }
  .hero-tags { justify-content: flex-start; }
  section { padding: 3.5rem 1.25rem; }
  .focus-grid { grid-template-columns: 1fr; }
  .work-item { grid-template-columns: 2rem 5.5rem 1fr; }
  .wi-right { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  footer { flex-direction: column; gap: 0.4rem; text-align: center; }
  .scroll-hint { left: 1.25rem; }
}

/* ── SUBTLE FUN TOGGLE (footer) ── */
.footer-right {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
}
.fun-toggle {
  font-family: var(--labil);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: 1px solid #33302b;
  color: #4a463f;
  padding: 0.3rem 0.8rem;
  cursor: none;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.fun-toggle:hover {
  color: var(--orange);
  border-color: var(--orange);
  transform: rotate(-1.5deg);
}
body.party .fun-toggle {
  color: rgba(255,255,255,0.6);
  border-color: rgba(255,255,255,0.3);
}
body.party .fun-toggle:hover {
  color: #fff;
  border-color: #fff;
}
@media (max-width: 900px) {
  .footer-right { flex-direction: column; gap: 0.5rem; }
}

/* ── DOODLE OVERLAY — hand-drawn, draws in, then boils ── */
.doodle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.dd {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  fill: none;
  transition: stroke-dashoffset 0.25s ease-in;
}

/* frames 2 & 3 pre-drawn but hidden; they only appear during the boil */
.df2, .df3 { opacity: 0; }
.df2 .dd, .df3 .dd { stroke-dashoffset: 0; }

/* draw-in sequence on frame 1 */
.about-frame:hover .df1 .dd-1 { stroke-dashoffset: 0; transition: stroke-dashoffset 0.35s ease-out 0.05s; }
.about-frame:hover .df1 .dd-2 { stroke-dashoffset: 0; transition: stroke-dashoffset 0.55s ease-out 0.4s; }
.about-frame:hover .df1 .dd-3 { stroke-dashoffset: 0; transition: stroke-dashoffset 0.25s ease-out 0.95s; }
.about-frame:hover .df1 .dd-4 { stroke-dashoffset: 0; transition: stroke-dashoffset 0.45s ease-out 1.2s; }
.about-frame:hover .df1 .dd-5 { stroke-dashoffset: 0; transition: stroke-dashoffset 0.2s ease-out 1.65s; }
.about-frame:hover .df1 .dd-6 { stroke-dashoffset: 0; transition: stroke-dashoffset 0.3s ease-out 1.85s; }
.about-frame:hover .df1 .dd-7 { stroke-dashoffset: 0; transition: stroke-dashoffset 0.5s ease-out 2.1s; }

/* boiling-line effect: after drawing (~2.7s), the three jittered
   frames cycle at sketchbook framerate so lines wiggle like
   an animated doodle */
.about-frame:hover .df1 { animation: boil1 0.42s steps(1, end) infinite 2.7s; }
.about-frame:hover .df2 { animation: boil2 0.42s steps(1, end) infinite 2.7s; }
.about-frame:hover .df3 { animation: boil3 0.42s steps(1, end) infinite 2.7s; }

@keyframes boil1 {
  0%, 32%   { opacity: 1; }
  33%, 100% { opacity: 0; }
}
@keyframes boil2 {
  0%, 32%   { opacity: 0; }
  33%, 65%  { opacity: 1; }
  66%, 100% { opacity: 0; }
}
@keyframes boil3 {
  0%, 65%   { opacity: 0; }
  66%, 100% { opacity: 1; }
}
/* ── PAGE DOODLES (around the page, tied to portrait hover) ── */
.page-doodle {
  position: fixed;
  pointer-events: none;
  z-index: 60;
}
.pd-coffee { right: 5%;  top: 26%;   width: 110px; }
.pd-dog    { left: 3.5%; bottom: 7%; width: 160px; }
.pd-star1  { left: 9%;   top: 16%;   width: 52px; }
.pd-star2  { right: 13%; bottom: 22%; width: 44px; }
.pd-star3  { right: 30%; top: 9%;    width: 38px; }

.pdd {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  fill: none;
  transition: stroke-dashoffset 0.25s ease-in;
}
.page-doodle .pf2, .page-doodle .pf3 { opacity: 0; }
.page-doodle .pf2 .pdd, .page-doodle .pf3 .pdd { stroke-dashoffset: 0; }

/* draw-in while portrait is hovered — staggered per object */
body.doodling .pd-star1  .pf1 .pdd { stroke-dashoffset: 0; transition: stroke-dashoffset 0.5s ease-out 0.3s; }
body.doodling .pd-coffee .pf1 .pdd { stroke-dashoffset: 0; transition: stroke-dashoffset 0.6s ease-out 0.7s; }
body.doodling .pd-star3  .pf1 .pdd { stroke-dashoffset: 0; transition: stroke-dashoffset 0.5s ease-out 1.2s; }
body.doodling .pd-dog    .pf1 .pdd { stroke-dashoffset: 0; transition: stroke-dashoffset 0.7s ease-out 1.5s; }
body.doodling .pd-star2  .pf1 .pdd { stroke-dashoffset: 0; transition: stroke-dashoffset 0.5s ease-out 2.1s; }

/* then they boil like the photo doodles */
body.doodling .page-doodle .pf1 { animation: boil1 0.42s steps(1, end) infinite 2.7s; }
body.doodling .page-doodle .pf2 { animation: boil2 0.42s steps(1, end) infinite 2.7s; }
body.doodling .page-doodle .pf3 { animation: boil3 0.42s steps(1, end) infinite 2.7s; }

@media (max-width: 900px) {
  .page-doodles { display: none; }
}

/* ── MORE EGGS ── */
#eggPrague, #eggEst { cursor: none; transition: color 0.2s; }
#eggPrague:hover { color: var(--blue); }
#eggEst:hover { color: var(--ink); }

/* dog runner */
.runner {
  position: fixed;
  bottom: 4vh;
  left: -8%;
  font-size: 2.4rem;
  z-index: 9994;
  pointer-events: none;
  animation: runAcross 3.2s cubic-bezier(0.3,0,0.7,1) forwards;
}
@keyframes runAcross {
  0%   { left: -8%;  transform: translateY(0) scaleX(-1); }
  20%  { transform: translateY(-10px) scaleX(-1); }
  40%  { transform: translateY(0) scaleX(-1); }
  60%  { transform: translateY(-10px) scaleX(-1); }
  80%  { transform: translateY(0) scaleX(-1); }
  100% { left: 108%; transform: translateY(-6px) scaleX(-1); }
}
.pawprint {
  position: fixed;
  bottom: 3.5vh;
  font-size: 0.8rem;
  z-index: 9993;
  pointer-events: none;
  opacity: 0.6;
  animation: pawFade 2.5s ease-out forwards;
}
@keyframes pawFade { to { opacity: 0; } }

/* click-drawn stars */
.click-star {
  position: fixed;
  pointer-events: none;
  z-index: 9992;
  animation: starWiggle 0.4s steps(2, end) infinite, starFade 6s ease-out forwards;
}
.click-star path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  fill: none;
  animation: starDraw 0.5s ease-out forwards;
}
@keyframes starDraw { to { stroke-dashoffset: 0; } }
@keyframes starWiggle {
  0%   { transform: rotate(-2deg); }
  50%  { transform: rotate(2.5deg); }
  100% { transform: rotate(-2deg); }
}
@keyframes starFade {
  0%, 75% { opacity: 1; }
  100%    { opacity: 0; }
}

/* ── DARK MODE (currently unused, kept for future toggle) ── */
body.dark {
  --bg:     #141311;
  --ink:    #f0ece4;
  --mid:    #b8b2a6;
  --dim:    #6e685e;
  --rule:   #2e2b26;
  --bdim:   rgba(90,105,255,0.1);
  background: var(--bg);
  color: var(--ink);
}
body.dark nav { background: rgba(20,19,17,0.92); border-color: var(--rule); }
body.dark #work,
body.dark #about { background: #1a1916; }
body.dark .focus-card,
body.dark .event-card { background: var(--bg); }
body.dark .focus-card:hover,
body.dark .event-card:hover,
body.dark .work-item:hover { background: #201e1a; }
body.dark .focus-grid,
body.dark .events-grid { background: var(--rule); border-color: var(--rule); }
body.dark .work-list, body.dark .work-item { border-color: var(--rule); }
body.dark .sec-head { border-color: rgba(240,236,228,0.4); }
body.dark .pill { border-color: var(--ink); color: var(--ink); }
body.dark .pill:hover { border-color: var(--blue); color: var(--blue); }
body.dark .about-frame { border-color: var(--rule); background: #1a1916; }
body.dark #contact { background: #0c0b0a; }
body.dark footer { background: #0c0b0a; border-color: #201e1a; }
body.dark .grid-overlay span { border-color: rgba(240,236,228,0.04); }
body.dark ::selection { background: var(--blue); color: #fff; }

/* ── "LET'S PLAY A GAME" + EGG MENU ── */
.game-link {
  font-family: var(--labil);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: #4a463f;
  cursor: none;
  padding: 0;
  transition: color 0.2s;
}
.game-link:hover { color: var(--orange); }
body.dark .game-link { color: var(--dim); }
body.dark .game-link:hover { color: var(--orange); }

.egg-menu {
  position: fixed;
  bottom: 4.5rem;
  left: max(3rem, calc((100vw - 1360px) / 2));
  width: 270px;
  background: var(--bg);
  border: 1.5px solid var(--ink);
  z-index: 9995;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s;
}
.egg-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.egg-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--rule);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
}
.egg-menu-close {
  font-family: var(--labil);
  background: none;
  border: none;
  color: var(--dim);
  font-size: 16px;
  cursor: none;
  line-height: 1;
  transition: color 0.15s, transform 0.2s;
}
.egg-menu-close:hover { color: var(--orange); transform: rotate(90deg); }
.egg-menu-list {
  list-style: none;
  padding: 0.75rem 1rem;
  margin: 0;
}
.egg-menu-list li {
  font-size: 12px;
  color: var(--mid);
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--rule);
}
.egg-menu-list li:last-child { border-bottom: none; }
.egg-menu-list b {
  color: var(--blue);
  font-weight: normal;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
  margin-right: 0.3rem;
}
.egg-menu-foot {
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--rule);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: right;
}
body.dark .egg-menu { background: #1a1916; border-color: var(--ink); }

@media (max-width: 900px) {
  .egg-menu { left: 1rem; right: 1rem; width: auto; bottom: 6rem; }
}
