/* ============================================================
   Papi Labs, papi.tech
   Vanilla CSS, no build step. Mobile-first.
   Light + dark theme via [data-theme]. Accessibility widget.
   Brand: Fraunces (display) + Inter (body), copper accent.
============================================================ */

/* ============================================================
   THEME TOKENS
============================================================ */
:root {
  --copper: #E07A3C;
  --copper-deep: #B85C28;
  --copper-glow: rgba(224, 122, 60, 0.15);

  /* Semantic colour tokens (light theme) */
  --bg: #FBF8F3;
  --bg-soft: #F6F1E8;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --border: #EFE9DD;
  --border-strong: rgba(14, 24, 48, 0.18);

  --text: #0E1830;
  --text-soft: #2A3650;
  --text-muted: #6B6863;
  --text-on-copper: #FFFFFF;
  --text-on-ink: #F6F1E8;

  /* Constants */
  --ink: #0E1830;
  --cream: #F6F1E8;
  --sage: #7A8B6F;

  /* Layout */
  --max-width: 1120px;
  --max-prose: 680px;

  /* Type */
  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --text-scale: 1;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg: #0A0F1F;
  --bg-soft: #11182E;
  --bg-card: #161D36;
  --bg-elevated: #1B2240;
  --border: rgba(246, 241, 232, 0.10);
  --border-strong: rgba(246, 241, 232, 0.25);

  --text: #F6F1E8;
  --text-soft: rgba(246, 241, 232, 0.82);
  --text-muted: rgba(246, 241, 232, 0.55);
  --copper-glow: rgba(224, 122, 60, 0.22);
}

/* High contrast */
[data-high-contrast="true"] {
  --text: #000000;
  --text-soft: #000000;
  --text-muted: #1A1A1A;
  --bg: #FFFFFF;
  --bg-soft: #FFFFFF;
  --bg-card: #FFFFFF;
  --border: #000000;
  --border-strong: #000000;
}
[data-high-contrast="true"][data-theme="dark"] {
  --text: #FFFFFF;
  --text-soft: #FFFFFF;
  --text-muted: #E0E0E0;
  --bg: #000000;
  --bg-soft: #000000;
  --bg-card: #000000;
  --border: #FFFFFF;
  --border-strong: #FFFFFF;
}

/* System reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Underline links default on, can be turned off */
[data-underline-links="false"] a:not(.btn):not(.wordmark) { text-decoration: none; }
a:not(.btn):not(.wordmark) { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(224, 122, 60, 0.35); text-decoration-thickness: 1px; }
nav.top a, .product .cta, .pathway .cta, footer a { text-decoration: none; }
[data-underline-links="false"] nav.top a, [data-underline-links="false"] .product .cta, [data-underline-links="false"] .pathway .cta, [data-underline-links="false"] footer a { text-decoration: none; }


/* ============================================================
   RESET + BASE
============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
  zoom: var(--text-scale);
}

::selection { background: var(--copper); color: white; }

a { color: inherit; transition: color 0.2s var(--ease); }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }


/* ============================================================
   LAYOUT
============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .container { padding: 0 40px; }
}


/* ============================================================
   TYPOGRAPHY
============================================================ */
.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper-deep);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

[data-theme="dark"] .eyebrow { color: var(--copper); }

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--copper);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
  font-variation-settings: "SOFT" 30, "WONK" 0;
}

h1 {
  font-size: clamp(40px, 7vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(22px, 2.5vw, 28px);
  line-height: 1.2;
}

p { max-width: var(--max-prose); color: var(--text-soft); }

.lede {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  color: var(--text-soft);
  max-width: 640px;
}

strong { font-weight: 600; color: var(--text); }

em {
  font-style: italic;
  font-family: var(--font-display);
  color: var(--text);
}

/* Registered trademark mark, kept proportional to surrounding type */
.reg-mark {
  font-size: 0.45em;
  vertical-align: 0.55em;
  font-weight: 500;
  letter-spacing: 0;
  margin-left: 0.06em;
  font-family: var(--font-body);
}


/* ============================================================
   WORDMARK
============================================================ */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1;
  font-variation-settings: "SOFT" 50;
}

.wordmark .iwan {
  display: inline-block;
  margin: 0 0.06em 0 0.04em;
  vertical-align: baseline;
}

.wordmark .labs {
  margin-left: 0.18em;
  font-weight: 700;
}


/* ============================================================
   NAV
============================================================ */
nav.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

nav.top .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

nav.top .wordmark { font-size: 22px; }

nav.top ul {
  list-style: none;
  display: flex;
  gap: 32px;
}

nav.top ul a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  position: relative;
}

