/* =========================================================
   FONTS  (files live in assets/fonts/)
     Amatic SC Bold     -> headings (replaces KG Do You Love Me)
     Poppins Light 300  -> body text (replaces Century Gothic)
   The weight range is declared so the one supplied file is used for every weight (no faux-bold).
   ========================================================= */
@font-face {
  font-family: "Amatic SC";
  src: url("../assets/fonts/AmaticSC-Bold.ttf") format("truetype");
  font-weight: 100 900; font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../assets/fonts/Poppins-Light.ttf") format("truetype");
  font-weight: 100 900; font-style: normal;
  font-display: swap;
}

:root {
  /* Change the two font stacks here if you ever switch fonts */
  --font-heading: "Amatic SC", "Comic Sans MS", cursive;
  --font-body: "Poppins", "Avenir Next", "Trebuchet MS", sans-serif;

  --ink: #1b1a1f;
  --ink-soft: #6f6a63;
  --paper: #f4eee3;      /* same cream as the gallery walls */
  --line: rgba(27,26,31,.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
body.show-gallery, body.show-intro { overflow: hidden; }

/* =========================================================
   WELCOME PAGE  (minimal, one screen, no scrolling)
   ========================================================= */
#intro { background: var(--paper); min-height: 100vh; min-height: 100svh; position: relative; }
body.show-gallery #intro { display: none; }

.intro-hero {
  min-height: 100vh; min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(240px, 5fr) minmax(280px, 6fr);
  align-items: center;
  gap: clamp(24px, 6vw, 96px);
  padding: clamp(28px, 6vw, 96px) clamp(28px, 7vw, 110px) clamp(80px, 9vw, 120px);
}
.intro-character { position: relative; justify-self: center; width: min(100%, min(420px, 46vh)); }
.intro-character img {
  width: 100%; display: block;
  transform-origin: 50% 95%;
  animation: sway 4.8s ease-in-out infinite;   /* the character's gentle side-to-side movement */
}
@keyframes sway {
  0%, 100% { transform: translateX(-14px) rotate(-2.2deg); }
  50% { transform: translateX(14px) rotate(2.2deg); }
}
@media (prefers-reduced-motion: reduce) { .intro-character img { animation: none; } }
.bubble {
  position: absolute; top: 2%; right: -4%;
  background: #fffdf8; border: 1px solid var(--ink); color: var(--ink);
  box-shadow: 0 6px 18px rgba(27,26,31,.10);
  font-family: var(--font-body); font-size: clamp(13px, 1.2vw, 16px); letter-spacing: .06em;
  padding: .55em 1.3em; border-radius: 999px 999px 999px 4px;
  z-index: 2;
}
.intro-text h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(48px, 7.5vw, 104px);
  line-height: .95;
  margin: 0 0 .35em;
  letter-spacing: .02em;
  color: var(--ink);
}
.intro-text h1::after { content: ""; display: block; width: 56px; height: 1px; background: var(--ink); margin-top: .35em; }
.intro-text p {
  font-family: var(--font-body);
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.85;
  max-width: 36em;
  margin: 0;
  color: #3b3935;
}

/* small, understated button in the bottom-right corner */
.explore-btn {
  position: fixed; right: clamp(20px, 3vw, 44px); bottom: clamp(18px, 3vw, 40px);
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-body); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); background: transparent;
  border: 1px solid var(--ink); border-radius: 999px;
  padding: .85em 1.6em;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.explore-btn .arrow { transition: transform .2s ease; }
.explore-btn:hover, .explore-btn:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.explore-btn:hover .arrow { transform: translateX(4px); }
body.show-gallery .explore-btn { display: none; }

@media (max-width: 760px) {
  .intro-hero { grid-template-columns: 1fr; text-align: left; align-content: start; padding-top: 36px; padding-bottom: 110px; gap: 16px; }
  .intro-character { width: min(54%, 220px); justify-self: start; }
  .bubble { right: auto; left: 92%; top: 0; white-space: nowrap; }
  .intro-text h1 { font-size: clamp(44px, 14vw, 70px); }
}

/* =========================================================
   GALLERY
   ========================================================= */
#gallery {
  position: fixed; inset: 0;
  display: none;
  background: #e8e1d3;
  overflow: hidden;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
