/* Jazzy Lorye 小熊諾樂 — site styles.
   Look: warm felt, rounded type, dashed "stitches" (the series signature) in each character's own stitch colour. */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  /* Felt and paper */
  --cream: #fbf5ec;
  --cream-2: #f5ead9;
  --paper: #fffdf8;
  --ink: #4a3a33;
  --ink-2: #76625a;
  --line: #eadbc6;
  /* Lorye's own colours (character bible §2.2) */
  --caramel: #eebc73;
  --caramel-soft: #fbe7c6;
  --stitch: #3a96c9;
  --patch: #fffddd;
  --tuft: #896755;
  /* Defaults a card can override */
  --accent: var(--stitch);
  --tint: var(--caramel-soft);

  --radius: 28px;
  --shadow: 0 14px 34px -18px rgba(74, 58, 51, 0.38);
  --font-head: "Fredoka", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  --font-body: "Nunito", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  --gutter: 16px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  background-color: var(--cream);
  /* a faint felt grain */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .29 0 0 0 0 .23 0 0 0 0 .2 0 0 0 .045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--stitch); outline-offset: 3px; border-radius: 8px; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.2rem, 5.4vw, 3.7rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.zh { font-weight: 700; font-family: var(--font-body); }

.container { width: 100%; max-width: 1140px; margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 700px) { :root { --gutter: 28px; } }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 10px;
}
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 245, 236, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px dashed rgba(58, 150, 201, 0.35);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 44px; height: 44px; }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: 1.3rem; line-height: 1; }
.brand-name small { display: block; font-family: var(--font-body); font-weight: 700; font-size: 0.78rem; color: var(--ink-2); margin-top: 3px; letter-spacing: 0.08em; }

.nav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: block; padding: 8px 14px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 500; font-size: 1.02rem; text-decoration: none;
  transition: background-color 0.2s;
}
.nav-list a:hover { background: var(--cream-2); }
.nav-list a[aria-current="page"] { background: var(--caramel-soft); outline: 2px dashed var(--stitch); outline-offset: -5px; }

.nav-toggle {
  display: none; width: 46px; height: 46px; border: 0; border-radius: 14px;
  background: var(--cream-2); color: var(--ink); cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2.5px; margin: 4px auto; background: currentColor; border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--cream); border-bottom: 2px dashed rgba(58, 150, 201, 0.35);
    padding: 8px var(--gutter) 16px; display: none;
  }
  .site-nav.open { display: block; }
  .nav-list { flex-direction: column; }
  .nav-list a { padding: 12px 16px; font-size: 1.15rem; }
}

/* ---------- Buttons, chips ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; text-decoration: none;
  background: var(--paper); border: 2px solid var(--line);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary { background: var(--caramel); border-color: var(--caramel); outline: 2px dashed var(--stitch); outline-offset: -6px; }
.link-arrow { font-family: var(--font-head); font-weight: 600; text-decoration: none; border-bottom: 2px dashed var(--accent); padding-bottom: 2px; }
.link-arrow:hover { color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 1.4em; }
.chips li { background: var(--paper); border: 2px dashed var(--accent); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 0.95rem; }

.eyebrow {
  display: inline-block; margin-bottom: 14px; padding: 4px 14px; border-radius: 999px;
  background: var(--patch); border: 2px dashed var(--stitch);
  font-weight: 800; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
}
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--ink-2); max-width: 36em; }

/* ---------- Stitched frame (the series signature) ---------- */
.stitched { position: relative; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.stitched::after {
  content: ""; position: absolute; inset: 9px; pointer-events: none;
  border: 2.5px dashed var(--accent); border-radius: calc(var(--radius) - 7px); opacity: 0.85;
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 8vw, 96px); }
.section-alt { background: rgba(245, 234, 217, 0.75); border-block: 2px dashed var(--line); }
.section-head { text-align: center; max-width: 40em; margin: 0 auto clamp(28px, 4vw, 44px); }
.section-head p { color: var(--ink-2); }

.split { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } .split.media-right > :first-child { order: 0; } }

.blob {
  position: relative;
  aspect-ratio: 1; max-width: 440px; margin-inline: auto; width: 100%;
  border-radius: 48% 52% 46% 54% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 50% 40%, #fff7e8 0%, var(--tint) 70%);
  border: 3px dashed var(--accent);
}
.blob img {
  position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%);
  height: 98%; width: auto; max-width: none;
  filter: drop-shadow(0 14px 14px rgba(74, 58, 51, 0.22));
}

