/*
 * AnimeOshi External Pages — Shared Stylesheet
 * Version: v1
 * Hosted:  gs://animeoshi-external/shared/ao-external.v1.css
 * URL:     https://www.animeoshi.com/shared/ao-external.v1.css
 *
 * IMMUTABLE — do not edit in place.
 * Breaking changes → bump to ao-external.v2.css
 * Additive patches → ao-external.v1.1.css (loaded alongside v1)
 */

/* ================================================================
   DESIGN TOKENS
   ================================================================ */
:root {
  /* Raw palette */
  --charcoal:     hsl(271, 45%, 9%);
  --charcoal-10:  hsla(271, 45%, 9%, 0.10);
  --charcoal-20:  hsla(271, 45%, 9%, 0.20);
  --charcoal-50:  hsla(271, 45%, 9%, 0.50);
  --charcoal-70:  hsla(271, 45%, 9%, 0.70);
  --charcoal-80:  hsla(271, 45%, 9%, 0.80);
  --pebble:       hsl(0, 0%, 93%);
  --pebble-10:    hsla(0, 0%, 93%, 0.10);
  --pebble-15:    hsla(0, 0%, 93%, 0.15);
  --pebble-20:    hsla(0, 0%, 93%, 0.20);
  --pebble-50:    hsla(0, 0%, 93%, 0.50);
  --ivory:        hsl(0, 0%, 100%);
  --black:        hsl(0, 0%, 0%);

  /* Vibe palette */
  --sundrop:      hsl(68,  100%, 50%);
  --peach-spark:  hsl(23,  100%, 50%);
  --mint-pop:     hsl(88,  89%,  59%);
  --cotton-sky:   hsl(174, 100%, 50%);
  --aqua-zap:     hsl(203, 100%, 50%);
  --mochi:        hsl(282, 100%, 63%);
  --kawaii-core:  hsl(305, 100%, 76%);
  --cherry-top:   hsl(0,   85%,  60%);
  --marine-blue:  hsl(210, 100%, 45%);

  /* Semantic — dark mode (Bliss) */
  --color-bg:               hsl(271, 45%, 9%);
  --color-surface:          hsl(271, 35%, 13%);
  --color-surface-overlay:  hsl(271, 25%, 18%);
  --color-overlay:          rgba(0, 0, 0, 0.60);
  --color-text-primary:     hsl(0, 0%, 93%);
  --color-text-secondary:   hsl(0, 0%, 65%);
  --color-text-tertiary:    hsl(0, 0%, 42%);
  --color-border:           hsl(271, 20%, 22%);
  --color-border-light:     hsl(271, 20%, 16%);
  --color-accent:           var(--sundrop);
  --color-success:          var(--mint-pop);
  --color-warning:          var(--peach-spark);
  --color-danger:           var(--cherry-top);
  --color-button:           var(--sundrop);
  --color-button-text:      hsl(271, 45%, 9%);
  --color-button-inverse:   hsl(0, 0%, 93%);
  --color-button-disabled:  hsl(271, 20%, 30%);

  /* Spacing — 4px baseline */
  --spacing-xs:   0.25rem;
  --spacing-sm:   0.5rem;
  --spacing-md:   1rem;
  --spacing-lg:   1.5rem;
  --spacing-xl:   2rem;
  --spacing-2xl:  2.5rem;
  --spacing-3xl:  3rem;
  --spacing-5xl:  4rem;
  --spacing-7xl:  5rem;
  --spacing-9xl:  6rem;
  --spacing-10xl: 6.5rem;

  /* Border radius */
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --radius-2xl:   20px;
  --radius-panel: 30px;
  --radius-max:   100px;
  --radius-full:  9999px;

  /* Border width */
  --border-thin:   0.5px;
  --border-normal: 1px;
  --border-large:  1.5px;
  --border-thick:  2px;

  /* Typography */
  --font-heading:         'Bricolage Grotesque', sans-serif;
  --font-body:            'Bricolage Grotesque', sans-serif;
  --font-weight-light:    300;
  --font-weight-normal:   400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;
  --font-weight-bolder:   800;
  --font-weight-boldest:  900;
  --line-height-xs:       1.2;
  --line-height-sm:       1.5;
  --line-height-base:     1.75;
  --line-height-lg:       2;

  /* Fluid type scale */
  --h1-font-size:      clamp(2.5rem,   5vw,   3.75rem);
  --h2-font-size:      clamp(2.5rem,   4.5vw, 3.25rem);
  --h3-font-size:      clamp(2rem,     3.5vw, 2.625rem);
  --h4-font-size:      clamp(1.5rem,   2.5vw, 2rem);
  --h5-font-size:      clamp(1rem,     2vw,   1.5rem);
  --h6-font-size:      clamp(0.875rem, 1.5vw, 1rem);
  --p-large-font-size: clamp(1rem,     1.5vw, 1.125rem);
  --p-font-size:       clamp(0.75rem,  1.2vw, 1rem);
  --p-small-font-size: clamp(0.625rem, 1vw,   0.75rem);
  --btn-font-size:     clamp(0.75rem,  1vw,   0.875rem);

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.30);

  /* Backdrop blur */
  --blur-sm: 5px;
  --blur-md: 10px;
  --blur-lg: 15px;
  --blur-xl: 30px;

  /* Layout */
  --header-height: 80px;
}