body.show-gallery #gallery { display: block; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* home button */
#homeBtn {
  position: absolute; top: 18px; left: 18px; z-index: 20;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(244,238,227,.92); color: var(--ink);
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
#homeBtn svg { width: 20px; height: 20px; }
#homeBtn:hover, #homeBtn:focus-visible { background: var(--ink); color: var(--paper); outline: none; }

kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; margin-right: 2px;
  border: 1px solid var(--ink); border-radius: 3px; font: 11px var(--font-body); background: rgba(255,255,255,.5);
}

/* transition layers */
#scribble {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 1000; pointer-events: none; display: none;
}
#scribble.active { display: block; pointer-events: auto; }
#fade { position: fixed; inset: 0; z-index: 999; background: var(--paper); opacity: 0; pointer-events: none; transition: opacity .45s ease; }
#fade.on { opacity: 1; pointer-events: auto; }

/* shown only if index.html is opened by double-click (file://) */
#fileWarning[hidden] { display: none; }
#fileWarning { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.fw-card { max-width: 560px; background: #fff; border: 1px solid var(--ink); padding: 28px 32px; color: var(--ink); font-family: var(--font-body); line-height: 1.6; }
.fw-card h1 { font-family: var(--font-heading); font-size: 44px; margin: 0 0 8px; line-height: 1; }
body.file-mode #intro, body.file-mode #gallery, body.file-mode #scribble, body.file-mode #fade { display: none !important; }

/* =========================================================
   GALLERY HUD  (quiet)
   ========================================================= */
#areaLabel {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 10;
  font-family: var(--font-body); font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink); background: rgba(244,238,227,.92); border: 1px solid var(--line);
  border-radius: 999px; padding: .8em 1.6em; pointer-events: none; white-space: nowrap;
}
#areaLabel:empty { display: none; }
#hud {
  position: absolute; right: 14px; top: 16px; z-index: 10;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; max-width: 46vw;
  background: rgba(250,246,238,.62); border-radius: 999px; padding: 5px 13px;
  font-size: 11px; line-height: 1.5; letter-spacing: .02em; pointer-events: none; color: #5b5148;
}
#hud i { width: 3px; height: 3px; border-radius: 50%; background: #b9ab99; }
#hud kbd { font-size: 10px; padding: 0 3px; margin-right: 1px; }
#infoCard {
  position: absolute; right: 18px; bottom: 18px; z-index: 12; width: min(340px, calc(100vw - 36px));
  background: rgba(247,245,241,.97); border: 1px solid var(--ink);
  padding: 18px 20px; color: #2a2826; display: none;
}
#infoCard.on { display: block; }
#infoCard h3 { font-family: var(--font-heading); font-weight: 700; font-size: 30px; line-height: 1; margin: 0 0 8px; color: var(--ink); }
#infoCard p { font-size: 14px; line-height: 1.65; margin: 0 0 12px; }
#infoCard a { color: var(--ink); }
#infoCard a.primary { display: inline-block; border-bottom: 1px solid var(--ink); text-decoration: none; padding-bottom: 1px; font-size: 13px; letter-spacing: .04em; }
#infoCard ul { margin: 0 0 10px; padding-left: 18px; font-size: 14px; line-height: 1.8; }
#infoCard .keyhint { font-size: 11px; color: var(--ink-soft); margin-top: 10px; }
@media (max-width: 900px) { #hud { display: none; } }
@media (max-width: 760px) { #infoCard { bottom: 150px; left: 14px; right: 14px; width: auto; } }

/* on-screen buttons on phones / tablets */
#touchPad { display: none; }
@media (hover: none) and (pointer: coarse) {
  #hud { display: none; }
  #touchPad { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 20; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 16px; pointer-events: none; }
  #touchPad > * { pointer-events: auto; }
  .tp-move { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 6px; }
  .tp-move [data-act=fwd] { grid-column: 2; grid-row: 1; }
  .tp-move [data-act=left] { grid-column: 1; grid-row: 2; }
  .tp-move [data-act=back] { grid-column: 2; grid-row: 2; }
  .tp-move [data-act=right] { grid-column: 3; grid-row: 2; }
  #touchPad button { width: 56px; height: 56px; border-radius: 50%; font: 400 22px/1 var(--font-body); color: var(--ink); background: rgba(244,238,227,.92); border: 1px solid var(--ink); touch-action: none; }
  #touchPad button:active { background: var(--ink); color: var(--paper); }
}

/* walk-back hint and small messages */
#walkHint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 11;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
  background: rgba(247,245,241,.94); border: 1px solid var(--line); border-radius: 999px; padding: .85em 1.6em;
  opacity: 0; transition: opacity .6s ease; pointer-events: none; white-space: nowrap;
}
#walkHint.on { opacity: 1; }
#toast {
  position: absolute; left: 50%; top: 76px; transform: translate(-50%, -8px); z-index: 30;
  font-size: 13px; letter-spacing: .04em; color: #fbeef0; background: rgba(43,24,32,.94);
  border-radius: 999px; padding: .8em 1.5em; opacity: 0; transition: opacity .25s ease, transform .25s ease; pointer-events: none;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 900px) { #walkHint { bottom: 96px; white-space: normal; text-align: center; width: min(90vw, 360px); } }

/* =========================================================
   VERSION 7 additions (gallery only - the homepage styles above are untouched)
   ========================================================= */
#walkHint { white-space: normal; text-align: center; max-width: min(92vw, 520px); }
/* hover reveal above a contact-wall button */
#tip {
  position: absolute; z-index: 25; transform: translate(-50%, -100%) translateY(6px); pointer-events: none;
  font-family: var(--font-body); font-size: 14px; letter-spacing: .04em; color: var(--ink);
  background: #fffdf8; border: 1px solid var(--ink); border-radius: 999px; padding: .55em 1.3em;
  box-shadow: 0 6px 18px rgba(27,26,31,.12); opacity: 0; transition: opacity .18s ease, transform .18s ease; white-space: nowrap;
}
#tip.on { opacity: 1; transform: translate(-50%, -100%) translateY(-4px); }
/* little speech bubbles in the same style as the homepage bubble */
#chat {
  position: absolute; z-index: 26; width: min(360px, 90vw); transform: translate(-50%, -100%) translateY(-8px) scale(.96); transform-origin: 50% 100%;
  background: #fffdf8; border: 1px solid var(--ink); color: var(--ink);
  box-shadow: 0 6px 18px rgba(27,26,31,.10);
  font-family: var(--font-body); font-size: 16px; line-height: 1.7; letter-spacing: .02em;
  padding: 1.15em 1.6em 1.15em 1.6em; border-radius: 26px 26px 26px 4px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