/* ---------- Home hero ---------- */
.hero { padding-block: clamp(28px, 5vw, 64px) clamp(44px, 6vw, 80px); }
/* Home only: the woods picture behind the hero at 40% */
.hero-woods { position: relative; isolation: isolate; }
.hero-woods::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url(../img/hero_woods.webp) center 70% / cover no-repeat;
  opacity: 0.4;
}
.hero-woods .lead { color: var(--ink); }   /* darker over the woods */

/* Lorye's bio lines (home + Lorye page), written like a social-media bio */
.bio { list-style: none; padding: 0; margin: 0 0 1.4em; display: grid; gap: 6px; font-weight: 600; }
.bio li { display: flex; gap: 10px; align-items: baseline; }
.bio .ico { flex: none; width: 1.5em; text-align: center; }
.hero-grid { display: grid; gap: clamp(28px, 4vw, 52px); align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 5fr 7fr; } }
.hero h1 .hl { background: linear-gradient(transparent 62%, var(--caramel-soft) 62%); }
.hero-media { padding: 0; overflow: hidden; aspect-ratio: 1280 / 704; }
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; }
.sound-toggle {
  position: absolute; right: 20px; bottom: 20px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 253, 248, 0.92); color: var(--ink);
  font-family: var(--font-head); font-weight: 600; font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(74, 58, 51, 0.2);
}

/* ---------- Line-up strip ---------- */
.lineup-wrap { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; padding-bottom: 8px; }
.lineup {
  --unit: clamp(190px, 24vw, 250px);
  display: flex; align-items: flex-end; justify-content: center; gap: clamp(4px, 1vw, 14px);
  min-width: max-content; margin-inline: auto; padding: 20px 12px 0;
}
.lineup a { display: flex; flex-direction: column; align-items: center; text-decoration: none; }
.lineup img {
  height: calc(var(--h) * var(--unit)); width: auto;
  filter: drop-shadow(0 10px 8px rgba(74, 58, 51, 0.2));
  transform-origin: 50% 100%; transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1);
}
.lineup a:hover img, .lineup a:focus-visible img { transform: translateY(-8px) rotate(-3deg) scale(1.04); }
.lineup .name { margin-top: 10px; font-family: var(--font-head); font-weight: 600; font-size: 1rem; white-space: nowrap; }
.lineup .name small { display: block; text-align: center; font-family: var(--font-body); font-size: 0.8rem; color: var(--ink-2); font-weight: 700; }
.floor { height: 14px; margin: -2px auto 0; max-width: 1080px; border-radius: 50%; background: radial-gradient(closest-side, rgba(74, 58, 51, 0.16), transparent); }
.swipe-hint { display: none; text-align: center; color: var(--ink-2); font-size: 0.9rem; margin-top: 6px; }
@media (max-width: 1100px) { .lineup { justify-content: flex-start; } .swipe-hint { display: block; } }

/* ---------- Film stills ---------- */
.reel-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.reel { margin: 0; --accent: var(--stitch); }
.reel .stitched { overflow: hidden; aspect-ratio: 540 / 982; }
.reel img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.reel:hover img { transform: scale(1.04); }
.reel figcaption { margin-top: 10px; font-family: var(--font-head); font-weight: 600; text-align: center; line-height: 1.3; }
.badge {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  padding: 3px 12px; border-radius: 999px; background: var(--patch); font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
}
@media (max-width: 960px) {
  .reel-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; }
  .reel { scroll-snap-align: start; }
}
@media (max-width: 560px) { .reel-row { grid-auto-columns: 62%; } }