/* Light mode overrides */
html.light {
  --color-bg:               hsl(0, 0%, 100%);
  --color-surface:          hsl(0, 0%, 96%);
  --color-surface-overlay:  hsl(0, 0%, 90%);
  --color-overlay:          rgba(0, 0, 0, 0.40);
  --color-text-primary:     hsl(271, 45%, 9%);
  --color-text-secondary:   hsl(271, 20%, 35%);
  --color-text-tertiary:    hsl(271, 10%, 55%);
  --color-border:           hsl(0, 0%, 85%);
  --color-border-light:     hsl(0, 0%, 92%);
  --color-accent:           var(--kawaii-core);
  --color-button:           var(--kawaii-core);
  --color-button-text:      hsl(271, 45%, 9%);
  --color-button-disabled:  hsl(0, 0%, 80%);
}

/* ================================================================
   BASE RESET
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
h1 { font-size: var(--h1-font-size); font-weight: var(--font-weight-bold);     line-height: var(--line-height-xs); }
h2 { font-size: var(--h2-font-size); font-weight: var(--font-weight-bold);     line-height: var(--line-height-xs); }
h3 { font-size: var(--h3-font-size); font-weight: var(--font-weight-bold);     line-height: var(--line-height-sm); }
h4 { font-size: var(--h4-font-size); font-weight: var(--font-weight-semibold); line-height: var(--line-height-sm); }
h5 { font-size: var(--h5-font-size); font-weight: var(--font-weight-semibold); line-height: var(--line-height-sm); }
h6 { font-size: var(--h6-font-size); font-weight: var(--font-weight-medium);   line-height: var(--line-height-base); }
p  { font-size: var(--p-font-size);  line-height: var(--line-height-base);     color: var(--color-text-secondary); }

/* ================================================================
   LAYOUT UTILITIES
   ================================================================ */
.page-content { padding-top: var(--header-height); min-height: 100vh; }
.container    { max-width: 1200px; margin: 0 auto; padding: 0 var(--spacing-xl); }
.section      { padding: var(--spacing-5xl) 0; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-max);
  font-family: var(--font-body);
  font-size: var(--btn-font-size);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  cursor: pointer;
  border: var(--border-normal) solid transparent;
  transition: opacity 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover  { opacity: 0.85; }
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary   { background: var(--color-button); color: var(--color-button-text); }
.btn-secondary { background: var(--color-surface); color: var(--color-text-primary); border-color: var(--color-border); }
.btn-outline   { background: transparent; color: var(--color-accent); border-color: var(--color-accent); }
.btn-danger    { background: var(--color-danger); color: var(--ivory); }
.btn-ghost     { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { background: var(--color-surface); color: var(--color-text-primary); opacity: 1; }
.btn-sm { padding: var(--spacing-xs) var(--spacing-md);  font-size: var(--p-small-font-size); }
.btn-lg { padding: var(--spacing-md) var(--spacing-2xl); font-size: var(--p-large-font-size); }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--color-surface);
  border: var(--border-normal) solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover { border-color: var(--color-accent); box-shadow: var(--shadow-md); }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--spacing-sm);
  border-radius: var(--radius-max);
  font-size: var(--p-small-font-size);
  font-weight: var(--font-weight-semibold);
  background: var(--color-surface-overlay);
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.badge-accent  { background: var(--color-accent);  color: var(--color-button-text); }
.badge-success { background: var(--color-success); color: var(--color-button-text); }
.badge-warning { background: var(--color-warning); color: var(--color-button-text); }
.badge-danger  { background: var(--color-danger);  color: var(--ivory); }
.badge-info    { background: var(--cotton-sky);    color: var(--color-button-text); }

/* ================================================================
   DIVIDER
   ================================================================ */
.divider { width: 100%; height: var(--border-normal); background: var(--color-border); margin: var(--spacing-lg) 0; }

/* ================================================================
   HEADER — floating pill bar, 96px inset
   ================================================================ */