#chat.on { opacity: 1; pointer-events: auto; transform: translate(-50%, -100%) translateY(-8px) scale(1); }
#chat p { margin: 0 0 .5em; }
#chat p:last-of-type { margin-bottom: 0; }
#chat a { display: inline-block; margin-top: .55em; color: var(--ink); border-bottom: 1px solid var(--ink); text-decoration: none; font-size: 13px; letter-spacing: .06em; }
/* "Hi!" above her head */
#hiBubble {
  position: absolute; z-index: 24; transform: translate(-50%, -100%) scale(.7); transform-origin: 50% 100%; pointer-events: none;
  background: #fffdf8; border: 1px solid var(--ink); color: var(--ink);
  font-family: var(--font-heading); font-weight: 700; font-size: 30px; letter-spacing: .04em;
  padding: .15em .8em .2em; border-radius: 999px 999px 999px 4px; opacity: 0; transition: opacity .15s ease, transform .2s cubic-bezier(.3,1.6,.5,1);
}
#hiBubble.on { opacity: 1; transform: translate(-50%, -100%) scale(1); }
/* the Surprise Easter egg layer */
#surprise { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 900; pointer-events: none; display: none; }
#surprise.on { display: block; }

#hud { transition: opacity .8s ease; }
#hud.quiet { opacity: .22; }
#hud.quiet:hover { opacity: 1; }

/* Prototype 11: the centre heart key's thank-you bubble sits just below the keyboard (it never covers the heart) */
#chat.on.below { pointer-events: none; transform: translate(-50%, 0) translateY(10px) scale(1); }
#chat .sign { margin-top: .4em; text-align: right; font-family: var(--font-heading); font-size: 1.15em; color: var(--ink-soft); }

/* =========================================================
   Prototype 14 - homepage sticker book (everything below only affects the homepage sticker layer and its tray)
   ========================================================= */