.follow { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

/* ---------- Character cards ---------- */
.group-photo { padding: 0; overflow: hidden; max-width: 1000px; margin-inline: auto; }
.group-photo img { width: 100%; }

.cast-group { margin-top: clamp(40px, 6vw, 72px); }
.cast-group > h2 { display: flex; align-items: center; gap: 14px; }
.cast-group > h2::after { content: ""; flex: 1; border-top: 2.5px dashed var(--line); }
.cast-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.char-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; scroll-margin-top: 90px;
  transition: transform 0.2s;
}
.char-card:hover { transform: translateY(-4px); }
.char-card::after {
  content: ""; position: absolute; inset: 9px; pointer-events: none;
  border: 2.5px dashed var(--accent); border-radius: calc(var(--radius) - 7px);
}
.char-art {
  position: relative; height: 280px;
  background: radial-gradient(ellipse at 50% 85%, #fffaf0 0%, var(--tint) 75%);
}
.char-art img {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  height: calc(100% - 36px); width: auto; max-width: calc(100% - 40px); object-fit: contain; object-position: 50% 100%;
  filter: drop-shadow(0 10px 8px rgba(74, 58, 51, 0.22));
  transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1); transform-origin: 50% 100%;
}
.char-card:hover .char-art img { transform: translateX(-50%) rotate(-3deg) scale(1.04); }
.char-body { padding: 18px 26px 28px; }
.char-body h3 { margin-bottom: 2px; }
.char-body h3 .zh { font-size: 1rem; color: var(--ink-2); margin-left: 6px; }
.char-role {
  display: inline-block; margin-bottom: 10px; padding: 2px 12px; border-radius: 999px;
  background: var(--tint); color: var(--ink); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.char-aka { margin: 0 0 10px; color: var(--ink-2); font-weight: 700; font-size: 0.95rem; }
.char-body p:last-child { margin-bottom: 0; }

/* ---------- Lorye page ---------- */
.profile { padding: clamp(26px, 4vw, 44px); }
.profile dl { display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; margin: 0; }
.profile dt { font-family: var(--font-head); font-weight: 600; color: var(--ink-2); }
.profile dd { margin: 0; font-weight: 600; }
@media (max-width: 520px) { .profile dl { grid-template-columns: 1fr; gap: 2px; } .profile dd { margin-bottom: 10px; } }

.turnaround {
  display: flex; align-items: flex-end; justify-content: center; gap: clamp(8px, 3vw, 36px);
  padding: 30px 16px 0; border-radius: var(--radius);
  background: linear-gradient(to top, var(--caramel-soft) 0 18%, transparent 18%);
}
.turnaround figure { margin: 0; text-align: center; }
.turnaround img { height: clamp(120px, 22vw, 260px); width: auto; filter: drop-shadow(0 10px 8px rgba(74, 58, 51, 0.2)); }
.turnaround figcaption { font-weight: 700; color: var(--ink-2); font-size: 0.9rem; padding: 8px 0 14px; }

.feel-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .feel-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.feel { margin: 0; text-align: center; }
.feel .stitched { overflow: hidden; aspect-ratio: 1; }
.feel img { width: 100%; height: 100%; object-fit: cover; }
.feel figcaption { margin-top: 8px; font-family: var(--font-head); font-weight: 600; }

/* ---------- Story page ---------- */
.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 21px; top: 8px; bottom: 8px; border-left: 3px dashed var(--stitch); }
.timeline li { position: relative; padding: 0 0 34px 66px; }
.timeline li::before {
  content: ""; position: absolute; left: 6px; top: 4px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--caramel); border: 4px solid var(--paper); box-shadow: 0 0 0 2px var(--caramel);
}
.timeline .when { font-family: var(--font-head); font-weight: 600; color: var(--stitch); font-size: 1.05rem; }
.timeline h3 { margin: 2px 0 6px; }
.timeline p { color: var(--ink-2); margin: 0; }

.art-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.art { margin: 0; }
.art .stitched { aspect-ratio: 4 / 3; overflow: hidden; background: #fff; }
.art img { position: absolute; inset: 24px; width: calc(100% - 48px); height: calc(100% - 48px); object-fit: contain; }
.art figcaption { margin-top: 10px; text-align: center; color: var(--ink-2); font-weight: 700; font-size: 0.95rem; }

.book { padding: clamp(26px, 4vw, 44px); --accent: var(--caramel); }
.book h3 em { font-style: normal; }

/* ---------- Author page ---------- */
.note {
  padding: 24px 28px; border-radius: 22px; background: var(--patch); border: 2.5px dashed var(--stitch);
}
.note h3 { margin-bottom: 6px; }
.note p:last-child { margin-bottom: 0; }

/* ---------- 404 ---------- */
.lost { text-align: center; padding-block: clamp(48px, 9vw, 110px); }
.lost .stitched { width: min(260px, 70vw); margin: 0 auto 28px; overflow: hidden; aspect-ratio: 1; }
.lost .actions { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 0; padding-block: 48px 36px; background: var(--cream-2); border-top: 2.5px dashed var(--stitch); }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid h2 { font-size: 1.05rem; margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { text-decoration: underline dashed var(--stitch); text-underline-offset: 4px; }
.socials { display: flex; gap: 10px; }
.socials a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: var(--paper); border: 2px dashed var(--line); transition: border-color 0.2s, transform 0.15s;
}
.socials a:hover { border-color: var(--stitch); transform: translateY(-2px); }
.socials svg { width: 22px; height: 22px; fill: var(--ink); }
.footer-bio { margin-top: 12px; color: var(--ink-2); }
.small-print { margin-top: 28px; padding-top: 18px; border-top: 2px dashed var(--line); font-size: 0.88rem; color: var(--ink-2); }
.small-print p { margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
