/* =====================================================
   Prolost Watches — Site Styles
   =====================================================
   Palette:
     --obsidian:  #0c1617  (background)
     --fern:      #9ac370  (primary accent, DarkModeFern)
     --glacier:   #84a0b2  (neutral, body text)
     --downpipe:  #365d5a  (UI, subtle surfaces)
     --rust:      #d3703c  (callouts, warmth)
     --burgundy:  #c21d2e  (sparingly)
     --gold:      #e3bc5d  (sparingly)
   ===================================================== */

:root {
  --obsidian:  #0c1617;
  --fern:      #9ac370;
  --glacier:   #84a0b2;
  --downpipe:  #365d5a;
  --rust:      #d3703c;
  --burgundy:  #c21d2e;
  --gold:      #e3bc5d;

  --bg:        var(--obsidian);
  --text:      var(--glacier);
  --accent:    var(--fern);
}

/* ── Password Gate ────────────────────────────────── */

#pw-gate {
  position: fixed;
  inset: 0;
  background: var(--obsidian);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease;
}

#pw-gate.fade-out {
  opacity: 0;
  pointer-events: none;
}

#pw-gate-inner {
  text-align: center;
}

#pw-gate h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: bold;
  color: var(--fern);
  letter-spacing: -0.02em;
  border: none;
  margin: 0 0 2.5rem;
  padding: 0;
}

#pw-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(54, 93, 90, 0.5);
  color: var(--glacier);
  font-family: Georgia, serif;
  font-size: 1rem;
  padding: 0.4rem 0;
  width: 180px;
  text-align: center;
  letter-spacing: 0.15em;
  outline: none;
  transition: border-color 0.2s ease;
}

#pw-input:focus {
  border-bottom-color: var(--downpipe);
}

#pw-error {
  color: var(--rust);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  margin-top: 1.2rem;
  min-height: 1em;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#pw-error.visible {
  opacity: 1;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

/* ── Reset & Base ─────────────────────────────────── */

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

html {
  font-size: 21px;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Layout ───────────────────────────────────────── */

#content {
  max-width: 680px;
  margin: 0 auto;
  padding: 10rem 2.5rem 14rem;
}

/* ── Headings ─────────────────────────────────────── */

h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: bold;
  font-size: clamp(3rem, 9vw, 5rem);
  color: var(--fern);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 3.5rem;
  margin-top: 0;
}

h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: bold;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  color: var(--fern);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-top: 6rem;
  margin-bottom: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(54, 93, 90, 0.35);
}

/* First h2 doesn't need a top rule */
h1 + h2,
h1 + p + h2 {
  border-top: none;
  padding-top: 0;
}

h3 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  font-size: 0.7rem;
  color: rgba(132, 160, 178, 0.45); /* --glacier at ~50% */
  text-align: center;
  letter-spacing: 0.04em;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ── Body Text ────────────────────────────────────── */

p {
  margin-bottom: 1.6rem;
  color: var(--text);
}

strong {
  color: var(--fern);
  font-weight: 500;
}

em {
  font-style: italic;
  color: var(--glacier);
}

/* ── Links ────────────────────────────────────────── */

a {
  color: var(--fern);
  text-decoration: none;
  border-bottom: 1px solid rgba(154, 195, 112, 0.25);
  transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: #b8d990;
  border-bottom-color: rgba(154, 195, 112, 0.7);
}

/* ── Blockquotes — Callouts ───────────────────────── */

blockquote {
  position: relative;
  margin: 4.5rem 0;
  padding: 0;
}

blockquote::before {
  content: '';
  display: block;
  width: 2.5rem;
  height: 1px;
  background: rgba(211, 112, 60, 0.35);
  margin: 0 auto 1.25rem;
}

blockquote::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: 1px;
  background: rgba(211, 112, 60, 0.35);
  margin: 1.25rem auto 0;
}

blockquote p {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.4;
  color: var(--rust);
  margin: 0;
}

/* ── Lists ────────────────────────────────────────── */

ul, ol {
  padding-left: 1.4rem;
  margin-bottom: 1.6rem;
}

li {
  margin-bottom: 0.6rem;
  padding-left: 0.2rem;
}

ul li::marker {
  color: var(--downpipe);
}

ol li::marker {
  color: var(--fern);
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: bold;
}

/* ── Images ───────────────────────────────────────── */

img {
  display: block;
  max-width: 100%;
}

/* App Store badge and similar SVG badges */
.img-badge {
  display: block;
  height: 48px;
  width: auto;
  margin: 2rem auto;
}