.sticker-layer { position: absolute; inset: 0; transform-origin: 50% 95%; animation: sway 4.8s ease-in-out infinite; pointer-events: none; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .sticker-layer { animation: none; } }
.intro-character.stk-busy img, .intro-character.stk-busy .sticker-layer { animation-play-state: paused; }     /* she holds still while a sticker is being moved */
.stk { position: absolute; pointer-events: auto; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; filter: drop-shadow(0 1.5px 0 rgba(74,47,47,.12)); }
.stk svg { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.stk.selected { cursor: grabbing; outline: 1.5px dashed rgba(74,47,47,.55); outline-offset: 5px; border-radius: 6px; }
.stk-handle {
  position: absolute; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1.5px solid #4a2f2f; background: #fffdf8; color: #4a2f2f;
  font: 700 13px/1 var(--font-body); display: grid; place-items: center; cursor: pointer; touch-action: none; box-shadow: 0 2px 6px rgba(27,26,31,.18);
}
.stk-handle.del { left: -16px; top: -16px; }
.stk-handle.rot { right: -16px; top: -16px; cursor: alias; }
.stk-handle.siz { right: -16px; bottom: -16px; cursor: nwse-resize; }
@media (pointer: coarse) { .stk-handle { width: 30px; height: 30px; font-size: 16px; } .stk-handle.del { left: -20px; top: -20px; } .stk-handle.rot { right: -20px; top: -20px; } .stk-handle.siz { right: -20px; bottom: -20px; } }

.stk-dock { position: fixed; left: clamp(16px, 2.4vw, 36px); bottom: clamp(18px, 3vw, 40px); z-index: 6; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
body.show-gallery .stk-dock { display: none; }
.stk-toggle {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-body); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 999px; padding: .7em 1.3em .7em 1.05em; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.stk-toggle:hover, .stk-toggle:focus-visible, .stk-dock.open .stk-toggle { background: var(--ink); color: var(--paper); outline: none; }
.stk-panel {
  width: min(292px, calc(100vw - 32px)); background: #fffdf8; border: 1px solid var(--ink); border-radius: 18px 18px 18px 4px; padding: 12px 14px 12px;
  box-shadow: 0 8px 22px rgba(27,26,31,.12); font-family: var(--font-body); color: var(--ink);
}
.stk-panel[hidden] { display: none; }
.stk-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-heading); font-weight: 700; font-size: 22px; letter-spacing: .04em; margin-bottom: 8px; }
.stk-reset { font: 12px var(--font-body); letter-spacing: .06em; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--ink); padding: 0 0 1px; cursor: pointer; }
.stk-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stk-item { aspect-ratio: 1; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; cursor: grab; touch-action: none; display: grid; place-items: center; transition: transform .15s ease, border-color .15s ease; }
.stk-item:hover, .stk-item:focus-visible { transform: translateY(-2px) rotate(-3deg); border-color: var(--ink); outline: none; }
.stk-item svg { width: 100%; height: 100%; pointer-events: none; }
.stk-hint { margin: 9px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-soft); }
.stk-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: .92; filter: drop-shadow(0 6px 8px rgba(27,26,31,.2)); }
.stk-ghost svg { width: 100%; height: 100%; display: block; overflow: visible; }
@media (max-width: 760px) { .stk-toggle { font-size: 12px; padding: .62em 1.1em .62em .9em; } }

/* Prototype 29: page browsing on the Studio frames (arrows beside the artwork, a counter below it) */
#pager .pg-arrow, #pager #pgCount { position: fixed; z-index: 30; opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .15s ease; }
#pager.on .pg-arrow, #pager.on #pgCount { opacity: 1; }
#pager.on .pg-arrow.show { pointer-events: auto; }
#pager .pg-arrow:not(.show) { opacity: 0 !important; }
#pager .pg-arrow {
  width: 54px; height: 54px; margin: -27px 0 0 -27px; padding: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,250,240,.95); border: 2.5px solid var(--ink-brown, #2b1a12); box-shadow: 3px 4px 0 rgba(43,26,18,.25);
  display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent;
}
#pager .pg-arrow svg { width: 26px; height: 26px; fill: none; stroke: var(--ink-brown, #2b1a12); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
#pager .pg-arrow:hover { transform: scale(1.07); background: #fff; }
#pager .pg-arrow:active { transform: scale(.94); }
#pgCount {
  transform: translate(-50%, 0); padding: 5px 14px; border-radius: 999px; font: 600 14px/1 var(--font-body, sans-serif); letter-spacing: .14em;
  color: var(--ink-brown, #2b1a12); background: rgba(255,250,240,.92); border: 2px solid var(--ink-brown, #2b1a12);
}
@media (max-width: 760px) { #pager .pg-arrow { width: 44px; height: 44px; margin: -22px 0 0 -22px; } #pager .pg-arrow svg { width: 22px; height: 22px; } }