/* Animated underline on hover */
nav.top ul a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--copper);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

nav.top ul a:hover { color: var(--copper-deep); }
nav.top ul a:hover::after { transform: scaleX(1); }
[data-theme="dark"] nav.top ul a:hover { color: var(--copper); }

@media (max-width: 720px) {
  nav.top ul { display: none; }
}


/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.3s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 1px 2px rgba(14, 24, 48, 0.08);
}

.btn-primary:hover {
  background: var(--copper-deep);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(184, 92, 40, 0.25);
}
[data-theme="dark"] .btn-primary:hover { background: var(--copper); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.btn-secondary:hover {
  background: var(--text);
  color: var(--bg);
  transform: translateY(-1px);
}

.btn .arrow { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }


/* ============================================================
   HERO
============================================================ */
.hero {
  padding: 80px 0 96px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -120px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, var(--copper-glow), transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: drift 16s ease-in-out infinite;
  translate: var(--glow-x, 0px) var(--glow-y, 0px);
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -240px;
  left: -180px;
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, var(--copper-glow), transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  animation: drift-2 20s ease-in-out infinite;
  translate: calc(var(--glow-x, 0px) * -0.7) calc(var(--glow-y, 0px) * -0.7);
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, 40px) scale(1.08); }
  66% { transform: translate(20px, -30px) scale(1.04); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, -40px) scale(1.06); }
  66% { transform: translate(-30px, 25px) scale(1.03); }
}

.hero .container { position: relative; z-index: 1; }
.hero h1 { margin: 24px 0 28px; max-width: 920px; }
.hero h1 .copper { color: var(--copper-deep); font-style: italic; font-weight: 400; }
[data-theme="dark"] .hero h1 .copper { color: var(--copper); }

.hero .actions {
  display: flex;
  gap: 12px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.hero .scroll-cue {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 80px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.hero .scroll-cue::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--text-muted);
  opacity: 0.5;
}

@media (min-width: 768px) {
  .hero { padding: 120px 0 140px; }
}

/* Hero load animation, staggered */
.hero .eyebrow,
.hero h1,
.hero .lede,
.hero .actions,
.hero .scroll-cue {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.9s var(--ease-out) forwards;
}
.hero .eyebrow { animation-delay: 0.05s; }
.hero h1 { animation-delay: 0.18s; }
.hero .lede { animation-delay: 0.36s; }
.hero .actions { animation-delay: 0.5s; }
.hero .scroll-cue { animation-delay: 0.7s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   SECTION
============================================================ */
section {
  padding: 80px 0;
  position: relative;
}

section.alt {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

section.dark { background: var(--ink); color: var(--text-on-ink); }
[data-theme="dark"] section.dark { background: #050913; }

section.dark h2, section.dark h3 { color: var(--text-on-ink); }
section.dark p { color: rgba(246, 241, 232, 0.78); }
section.dark .eyebrow { color: var(--copper); }
section.dark .eyebrow::before { background: var(--copper); }
section.dark strong { color: var(--text-on-ink); }
section.dark em { color: var(--text-on-ink); }

.section-header {
  max-width: 760px;
  margin-bottom: 56px;
}
.section-header h2 { margin: 16px 0 16px; }
.section-header p { color: var(--text-soft); font-size: 18px; line-height: 1.55; }
section.dark .section-header p { color: rgba(246, 241, 232, 0.78); }

@media (min-width: 768px) {
  section { padding: 112px 0; }
  .section-header { margin-bottom: 72px; }
}


/* ============================================================
   PILLARS
============================================================ */
.pillars-intro {
  margin-top: 56px;
  margin-bottom: 20px;
  max-width: 760px;
}
.pillars-intro .eyebrow { margin-bottom: 12px; }
.pillars-intro h3 {
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text);
}

.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
  max-width: 980px;
}

@media (min-width: 880px) {
  .pillars { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

.pillar {
  padding: 32px 28px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.pillar:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(14, 24, 48, 0.06);
}

.pillar-num {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--copper-deep);
  font-weight: 600;
  letter-spacing: 0.05em;
}
[data-theme="dark"] .pillar-num { color: var(--copper); }

.pillar h3 {
  font-size: 22px;
  margin: 12px 0 10px;
  line-height: 1.2;
}

.pillar p { font-size: 15px; line-height: 1.55; }


/* ============================================================
   PRODUCTS
============================================================ */
.products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 720px) {
  .products { grid-template-columns: 1fr 1fr; }
}

.product {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 32px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.product:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(14, 24, 48, 0.08);
  border-color: rgba(224, 122, 60, 0.4);
}

.product.featured {
  grid-column: 1 / -1;
  padding: 48px;
  background-image: radial-gradient(circle at 90% 10%, var(--copper-glow), transparent 50%);
}

.product.featured h3 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  position: relative;
  z-index: 2;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-pill.live { background: rgba(122, 139, 111, 0.18); color: #5A6E51; }
[data-theme="dark"] .status-pill.live { background: rgba(150, 175, 130, 0.22); color: #B4C7A4; }

.status-pill.beta { background: rgba(224, 122, 60, 0.18); color: var(--copper-deep); }
[data-theme="dark"] .status-pill.beta { color: var(--copper); }

.status-pill.stealth { background: rgba(14, 24, 48, 0.10); color: var(--text); }
[data-theme="dark"] .status-pill.stealth { background: rgba(246, 241, 232, 0.12); color: var(--text); }

.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Pulse the LIVE dot subtly so live products feel alive */
.status-pill.live .dot {
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(122, 139, 111, 0); }
  50% { opacity: 0.85; transform: scale(1.4); box-shadow: 0 0 0 4px rgba(122, 139, 111, 0); }
}

.product h3 { font-size: 26px; line-height: 1.15; color: var(--text); position: relative; z-index: 2; }
.product .tagline { font-size: 16px; color: var(--text-soft); line-height: 1.55; flex: 1; position: relative; z-index: 2; }
.product.featured .tagline { font-size: 18px; max-width: 620px; }

.product .cta {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--copper-deep);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s var(--ease);
  position: relative;
  z-index: 2;
  align-self: flex-start;
}
[data-theme="dark"] .product .cta { color: var(--copper); }
.product .cta:hover { gap: 10px; }

/* Featured card watermark glyph, large, low-opacity, bottom-right.
   Multi-layered stroked iwan, reads as architecture not as a gravestone. */
.product-glyph {
  position: absolute;
  top: 28px;
  right: 28px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
}
.product.featured .product-glyph {
  top: auto;
  right: -40px;
  bottom: -50px;
  width: 320px;
  height: 320px;
  opacity: 0.55;
  transition: transform 0.6s var(--ease-out), opacity 0.6s var(--ease-out);
}
.product.featured:hover .product-glyph {
  transform: translate(-12px, -12px);
  opacity: 0.7;
}


/* ============================================================
   PULL QUOTE
============================================================ */
.pull-quote {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(26px, 3.5vw, 40px);
  line-height: 1.25;
  color: var(--text);
  max-width: 880px;
  margin: 64px 0;
  padding-left: 32px;
  border-left: 3px solid var(--copper);
  font-variation-settings: "SOFT" 100;
}


/* ============================================================
   STORY
============================================================ */
.story-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  align-items: start;
}

