/* --- Kinetic Tide flip book --- */
:root {
  --paper: #f6f2ea;       /* warm ivory */
  --paper-edge: #ece4d3;  /* vignette edge */
  --ink: #1f2937;
  --ink-soft: #4b5567;
  --navy: #3a4560;
  --gold: #b89a59;
  --gold-soft: #d9c493;
  --shadow-lg: 0 30px 60px -20px rgba(30, 40, 55, 0.35), 0 12px 24px -12px rgba(30, 40, 55, 0.25);
  --radius: 4px;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 40%, #fbf7ee 0%, var(--paper) 40%, var(--paper-edge) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* --- Header --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid rgba(184, 154, 89, 0.25);
}
.brand { display: flex; align-items: center; gap: 0.85rem; color: var(--navy); }
.brand-mark { width: 32px; height: 32px; flex: none; color: var(--gold); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; letter-spacing: 0.01em; color: var(--navy); }
.brand-sub { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-top: 2px; }
.byline { font-family: var(--serif); font-style: italic; color: var(--ink-soft); font-size: 0.95rem; }

/* --- Stage --- */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 1rem;
  gap: 1.25rem;
}
.book-wrap {
  width: 100%;
  max-width: 1100px;
  display: flex;
  justify-content: center;
}
.book {
  filter: drop-shadow(0 30px 40px rgba(30, 40, 55, 0.25));
}
.book .page {
  background: var(--paper);
  overflow: hidden;
}
.page-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--paper);
}

/* --- Controls --- */
.controls {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  background: rgba(255, 253, 247, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(184, 154, 89, 0.35);
  border-radius: 999px;
  box-shadow: 0 8px 24px -12px rgba(30, 40, 55, 0.25);
}
.ctrl {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms ease, color 160ms ease, transform 120ms ease;
}
.ctrl:hover { background: rgba(184, 154, 89, 0.15); }
.ctrl:active { transform: scale(0.95); }
.ctrl svg { width: 20px; height: 20px; }
.ctrl.play { background: var(--navy); color: #f6f2ea; }
.ctrl.play:hover { background: #2c3550; }
.ctrl.play .icon-play { display: none; }
.ctrl.play[aria-pressed="false"] .icon-pause { display: none; }
.ctrl.play[aria-pressed="false"] .icon-play { display: block; }
.divider { width: 1px; height: 24px; background: rgba(184, 154, 89, 0.4); margin: 0 0.25rem; }
.counter { font-family: var(--serif); font-size: 1.05rem; color: var(--navy); padding: 0 0.6rem; min-width: 60px; text-align: center; letter-spacing: 0.05em; }
.counter-sep { color: var(--gold); margin: 0 0.3rem; }

/* Progress ring around play button */
.ctrl.play {
  position: relative;
}
.ctrl.play::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  background: conic-gradient(var(--gold) calc(var(--progress, 0) * 1%), rgba(184,154,89,0.15) 0);
  -webkit-mask: radial-gradient(circle, transparent 22px, #000 23px);
          mask: radial-gradient(circle, transparent 22px, #000 23px);
  transition: background 100ms linear;
  pointer-events: none;
  opacity: 0.9;
}
.ctrl.play[aria-pressed="false"]::before { opacity: 0.25; }

/* --- Hint --- */
.hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  text-align: center;
  max-width: 42rem;
  opacity: 0.85;
}

/* --- Footer --- */
.site-footer {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.25rem 1rem 1.5rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.site-footer .sep { color: var(--gold); }

/* --- Mobile --- */
@media (max-width: 720px) {
  .site-header { padding: 0.9rem 1rem; flex-wrap: wrap; }
  .brand-title { font-size: 1.15rem; }
  .brand-sub { font-size: 0.65rem; }
  .byline { font-size: 0.85rem; width: 100%; text-align: right; }
  .stage { padding: 1rem 0.75rem 0.75rem; gap: 0.9rem; }
  .ctrl { width: 38px; height: 38px; }
  .ctrl svg { width: 18px; height: 18px; }
  .hint { font-size: 0.72rem; }
}
