/*##############################################################################
# Script:        styles.css          (stylesheet, loaded by frontend/index.html, the login, password and System pages)
# Version:       1.10
# Created by:    Matthew Boucher
# Start date:    2026-09-10
# Location:      <project root>/frontend/css/styles.css   (main script: <project root>/aiacolyte.py; subscripts: <project root>/subscripts/aiacolyte/)
# Description:   The shared look of AI Acolyte, first of the home page's three stylesheets: the colour
#                tokens (palette pulled from the painting: candlelit umber, starry indigo, conjured gold
#                and a thread of arcane blue for the AI half of the magic), fonts, base elements,
#                buttons, the header with its clickable "A part of Mythical Layers 3D" line, the
#                keyframes and the reduced-motion rules. styles-hero.css (the wizard's workshop hero)
#                and styles-sections.css (spellbook, chalkboard, quote band, Oracle, contact scroll,
#                footer) load after it, in that order. The login, password and System pages use this
#                file with admin.css. Works with the main script, which serves it as /static/css/styles.css.
# Reads:         the font families defined in fonts.css
# Writes:        nothing
# Sensitive:     none needed
# Arguments:     none (a stylesheet cannot take flags); aiacolyte.py --checkup confirms it is in place
# Changelog (last 15):
#   1.10  2026-09-10  Split because it was over 1500 lines (rule 9): the hero moved to styles-hero.css, the page sections and footer to styles-sections.css; keyframes and reduced motion stay here for every page.
#   1.09  2026-09-10  Hero: the two buttons stand in a column to the right of the heading and intro (below them on phones); the terminal floats lower on wide screens so they never overlap; the menu stays on one line.
#   1.08  2026-09-10  Contact form rows: first/last name and email/phone side by side, one column when the form is narrow; "(optional)" note style.
#   1.07  2026-09-10  "A part of Mythical Layers 3D" is right-aligned with the end of the AI ACOLYTE name above it.
#   1.06  2026-09-10  "A part of Mythical Layers 3D" link: underline, arrow and brighter hover so it reads as clickable.
#   1.05  2026-09-10  Styles for the parent-site line under the header brand.
#   1.04  2026-09-10  Standard header and footer.
#   1.03  2026-09-10  Phone layout fixed (the one-column rule now follows the grid rules); hero scene centred on tablets.
#   1.02  2026-09-10  Deeper crystal ball, clean MAGIC glow on the chalkboard, contact eyebrow size, even form spacing.
#   1.01  2026-09-10  First version of the styles.
##############################################################################*/

:root {
  --ink-0: #0a0807;
  --ink-1: #110e0b;
  --ink-2: #1a1511;
  --indigo: #2b2766;
  --indigo-deep: #16143a;
  --gold: #e3b04b;
  --gold-bright: #f6d88b;
  --gold-deep: #a8792a;
  --arcane: #8cc8ff;
  --text: #efe6d2;
  --text-dim: #bfb196;
  --text-faint: #8f836d;
  --parchment: #ecdfc2;
  --parchment-ink: #2b2016;
  --line: rgba(227, 176, 75, 0.22);

  --font-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --font-body: "Cormorant Garamond", "EB Garamond", Garamond, Georgia, serif;
  --font-chalk: "Cabin Sketch", "Chalkboard SE", "Comic Sans MS", cursive;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --nav-h: 72px;
  --wrap: 1200px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  background: var(--ink-1);
  color: var(--text);
  font: 500 1.2rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Oil-canvas grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(2.1rem, 4.2vw, 3.3rem);
  color: var(--parchment);
}

.eyebrow + h2 {
  margin-top: 16px;
}

p {
  margin: 0;
}