#ao-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 8px 96px;
  z-index: 50;
  background: transparent;
}
.ao-header-bar {
  background: var(--color-bg);
  border-radius: var(--radius-full);
  padding: 4px 16px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
}
.ao-header-left { display: flex; align-items: center; gap: 16px; }
.ao-logo { display: flex; align-items: center; flex-shrink: 0; }
.ao-logo img { height: 56px; width: auto; }

.ao-nav { display: flex; align-items: center; gap: 8px; }
.ao-nav-link,
.ao-nav-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  color: var(--ivory);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.3s, color 0.3s, opacity 0.3s;
}
.ao-nav-link:hover,
.ao-nav-trigger:hover { background: var(--pebble-10); }
.ao-nav-icon { width: 20px; height: 20px; flex-shrink: 0; }

.ao-nav-dropdown { position: relative; display: inline-flex; }
.ao-nav-trigger::after,
.ao-nav-link::after { display: none; content: none; }
.ao-nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  padding: 4px;
  background: var(--color-bg);
  border-radius: 12px;
  z-index: 99;
}
.ao-nav-dropdown.open .ao-nav-menu { display: flex; flex-direction: column; }
.ao-nav-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  color: var(--pebble);
  white-space: nowrap;
  transition: background 0.15s ease;
}
.ao-nav-menu a:hover { background: var(--pebble-10); }

#ao-header-auth { display: flex; align-items: center; flex-shrink: 0; }
#ao-auth-btn {
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: none;
  color: var(--charcoal);
  background: var(--pebble);
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}
#ao-auth-btn:hover { opacity: 0.88; }

.ao-profile-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--pebble-10);
  color: var(--pebble);
  font-size: 14px; font-weight: var(--font-weight-semibold);
  font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease; text-decoration: none;
}
.ao-profile-pill:hover { background: var(--pebble-20); }
.ao-user-avatar { width: 24px; height: 24px; border-radius: var(--radius-full); object-fit: cover; flex-shrink: 0; }

@media (max-width: 1024px) { #ao-header { padding: 8px 24px; } }
@media (max-width: 768px)  { #ao-header { padding: 8px 16px; } .ao-nav { display: none; } }

/* ================================================================
   FOOTER
   ================================================================ */
#ao-footer {
  background: var(--pebble-10);
  border-top: 1px solid var(--pebble-20);
  padding: 48px;
  margin-top: var(--spacing-5xl);
}
.ao-footer-inner {
  max-width: 1392px; margin: 0 auto; padding: 0 24px;
  display: flex; gap: 56px; justify-content: space-between; align-items: flex-start;
}
.ao-footer-left { display: flex; flex-direction: column; gap: 24px; flex-shrink: 0; width: 300px; align-items: flex-start; }
.ao-footer-right { display: flex; flex: 1; gap: 56px; flex-wrap: wrap; }
.ao-footer-group { display: flex; flex-direction: column; gap: 16px; width: 160px; }
.ao-footer-group-label { font-size: 16px; font-weight: var(--font-weight-semibold); color: var(--pebble); line-height: 1.2; margin: 0; padding: 0; }
.ao-footer-group ul { display: flex; flex-direction: column; gap: 8px; list-style: none; padding: 0; margin: 0; }
.ao-footer-group a { font-size: 14px; font-weight: var(--font-weight-normal); color: hsla(0, 0%, 93%, 0.8); transition: color 0.15s ease; }
.ao-footer-group a:hover { color: var(--pebble); }
.ao-footer-social { display: flex; align-items: center; gap: 8px; }
.ao-footer-social a { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--color-bg); color: var(--pebble); transition: opacity 0.15s ease; }
.ao-footer-social a:hover { opacity: 0.85; }
.ao-footer-copyright { font-size: 14px; color: hsla(0, 0%, 93%, 0.8); line-height: 1.6; }
@media (max-width: 1024px) {
  #ao-footer { padding: 32px 16px; }
  .ao-footer-inner { flex-direction: column; gap: 32px; padding: 0; }
  .ao-footer-left { width: 100%; }
  .ao-footer-right { gap: 24px; }
  .ao-footer-group { width: calc(50% - 12px); }
}

/* ================================================================
   LOGIN MODAL
   ================================================================ */
