/*
 * Aeon Reader — main.css
 * ======================
 * Phase 3: Feed View layout, components, and card styles.
 * Phase 5: All four themes (Light, Sepia, Dark Gray, AMOLED Black) via CSS custom properties.
 *
 * Theme switching is done by setting `data-theme="<name>"` on the <html> element.
 * All colour values are expressed as custom properties so switching themes requires
 * only a single attribute change — no class toggling on individual elements.
 *
 * Custom properties used throughout:
 *   --bg            : page background
 *   --bg-card       : article card background
 *   --text          : primary text colour
 *   --text-muted    : secondary / caption text colour
 *   --accent        : brand accent colour (links, progress bar, pills)
 *   --border        : divider / border colour
 *   --header-bg     : header background (with opacity for blur effect)
 *   --font-scale    : font size multiplier (0.85–1.3), set by settings slider
 *   --line-spacing  : line-height for body text (1.5 compact / 1.75 comfortable)
 *   --body-font     : font-family stack for reading text
 */

/* =========================================================
   CSS Reset / Base
   ========================================================= */

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

html {
  /* Default font scale — overridden by settings slider */
  --font-scale: 1;
  /* Default line spacing — overridden by spacing toggle */
  --line-spacing: 1.75;
  /* Default body font */
  --body-font: 'Lora', Georgia, serif;
  /* Smooth theme colour transitions */
  transition: background-color 0.25s ease, color 0.25s ease;
  /* Prevent text size inflation on iOS after orientation change */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--body-font);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  /* Reserve space for bottom navigation bar on iOS */
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}

/* Hide elements with the hidden attribute */
[hidden] {
  display: none !important;
}

/* =========================================================
   Theme Definitions
   All themes set the same set of custom properties so any
   component that uses them automatically adapts.
   ========================================================= */

/* Light theme — clean white background, dark ink */
[data-theme="light"] {
  --bg:         #FFFFFF;
  --bg-card:    #F7F6F2;
  --text:       #1A1A1A;
  --text-muted: #6B6B6B;
  --accent:     #C0392B;
  --border:     #E5E5E5;
  --header-bg:  rgba(255, 255, 255, 0.92);
  --pill-bg:    #EFEFEF;
  --pill-text:  #3A3A3A;
  --sheet-bg:   #FFFFFF;
  --input-bg:   #F0F0F0;
  --shadow:     0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Sepia theme (app default) — warm cream background, dark brown ink */
[data-theme="sepia"],
:root:not([data-theme]) {
  --bg:         #F5ECD7;
  --bg-card:    #EDE0C8;
  --text:       #3B2F2F;
  --text-muted: #7A6652;
  --accent:     #8B4513;
  --border:     #D5C5A5;
  --header-bg:  rgba(245, 236, 215, 0.92);
  --pill-bg:    #DDD0B8;
  --pill-text:  #3B2F2F;
  --sheet-bg:   #EDE0C8;
  --input-bg:   #F0E6D0;
  --shadow:     0 2px 12px rgba(59, 47, 47, 0.12);
}

/* Dark Gray theme — sophisticated dark, not pure black */
[data-theme="dark"] {
  --bg:         #1C1C1E;
  --bg-card:    #2C2C2E;
  --text:       #E8E8E8;
  --text-muted: #9A9A9A;
  --accent:     #FF6B6B;
  --border:     #3A3A3C;
  --header-bg:  rgba(28, 28, 30, 0.92);
  --pill-bg:    #3A3A3C;
  --pill-text:  #E8E8E8;
  --sheet-bg:   #2C2C2E;
  --input-bg:   #3A3A3C;
  --shadow:     0 2px 12px rgba(0, 0, 0, 0.4);
}

/* AMOLED Black theme — pure black for OLED battery saving */
[data-theme="amoled"] {
  --bg:         #000000;
  --bg-card:    #111111;
  --text:       #F0F0F0;
  --text-muted: #808080;
  --accent:     #E57373;
  --border:     #222222;
  --header-bg:  rgba(0, 0, 0, 0.95);
  --pill-bg:    #1A1A1A;
  --pill-text:  #F0F0F0;
  --sheet-bg:   #111111;
  --input-bg:   #1A1A1A;
  --shadow:     0 2px 12px rgba(0, 0, 0, 0.6);
}

/* Font family options — toggled by data-font on <html> */
[data-font="lora"]         { --body-font: 'Lora', Georgia, serif; }
[data-font="merriweather"] { --body-font: 'Merriweather', Georgia, serif; }
[data-font="system"]       { --body-font: Georgia, 'Times New Roman', serif; }
[data-font="inter"]        { --body-font: 'Inter', system-ui, sans-serif; }

/* =========================================================
   Skip Navigation Link (accessibility)
   ========================================================= */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-family: system-ui, sans-serif;
  z-index: 9999;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* =========================================================
   View Management
   Two views exist in the DOM at all times; only one is shown.
   ========================================================= */

.view {
  width: 100%;
  min-height: 100dvh;
}

.view[hidden] {
  display: none;
}

/* =========================================================
   App Header (Feed View)
   Sticky header with wordmark + action icons.
   On scroll-down the header shrinks via JS adding .app-header--compact.
   ========================================================= */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  /* iOS safe-area for notch */
  padding-top: env(safe-area-inset-top);
  transition: padding 0.2s ease;
}