a:has(.img-badge) {
  border-bottom: none;
  display: block;
  text-align: center;
}

/* App icon — small, squircle, directional shadow (light from upper-left) */
.img-icon {
  width: 88px;
  height: 88px;
  border-radius: 20%;
  margin: 2.5rem auto;
  box-shadow: 3px 5px 16px rgba(0, 0, 0, 0.55);
}

/* Full iPhone screenshot — centered, phone frame treatment */
.img-screen {
  max-width: 260px;
  width: 100%;
  margin: 3rem auto;
  border-radius: 2.2rem;
  box-shadow:
    0 0 0 1px rgba(132, 160, 178, 0.15),
    0 0 0 6px rgba(12, 22, 23, 0.9),
    0 0 0 7px rgba(54, 93, 90, 0.25),
    0 28px 64px rgba(0, 0, 0, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Two screen images — crossfade slideshow in a single phone frame */
.screen-slideshow {
  display: grid;
  max-width: 260px;
  width: 100%;
  margin: 3rem auto;
  border-radius: 2.2rem;
  box-shadow:
    0 0 0 1px rgba(132, 160, 178, 0.15),
    0 0 0 6px rgba(12, 22, 23, 0.9),
    0 0 0 7px rgba(54, 93, 90, 0.25),
    0 28px 64px rgba(0, 0, 0, 0.55),
    0 8px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden; /* clip to border-radius */
}

.screen-slideshow .slide {
  grid-area: 1 / 1; /* all slides in the same cell */
  opacity: 0;
  transition: opacity 1s ease;
}

.screen-slideshow .slide.active {
  opacity: 1;
}

.screen-slideshow img {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

/* UI crop — full-width partial screenshot, left/right phone rails only */
figure.ui-frame {
  margin: 2.5rem 0;
  padding: 0 18px;
  background: #0d1b1d;
  border-left: 1.5px solid rgba(100, 135, 150, 0.25);
  border-right: 1.5px solid rgba(100, 135, 150, 0.25);
  /* Fade top and bottom — encompasses the side borders too */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 14%,
    black 86%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 14%,
    black 86%,
    transparent 100%
  );
}

figure.ui-frame img {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

/* ── Horizontal Rule ──────────────────────────────── */

hr {
  border: none;
  border-top: 1px solid rgba(54, 93, 90, 0.35);
  margin: 3.5rem 0;
}

/* ── Disclosure Groups (H4 sections) ─────────────── */

details.disclosure {
  background: rgba(54, 93, 90, 0.1);
  border: 1px solid rgba(54, 93, 90, 0.3);
  border-radius: 6px;
  margin: 1.75rem 0;
  overflow: hidden;
  transition: background 0.2s ease;
}

details.disclosure:hover {
  background: rgba(54, 93, 90, 0.15);
}

details.disclosure summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  color: var(--glacier);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  user-select: none;
  -webkit-user-select: none;
}

details.disclosure summary::-webkit-details-marker {
  display: none;
}

details.disclosure summary::before {
  content: '▶';
  font-size: 0.55rem;
  color: var(--downpipe);
  transition: transform 0.25s ease;
  display: inline-block;
  flex-shrink: 0;
}

details.disclosure[open] > summary::before {
  transform: rotate(90deg);
}

details.disclosure .disclosure-body {
  padding: 0 1.2rem 1.2rem;
  border-top: 1px solid rgba(54, 93, 90, 0.25);
  padding-top: 1rem;
}

details.disclosure .disclosure-body p,
details.disclosure .disclosure-body li {
  font-size: 0.85rem;
  line-height: 1.75;
}

details.disclosure .disclosure-body *:last-child {
  margin-bottom: 0;
}

/* ── Analog Clock ─────────────────────────────────── */

.clock-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 3rem 0;
}

.clock-wrap svg {
  width: 220px;
  height: 220px;
}

/* ── Cycling Text ─────────────────────────────────── */

.cycle-text {
  display: inline-grid;
  vertical-align: baseline;
  text-align: center; /* center shorter words within the widest word's space */
}

.cycle-word {
  grid-area: 1 / 1;
  opacity: 0;
  /* transition set dynamically by runtime.js */
}

.cycle-word.active {
  opacity: 1;
}

/* ── Scroll Reveal ────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 600px) {
  #content {
    padding: 6rem 1.6rem 10rem;
  }

  img {
    max-width: 220px;
  }
}
