/*
 * PROPRIETARY AND CONFIDENTIAL - Copyright (c) 2024-2026 Strykora. All Rights Reserved. Developer: Andreas Haskell-Horn | Contact info@strykora.co.uk - Copying/replicating/reuse is copyright infringement and unlawful. Contact info@strykora.co.uk for licence.
 */

/* ==========================================================================
   Diana Beauty School Plymouth — design tokens + shared components
   Palettes are deliberately dual (both preserved from templates/):
     • marketing  = gallery dark  (landing.html)
     • portal     = cream warm    (index.html / index.css)
   ========================================================================== */

:root {
  /* ── Marquee / marketing (landing.html) ─────────────────────── */
  --ink: #0a0a0a;
  --ink-2: #111111;
  --gold: #c9a86a;
  --gold-2: #d4af37;
  --gold-light: #f5d78e;
  --gold-deep: #9a7a42;      /* 5.1:1 on cream — use for text on light */
  --cream: #faf8f5;
  --line: #e8e0cf;
  --muted: #7a736a;

  /* ── Portal / chat (index.css) ──────────────────────────────── */
  --surface: #fff8f0;
  --surface-2: #f7ebd8;
  --chat-line: #e8d9be;
  --chat-muted: #6d6355;
  --chat-text: #171512;

  /* ── Status ─────────────────────────────────────────────────── */
  --ok: #4a7c59;
  --warn: #c9a86a;
  --danger: #8a3d2b;

  /* ── Type ───────────────────────────────────────────────────── */
  --serif: "Playfair Display", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --chat-serif: "Cormorant Garamond", var(--serif);
  --chat-sans: "Jost", var(--sans);

  /* ── Metrics ────────────────────────────────────────────────── */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 10px 40px rgba(201, 168, 106, 0.14);
  --shadow-dark: 0 24px 70px rgba(0, 0, 0, 0.45);
  --tap: 44px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-curtain: cubic-bezier(0.76, 0, 0.24, 1);
  --max: 1280px;
}

/* Portal light theme (cream warm) */
.theme-cream {
  --bg: var(--cream);
  --bg-2: #f1ebdd;
  --card: #ffffff;
  --text: #141414;
  --t-muted: var(--muted);
  --border: var(--line);
}

/* Portal dark theme */
.theme-ink {
  --bg: #0a0a0a;
  --bg-2: #161616;
  --card: #151515;
  --text: #f5f0e6;
  --t-muted: #a89e8f;
  --border: #2b2b2b;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; }
p { margin: 0; }
img, video, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ==========================================================================
   Accessibility floor (WCAG 2.2 AA — blocking)
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 999;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: top 0.25s var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   Typography helpers
   ========================================================================== */
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.display { font-size: clamp(2.6rem, 8vw, 5.2rem); line-height: 0.98; letter-spacing: -0.02em; }
.h2 { font-size: clamp(2rem, 6vw, 3.4rem); }
.h3 { font-size: 1.35rem; font-weight: 600; }
.lead { font-size: clamp(1rem, 2vw, 1.15rem); line-height: 1.7; }
.small { font-size: 13px; }

.gold-text {
  background: linear-gradient(100deg, var(--gold-light), var(--gold) 45%, var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.italic { font-style: italic; }

.gold-rule {
  height: 2px;
  width: 96px;
  border: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 1.1s var(--ease-out) 0.25s;
}
.in-view .gold-rule, .gold-rule.in-view { transform: scaleX(1); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gold);
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #0a0a0a;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(201, 168, 106, 0.28); }
.btn:active { transform: translateY(0); }

/* button shimmer — hover only */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%);
  background-size: 200% 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.btn:hover::after { opacity: 1; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.btn-outline { background: transparent; color: var(--gold); }
.btn-outline:hover { background: rgba(201, 168, 106, 0.1); }

.btn-ghost {
  background: transparent;
  border-color: var(--border, var(--line));
  color: inherit;
}
.btn-ghost:hover { border-color: var(--gold); }

.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 8px 16px; font-size: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn.is-busy { color: transparent; pointer-events: none; }
.btn.is-busy::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(10, 10, 10, 0.35);
  border-top-color: #0a0a0a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: var(--tap);
  height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border, var(--line));
  background: var(--card, transparent);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
}
.icon-btn:hover { border-color: var(--gold); }

/* ==========================================================================
   Surfaces, cards, badges
   ========================================================================== */
.card {
  background: var(--card, #fff);
  border: 1px solid var(--border, var(--line));
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-gold { background: rgba(201, 168, 106, 0.16); color: var(--gold-deep); border: 1px solid var(--gold); }
.badge-ok { background: rgba(74, 124, 89, 0.14); color: var(--ok); border: 1px solid var(--ok); }
.badge-danger { background: rgba(138, 61, 43, 0.1); color: var(--danger); border: 1px solid var(--danger); }
.theme-ink .badge-gold { color: var(--gold-light); }

/* ==========================================================================
   Form controls
   ========================================================================== */
.field { display: block; margin-bottom: 14px; }
.field > span,
label.lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t-muted, var(--muted));
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 13px;
  border: 1px solid var(--border, var(--line));
  border-radius: var(--radius-sm);
  background: var(--bg, #fff);
  color: var(--text, #141414);
  font-family: var(--sans);
  font-size: 14px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.2);
}
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }

.err-msg {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  margin-top: 5px;
  min-height: 16px;
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(24px) scale(0.97);
  background: #0a0a0a;
  color: var(--cream);
  border: 1px solid var(--gold);
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
  max-width: min(92vw, 460px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 400;
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

/* ==========================================================================
   Modal (max 520px, 88vh, focus trap, Escape)
   ========================================================================== */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s;
}
.modal-bg.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--card, #fff);
  color: var(--text, #141414);
  border: 1px solid var(--border, var(--line));
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow: auto;
  padding: 24px;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.32s var(--ease-out);
}
.modal-bg.open .modal { transform: none; }

/* ==========================================================================
   Empty / loading states
   ========================================================================== */
.empty {
  text-align: center;
  padding: 34px 20px;
  border: 1px dashed var(--border, var(--line));
  border-radius: var(--radius);
  color: var(--t-muted, var(--muted));
}
.empty strong { display: block; font-family: var(--serif); font-size: 1.1rem; color: var(--text, #141414); margin-bottom: 6px; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: skel 1.4s ease-in-out infinite;
  min-height: 16px;
}
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ==========================================================================
   Motion — reveal / reduced motion
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(34px);
}

/*
 * The entrance is an ANIMATION, not a transition, on purpose.
 *
 * With transition-delay the stagger delay sits on the element permanently and
 * is inherited by every other transition on it — so hovering the fourth card
 * in a grid lifted it 300 ms late. animation-delay affects only this entrance
 * and leaves hover transitions untouched.
 *
 * fill-mode "backwards" holds the hidden start state during the delay, then
 * releases the element when the animation ends. Deliberately NOT "forwards":
 * a filling animation keeps winning over the hover transform, which would
 * stop cards lifting at all.
 */
.reveal.in-view {
  opacity: 1;
  transform: none;
  animation: reveal-up 0.9s var(--ease-out) backwards;
  animation-delay: var(--stagger, 0ms);
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(34px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .reveal.in-view { animation: none; animation-delay: 0ms !important; }
  .gold-rule { transform: scaleX(1); }
}