.app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  max-width: 720px;
  margin: 0 auto;
}

.app-header__wordmark {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  cursor: default;
  user-select: none;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Compact header mode — triggered by JS on scroll down */
.app-header--compact .app-header__wordmark {
  font-size: 0;  /* hide wordmark */
  width: 0;
  overflow: hidden;
}

/* =========================================================
   Icon Buttons
   Used throughout the header and bottom sheets.
   ========================================================= */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  /* Minimum touch target 44x44px for accessibility */
  min-width: 44px;
  min-height: 44px;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
  background-color: rgba(128, 128, 128, 0.12);
}

.icon-btn:active {
  background-color: rgba(128, 128, 128, 0.24);
  transform: scale(0.95);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* SVG icons inside icon buttons */
.icon {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
  flex-shrink: 0;
}

.icon--small {
  width: 1.125rem;
  height: 1.125rem;
}

/* =========================================================
   Offline Indicator
   ========================================================= */

.offline-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  font-family: system-ui, sans-serif;
  font-size: 0.8125rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* =========================================================
   Progress Bar
   Used for refresh progress (feed) and reading progress (reader).
   ========================================================= */

.progress-bar {
  height: 3px;
  background-color: var(--accent);
  width: 0%;
  transition: width 0.4s ease;
}

/* =========================================================
   Feed Container
   ========================================================= */

.feed-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 1rem calc(4rem + env(safe-area-inset-bottom));
}

/* =========================================================
   Article Card List
   ========================================================= */

.article-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* =========================================================
   Article Card
   Each card is rendered by js/feed.js as an <li> element
   containing a <button> (the whole card is tappable).
   ========================================================= */

.article-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  /* Slide-in animation for newly prepended cards */
  animation: card-enter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow), 0 4px 16px rgba(0, 0, 0, 0.1);
}

.article-card:active {
  transform: translateY(0) scale(0.99);
}

/* The entire card is a button for accessibility */
.article-card__btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.article-card__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 12px;
}

/* Card cover image — 16:9 aspect ratio, prevents layout shift */
.article-card__image-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--border);
  /* Inline placeholder SVG via CSS — overridden by JS once image URL is known */
  background-image: url("../assets/placeholder.svg");
  background-size: cover;
  background-position: center;
}

.article-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.3s ease;
}

/* Image shown only after it loads — avoids flash of broken img icon */
.article-card__image[src=""] {
  display: none;
}