@media (min-width: 900px) {
  .story-grid { grid-template-columns: 1fr 1fr; gap: 96px; }
}

.story-prose p { margin-bottom: 20px; max-width: none; }
.story-prose p:last-child { margin-bottom: 0; }

.story-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 64px 56px;
  background: var(--bg-card);
  border-radius: 24px;
  border: 1px solid var(--border);
  perspective: 900px;
}

section.alt .story-mark { background: var(--bg); }

.story-mark svg {
  width: 100%;
  max-width: 220px;
  height: auto;
  overflow: visible;
  transform-origin: 15% 50%;
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

@media (hover: hover) {
  .story-mark { cursor: pointer; }
  .story-mark:hover svg { transform: rotateY(-62deg); }
}

.story-mark .caption {
  text-align: center;
  font-size: 15px;
  color: var(--text-soft);
  font-style: italic;
  font-family: var(--font-display);
  font-weight: 500;
  max-width: 280px;
  line-height: 1.45;
}

/* Iwan draw-in animation. Path stroke lengths are roughly known. */
.story-mark .iwan-path {
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  transition: stroke-dashoffset 1.6s var(--ease-out);
}
.story-mark.visible .iwan-path { stroke-dashoffset: 0; }
.story-mark .iwan-path:nth-of-type(2) { transition-delay: 0.4s; }
.story-mark .iwan-path:nth-of-type(3) { transition-delay: 0.8s; }
.story-mark .iwan-dot {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  transition: opacity 0.4s var(--ease-out) 1.4s, transform 0.5s var(--ease-out) 1.4s;
}
.story-mark.visible .iwan-dot {
  opacity: 1;
  transform: scale(1);
}



/* ============================================================
   JOIN
============================================================ */
.pathways {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 16px;
}

@media (min-width: 900px) {
  .pathways { grid-template-columns: repeat(3, 1fr); }
}

.pathway {
  padding: 32px;
  border-radius: 20px;
  background: rgba(246, 241, 232, 0.06);
  border: 1px solid rgba(246, 241, 232, 0.12);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.pathway:hover {
  background: rgba(246, 241, 232, 0.10);
  border-color: rgba(224, 122, 60, 0.3);
  transform: translateY(-2px);
}

.pathway h3 { font-size: 22px; margin-bottom: 12px; color: var(--text-on-ink); }
.pathway p { font-size: 15px; color: rgba(246, 241, 232, 0.78); margin-bottom: 20px; line-height: 1.55; }

.pathway .cta {
  font-size: 14px;
  font-weight: 600;
  color: var(--copper);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s var(--ease);
}
.pathway .cta:hover { gap: 10px; color: var(--text-on-ink); }


/* ============================================================
   FOOTER
============================================================ */
footer {
  padding: 64px 0 40px;
  background: var(--ink);
  color: rgba(246, 241, 232, 0.7);
}
[data-theme="dark"] footer { background: #050913; }

footer .container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (min-width: 768px) {
  footer .container { flex-direction: row; justify-content: space-between; align-items: flex-end; }
}

footer .wordmark { color: var(--text-on-ink); font-size: 28px; }
footer .meta { font-size: 13px; line-height: 1.6; color: rgba(246, 241, 232, 0.7); }
footer .meta p { max-width: none; color: inherit; }

footer .links { display: flex; gap: 24px; font-size: 14px; flex-wrap: wrap; }
footer .links a:hover { color: var(--copper); }

footer .colophon { margin-top: 12px; font-size: 12px; color: rgba(246, 241, 232, 0.4); font-family: var(--font-mono); }

footer .tribute {
  margin-top: 8px;
  font-size: 14px;
  color: rgba(246, 241, 232, 0.6);
  font-family: var(--font-display);
  font-style: italic;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

footer .tribute .lion-sun {
  font-size: 16px;
  font-style: normal;
}

footer .tribute [lang="fa"] {
  font-size: 16px;
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.01em;
}


/* ============================================================
   SECTION TRANSITION RULE
   A copper line that draws horizontally as each section enters view.
============================================================ */
.section-rule {
  height: 1px;
  background: linear-gradient(to right, var(--copper) 0%, var(--copper) 30%, transparent 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.4s var(--ease-out);
  margin-bottom: 48px;
}

.section-rule.visible { transform: scaleX(1); }

@media (min-width: 768px) {
  .section-rule { margin-bottom: 64px; }
}


/* ============================================================
   SCROLL REVEAL
   Elements with .reveal start hidden, rise into view when intersected.
============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }


/* ============================================================
   ACCESSIBILITY WIDGET
============================================================ */
.a11y-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(14, 24, 48, 0.18), 0 12px 32px rgba(14, 24, 48, 0.12);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.a11y-launcher:hover {
  transform: translateY(-2px) scale(1.04);
  background: var(--copper-deep);
}
[data-theme="dark"] .a11y-launcher:hover { background: var(--copper); }
.a11y-launcher svg { width: 26px; height: 26px; }
.a11y-launcher:focus-visible { outline: 3px solid var(--copper); outline-offset: 4px; }

.a11y-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 99;
  width: min(340px, calc(100vw - 32px));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(14, 24, 48, 0.20);
  display: flex;
  flex-direction: column;
  gap: 22px;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}
.a11y-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.a11y-panel h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
}

.a11y-group { display: flex; flex-direction: column; gap: 8px; }

.a11y-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.a11y-segmented {
  display: flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}
.a11y-segmented button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.a11y-segmented button[aria-pressed="true"] {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(14, 24, 48, 0.06);
}
.a11y-segmented button:hover:not([aria-pressed="true"]) { color: var(--text); }

.a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  padding: 6px 0;
}

.a11y-switch {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.2s var(--ease);
  flex-shrink: 0;
}
.a11y-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--bg-card);
  border-radius: 999px;
  transition: transform 0.2s var(--ease);
}
input[type="checkbox"]:checked + .a11y-switch { background: var(--copper); }
input[type="checkbox"]:checked + .a11y-switch::after { transform: translateX(16px); }
input[type="checkbox"]:focus-visible + .a11y-switch { outline: 2px solid var(--copper); outline-offset: 2px; }
.a11y-row input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }

.a11y-reset {
  font-size: 13px;
  font-weight: 600;
  color: var(--copper-deep);
  text-align: left;
  padding: 4px 0;
}
[data-theme="dark"] .a11y-reset { color: var(--copper); }
.a11y-reset:hover { text-decoration: underline; }


/* ============================================================
   ACCESSIBILITY
============================================================ */
:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 4px;
  border-radius: 6px;
}

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

a:focus-visible { border-radius: 3px; }