#ao-auth-modal {
  display: none; position: fixed; inset: 0; background: var(--color-overlay);
  z-index: 200; align-items: center; justify-content: center; padding: var(--spacing-md);
}
#ao-auth-modal.open { display: flex; }
.ao-modal-box {
  background: var(--color-surface); border: var(--border-normal) solid var(--color-border);
  border-radius: var(--radius-2xl); padding: var(--spacing-3xl);
  width: 100%; max-width: 420px; position: relative; box-shadow: var(--shadow-lg);
}
.ao-modal-close {
  position: absolute; top: var(--spacing-md); right: var(--spacing-md);
  width: 32px; height: 32px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface-overlay); color: var(--color-text-secondary);
  font-size: 1rem; cursor: pointer; border: none; font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease; line-height: 1;
}
.ao-modal-close:hover { background: var(--color-border); color: var(--color-text-primary); }
.ao-modal-title { font-size: var(--h5-font-size); font-weight: var(--font-weight-bold); color: var(--color-text-primary); margin-bottom: var(--spacing-xs); }
.ao-modal-subtitle { font-size: var(--p-font-size); color: var(--color-text-secondary); margin-bottom: var(--spacing-xl); line-height: var(--line-height-sm); }
.ao-modal-or { display: flex; align-items: center; gap: var(--spacing-md); margin: var(--spacing-lg) 0; color: var(--color-text-tertiary); font-size: var(--p-small-font-size); }
.ao-modal-or::before, .ao-modal-or::after { content: ''; flex: 1; height: var(--border-thin); background: var(--color-border); }
.ao-form-group { margin-bottom: var(--spacing-md); }
.ao-form-label { display: block; font-size: var(--p-small-font-size); font-weight: var(--font-weight-medium); color: var(--color-text-secondary); margin-bottom: var(--spacing-xs); }
.ao-form-input { width: 100%; padding: var(--spacing-sm) var(--spacing-md); background: var(--color-bg); border: var(--border-normal) solid var(--color-border); border-radius: var(--radius-md); color: var(--color-text-primary); font-family: inherit; font-size: var(--p-font-size); outline: none; transition: border-color 0.15s ease; }
.ao-form-input:focus { border-color: var(--color-accent); }
.ao-form-input::placeholder { color: var(--color-text-tertiary); }
.ao-btn-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: var(--spacing-sm); padding: var(--spacing-sm) var(--spacing-md); background: var(--marine-blue); color: var(--ivory); border-radius: var(--radius-md); font-family: inherit; font-size: var(--p-font-size); font-weight: var(--font-weight-semibold); cursor: pointer; border: none; transition: opacity 0.15s ease; }
.ao-btn-google:hover { opacity: 0.88; }
.ao-btn-google:disabled { opacity: 0.5; cursor: not-allowed; }
.ao-btn-email { width: 100%; padding: var(--spacing-sm) var(--spacing-md); background: var(--color-button); color: var(--color-button-text); border-radius: var(--radius-md); font-family: inherit; font-size: var(--p-font-size); font-weight: var(--font-weight-semibold); cursor: pointer; border: none; transition: opacity 0.15s ease; }
.ao-btn-email:hover { opacity: 0.88; }
.ao-btn-email:disabled { opacity: 0.5; cursor: not-allowed; }
.ao-modal-success { text-align: center; padding: var(--spacing-xl) 0; }
.ao-modal-success-icon { font-size: 2.5rem; margin-bottom: var(--spacing-md); }
.ao-modal-success p { font-size: var(--p-font-size); color: var(--color-text-secondary); line-height: 1.6; }
.ao-modal-success strong { color: var(--color-text-primary); }

/* ================================================================
   TOASTS
   ================================================================ */
#ao-toasts {
  position: fixed; bottom: var(--spacing-xl); right: var(--spacing-xl);
  z-index: 300; display: flex; flex-direction: column; gap: var(--spacing-sm); pointer-events: none;
}
.ao-toast {
  display: flex; align-items: center; gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-surface); border: var(--border-normal) solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  font-size: var(--p-font-size); color: var(--color-text-primary);
  max-width: 340px; pointer-events: all; animation: ao-toast-in 0.25s ease;
}
.ao-toast.out { animation: ao-toast-out 0.25s ease forwards; }
.ao-toast-icon { font-size: 1rem; flex-shrink: 0; }
.ao-toast-success .ao-toast-icon { color: var(--color-success); }
.ao-toast-error   .ao-toast-icon { color: var(--color-danger); }
.ao-toast-warning .ao-toast-icon { color: var(--color-warning); }
.ao-toast-info    .ao-toast-icon { color: var(--cotton-sky); }
@keyframes ao-toast-in  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ao-toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(10px); } }
@media (max-width: 480px) {
  #ao-toasts { left: var(--spacing-md); right: var(--spacing-md); bottom: var(--spacing-md); }
  .ao-toast { max-width: 100%; }
}

/* ================================================================
   LOADING OVERLAY
   ================================================================ */
#ao-loading {
  display: none; position: fixed; inset: 0; background: var(--color-overlay);
  z-index: 500; align-items: center; justify-content: center;
}
#ao-loading.active { display: flex; }
.ao-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--color-border); border-top-color: var(--color-accent);
  border-radius: 50%; animation: ao-spin 0.75s linear infinite;
}
@keyframes ao-spin { to { transform: rotate(360deg); } }