h1 em,
h2 em {
  font-style: normal;
  text-shadow: none;
  background: linear-gradient(180deg, #fff3cf 0%, var(--gold-bright) 30%, var(--gold) 62%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(227, 176, 75, 0.3));
}

::selection {
  background: rgba(227, 176, 75, 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

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

.svg-defs {
  position: absolute;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 300;
  padding: 0.6em 1em;
  font-family: var(--font-display);
  color: var(--ink-0);
  text-decoration: none;
  background: var(--gold);
  border-radius: 4px;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
}

.section {
  position: relative;
  padding: clamp(84px, 11vw, 150px) var(--gutter);
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow span {
  margin-right: 0.4em;
}

/* Scroll reveals (only when JS is running) */
.js [data-reveal] {
  opacity: 0;
  translate: 0 28px;
  transition: opacity 1s var(--ease), translate 1s var(--ease);
  transition-delay: calc(var(--i, 0) * 110ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  translate: none;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 1em 1.7em;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: #1b1307;
  background: linear-gradient(180deg, #f7dc92 0%, #e3b04b 55%, #b98433 100%);
  border: 1px solid #f7dc92;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(90, 60, 20, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.3s, border-color 0.3s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(90, 60, 20, 0.35), 0 0 28px rgba(227, 176, 75, 0.45), 0 12px 30px rgba(0, 0, 0, 0.45);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.btn--ghost {
  color: var(--gold-bright);
  background: rgba(17, 14, 11, 0.35);
  border-color: rgba(246, 216, 139, 0.45);
  box-shadow: none;
}

.btn--ghost:hover {
  background-color: rgba(227, 176, 75, 0.1);
  border-color: var(--gold-bright);
  box-shadow: 0 0 24px rgba(227, 176, 75, 0.25);
}

.btn--ink {
  color: var(--gold-bright);
  background: linear-gradient(180deg, #3a3478 0%, #221e52 60%, #16143a 100%);
  border-color: rgba(246, 216, 139, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 20px rgba(43, 32, 22, 0.35);
}

.btn--ink:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 24px rgba(91, 84, 201, 0.45), 0 12px 26px rgba(43, 32, 22, 0.45);
}

.btn--small {
  padding: 0.75em 1.2em;
  font-size: 0.72rem;
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--nav-h);
  padding-inline: var(--gutter);
  transition: background-color 0.4s, box-shadow 0.4s;
}

.nav.is-scrolled,
.nav.is-open {
  background: rgba(12, 10, 8, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold-bright);
}

.brand__sigil {
  width: 34px;
  height: 28px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(227, 176, 75, 0.5));
}

.brand__star {
  fill: var(--gold-bright);
  stroke: none;
}

/* "A part of Mythical Layers 3D", under the brand and right-aligned with the
   end of its name, links to the Mythical Layers 3D website */
.nav__id {
  display: grid;
  gap: 3px;
}

.nav__parent {
  /* width 0 + min-width 100% matches the brand's width, so this line wraps
     instead of widening the header and crowding the menu */
  width: 0;
  min-width: 100%;
  /* the brand's letter-spacing (0.14em of 1.12rem) leaves a gap after its last
     letter; the same gap here lines the two right edges up */
  padding-right: 0.157rem;
  text-align: right;
  font-size: 0.86rem;
  font-style: italic;
  line-height: 1.2;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s;
}

.nav__parent span {
  color: var(--gold);
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: rgba(227, 176, 75, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.3s, text-shadow 0.3s, text-decoration-color 0.3s;
}

.nav__parent-arrow {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-left: 0.3em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}

.nav__parent:hover,
.nav__parent:hover span {
  color: var(--gold-bright);
}

.nav__parent:hover span {
  text-decoration-color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(227, 176, 75, 0.5);
}

.nav__parent:hover .nav__parent-arrow {
  transform: translate(1px, -1px);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 36px);
}

.nav__links a:not(.btn) {
  position: relative;
  padding-block: 0.4em;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  transition: color 0.3s;
}

.nav__links a:not(.btn)::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0);
  transition: transform 0.35s var(--ease);
}

.nav__links a:not(.btn):hover {
  color: var(--gold-bright);
}

.nav__links a:not(.btn):hover::after {
  transform: scaleX(1);
}

.nav__toggle {
  display: none;
}

/* mid-width screens: the menu keeps to one line (Log in is in the footer there) */
@media (min-width: 761px) and (max-width: 1000px) {
  #nav-account {
    display: none;
  }
}

@media (max-width: 760px) {
  .nav__toggle {
    display: grid;
    place-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 1px solid var(--line);
    border-radius: 4px;
    cursor: pointer;
  }

  .nav__toggle span:not(.visually-hidden) {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--gold-bright);
    transition: transform 0.3s, opacity 0.3s;
  }

  .nav.is-open .nav__toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  .nav.is-open .nav__toggle span:nth-child(2) {
    opacity: 0;
  }

  .nav.is-open .nav__toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .nav__links {
    position: absolute;
    top: var(--nav-h);
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: rgba(12, 10, 8, 0.97);
    box-shadow: 0 1px 0 var(--line), 0 20px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  }

  .nav.is-open .nav__links {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav__links a:not(.btn) {
    padding-block: 14px;
    border-bottom: 1px solid rgba(227, 176, 75, 0.1);
  }

  .nav__links .btn {
    margin-top: 16px;
  }
}


/* ==========================================================================
   Keyframes & motion preferences
   ========================================================================== */

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-10px) rotate(1.5deg); }
}

@keyframes hover-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes flicker {
  0%, 47%, 100% { opacity: 0.92; }
  48% { opacity: 0.55; }
  49% { opacity: 1; }
  72% { opacity: 0.84; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes cast {
  0%, 100% { filter: brightness(1); }
  25% { filter: brightness(1.45) saturate(1.2); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes rise {
  from { opacity: 0; translate: 0 12px; }
  to { opacity: 1; translate: none; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/*##############################################################################
# End of styles.css  v1.10
##############################################################################*/