.article-card__body {
  padding: 0.875rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* Category pill above the title */
.article-card__category {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-size: calc(0.6875rem * var(--font-scale));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  line-height: 1;
}

/* Article title */
.article-card__title {
  font-family: var(--body-font);
  font-size: calc(1.125rem * var(--font-scale));
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  /* Clamp to 3 lines max */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Author + reading time meta line */
.article-card__meta {
  font-family: system-ui, sans-serif;
  font-size: calc(0.8125rem * var(--font-scale));
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Excerpt — 2 lines max */
.article-card__excerpt {
  font-family: var(--body-font);
  font-size: calc(0.875rem * var(--font-scale));
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================================
   Skeleton Loading State
   CSS animated shimmer cards shown while articles.json loads.
   ========================================================= */

.feed-skeleton {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-skeleton {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  height: 280px;
  position: relative;
}

/* Shimmer animation sweeps across each skeleton card */
.card-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* =========================================================
   Empty State
   ========================================================= */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state__icon {
  width: 3.5rem;
  height: 3.5rem;
  fill: var(--text-muted);
  opacity: 0.5;
}

.empty-state__message {
  font-family: var(--body-font);
  font-size: calc(1.125rem * var(--font-scale));
  font-weight: 600;
  color: var(--text);
}

.empty-state__hint {
  font-family: system-ui, sans-serif;
  font-size: calc(0.875rem * var(--font-scale));
  color: var(--text-muted);
}

/* =========================================================
   Error State
   ========================================================= */

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 2rem;
  text-align: center;
}

.error-state__message {
  font-family: system-ui, sans-serif;
  font-size: calc(0.9375rem * var(--font-scale));
  color: var(--text-muted);
}

/* =========================================================
   Primary and Secondary Buttons
   ========================================================= */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  background-color: var(--accent);
  color: #fff;
  font-family: system-ui, sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  transition: opacity 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover  { opacity: 0.9; }
.btn-primary:active { opacity: 0.8; transform: scale(0.98); }

.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background-color: var(--pill-bg);
  color: var(--pill-text);
  font-family: system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  min-height: 40px;
  transition: background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary:hover { background-color: var(--border); }

.btn-secondary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Danger variant — for destructive actions like Clear Cache */
.btn-danger {
  color: #C0392B;
  border-color: rgba(192, 57, 43, 0.3);
}

/* Full-width button variant */
.btn-full {
  width: 100%;
}

/* =========================================================
   Bottom Sheet (Drawer)
   Slides up from the bottom of the screen.
   JS adds .bottom-sheet--open to animate it in.
   ========================================================= */

.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 201;
  background: var(--sheet-bg);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  max-height: 85dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* iOS safe-area bottom padding */
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%);
  animation: sheet-slide-up 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes sheet-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.bottom-sheet__handle {
  width: 40px;
  height: 4px;
  background-color: var(--border);
  border-radius: 2px;
  margin: 0.75rem auto 0;
}

.bottom-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.bottom-sheet__title {
  font-family: var(--body-font);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
}

.bottom-sheet__content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* =========================================================
   Settings Groups and Controls
   ========================================================= */

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Row variant — label + control on the same line */
.settings-group--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.settings-label {
  font-family: system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.settings-help {
  font-family: system-ui, sans-serif;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Ordered list inside settings (PAT instructions) */
.pat-instructions {
  padding-left: 1.25rem;
}

.pat-instructions li {
  margin-bottom: 0.25rem;
}

/* =========================================================
   Pill Group (theme/font selector buttons)
   ========================================================= */

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.875rem;
  background-color: var(--pill-bg);
  color: var(--pill-text);
  font-family: system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1.5px solid transparent;
  border-radius: 100px;
  cursor: pointer;
  min-height: 36px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.pill:hover {
  border-color: var(--accent);
}

.pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Active pill — selected option */
.pill--active,
.pill[aria-pressed="true"] {
  background-color: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* =========================================================
   Font Size Slider Row
   ========================================================= */

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slider-label-small {
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.slider-label-large {
  font-family: system-ui, sans-serif;
  font-size: 1.125rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.settings-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  accent-color: var(--accent);
}

.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.settings-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   Toggle Switch
   ========================================================= */

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
  /* Visually hidden but accessible to screen readers */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.toggle-switch__slider {
  position: relative;
  width: 48px;
  height: 28px;
  background-color: var(--border);
  border-radius: 14px;
  transition: background-color 0.2s ease;
}

.toggle-switch__slider::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch input:checked + .toggle-switch__slider {
  background-color: var(--accent);
}

.toggle-switch input:checked + .toggle-switch__slider::after {
  transform: translateX(20px);
}

.toggle-switch input:focus-visible + .toggle-switch__slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
   Text Input
   ========================================================= */

.text-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  background: var(--input-bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: system-ui, monospace;
  font-size: 0.875rem;
  min-height: 44px;
  transition: border-color 0.15s ease;
}

.text-input::placeholder {
  color: var(--text-muted);
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* PAT input row — input + action buttons on same line */
.pat-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* =========================================================
   Toast Notifications
   ========================================================= */

.toast-container {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  max-width: min(90vw, 380px);
  width: 100%;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--text);
  color: var(--bg);
  font-family: system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  animation: toast-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.toast--exiting {
  animation: toast-out 0.2s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(4px) scale(0.96); }
}

/* Error toast variant */
.toast--error {
  background: #C0392B;
  color: #fff;
}

/* =========================================================
   Responsive Adjustments
   ========================================================= */

@media (min-width: 640px) {
  .feed-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .bottom-sheet {
    max-width: 520px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    animation: sheet-slide-up-centered 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    border-radius: 20px 20px 0 0;
  }

  @keyframes sheet-slide-up-centered {
    from { transform: translateX(-50%) translateY(100%); }
    to   { transform: translateX(-50%) translateY(0); }
  }
}
