/* =========================================================
   Arawn Interactive — site styles
   Tokens, layout, components, and motion in one file.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --max: 1180px;
  --pad: clamp(20px, 4vw, 40px);
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-md: 0 8px 30px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.10);
  --ease: cubic-bezier(.2,.7,.2,1);
  --grad-1: linear-gradient(135deg, #cc4400 0%, #ff8a3d 100%);
  --grad-2: linear-gradient(135deg, #8a2e00 0%, #ff6600 55%, #ffb347 100%);

  /* Type scale */
  --fs-h1: clamp(2.4rem, 1.4rem + 3.6vw, 4.4rem);
  --fs-h2: clamp(1.7rem, 1.1rem + 2vw, 2.6rem);
  --fs-h3: 1.15rem;
  --fs-lead: clamp(1rem, .9rem + .4vw, 1.18rem);
  --fs-body: 1rem;
  --fs-small: .9rem;

  /* Light theme (default values overridden by [data-theme]) */
  --bg: #ffffff;
  --bg-elev: #ffffffd9;
  --bg-card: #ffffff;
  --fg: #1a0f08;
  --fg-muted: #5a4a3f;
  --fg-soft: #7a6a5f;
  --line: #f0e4d8;
  --line-strong: #ddccba;
  --accent: #ff6600;
  --accent-2: #cc4400;
  --grad-text: linear-gradient(135deg, #cc4400 0%, #ff6600 50%, #ff8a3d 100%);
  --orb-1: rgba(255,102,0,.30);
  --orb-2: rgba(204,68,0,.24);
  --orb-3: rgba(255,179,71,.22);
  --orb-4: rgba(255,138,61,.20);
  --grid-line: rgba(26,15,8,.05);
  --particle: rgba(60,30,10,.55);
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #ffffffd9;
  --bg-card: #ffffff;
  --fg: #1a0f08;
  --fg-muted: #5a4a3f;
  --fg-soft: #7a6a5f;
  --line: #f0e4d8;
  --line-strong: #ddccba;
  --accent: #ff6600;
  --accent-2: #cc4400;
  --grad-text: linear-gradient(135deg, #cc4400 0%, #ff6600 50%, #ff8a3d 100%);
  --orb-1: rgba(255,102,0,.22);
  --orb-2: rgba(204,68,0,.18);
  --orb-3: rgba(255,179,71,.16);
  --orb-4: rgba(255,138,61,.14);
  --grid-line: rgba(26,15,8,.05);
  --particle: rgba(60,30,10,.55);
}

[data-theme="dark"] {
  --bg: #0d0805;
  --bg-elev: rgba(22,14,8,.65);
  --bg-card: rgba(28,18,10,.78);
  --fg: #f6ede4;
  --fg-muted: #c5b4a3;
  --fg-soft: #8e7e6e;
  --line: rgba(255,200,160,.08);
  --line-strong: rgba(255,200,160,.14);
  --accent: #ff8a3d;
  --accent-2: #ffb347;
  --grad-text: linear-gradient(135deg, #ffb347 0%, #ff8a3d 50%, #ff6600 100%);
  --orb-1: rgba(255,138,61,.45);
  --orb-2: rgba(255,102,0,.42);
  --orb-3: rgba(255,179,71,.32);
  --orb-4: rgba(204,68,0,.40);
  --grid-line: rgba(255,220,180,.04);
  --particle: rgba(255,210,170,.55);
}

/* ---------- Reset / base ---------- */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  /* Keep slow, decorative ambient background motion (orbs + particles). */
  .orb { animation-duration: var(--orb-dur, 24s) !important; }
  .orb-1 { --orb-dur: 22s; }
  .orb-2 { --orb-dur: 26s; }
  .orb-3 { --orb-dur: 30s; }
  .orb-4 { --orb-dur: 24s; }
}
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; padding: 8px 12px;
  background: var(--bg-card); color: var(--fg); border-radius: 8px;
}
.skip-link:focus { left: 12px; top: 12px; z-index: 100; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- Background layers ---------- */
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}
.bg-gradient {
  position: absolute; inset: -10%;
  background:
    radial-gradient(80% 50% at 20% 0%,  color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(60% 40% at 90% 10%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 60%),
    radial-gradient(60% 60% at 50% 100%, color-mix(in srgb, #ff7ac6 14%, transparent), transparent 60%),
    var(--bg);
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 40%, transparent 80%);
}
.bg-bokeh { position: absolute; inset: 0; filter: blur(60px); }
.orb {
  position: absolute; border-radius: 50%; opacity: .9;
  will-change: transform;
  animation: float 18s var(--ease) infinite alternate;
}
.orb-1 { width: 520px; height: 520px; left: -120px; top: -120px; background: var(--orb-1); animation-duration: 22s; }
.orb-2 { width: 460px; height: 460px; right: -160px; top: 10%; background: var(--orb-2); animation-duration: 26s; }
.orb-3 { width: 380px; height: 380px; left: 20%; bottom: -120px; background: var(--orb-3); animation-duration: 30s; }
.orb-4 { width: 320px; height: 320px; right: 10%; bottom: -80px;  background: var(--orb-4); animation-duration: 24s; }
@keyframes float {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(60px,-20px,0) scale(1.06); }
  100% { transform: translate3d(-30px,40px,0) scale(1.1); }
}
.bg-particles, .bg-three { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg-three { display: block; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: var(--bg-elev);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header[data-elev="true"] { border-bottom-color: var(--line); }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .2px; }
.brand-mark { width: 26px; height: 26px; }
.brand-text em { font-style: normal; color: var(--fg-muted); font-weight: 600; }
.nav-links { display: none; gap: 24px; font-size: .96rem; color: var(--fg-muted); }
.nav-links a { position: relative; padding: 6px 0; }
.nav-links a:hover { color: var(--fg); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--grad-1); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-card); color: var(--fg);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .25s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-moon { display: inline; }
[data-theme="light"] .icon-sun  { display: inline; }

@media (min-width: 880px) {
  .nav-links { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .98rem;
  border: 1px solid transparent; cursor: pointer; user-select: none;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.btn-primary { color: #fff; background: var(--grad-1); box-shadow: 0 10px 30px rgba(124,92,255,.30); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 40px rgba(124,92,255,.40); }
.btn-ghost { color: var(--fg); border-color: var(--line-strong); background: transparent; }
.btn-ghost:hover { background: var(--bg-card); transform: translateY(-1px); }

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: clamp(56px, 8vw, 96px) 0 clamp(40px, 6vw, 80px);
  min-height: 88vh; display: flex; align-items: center;
}
.hero-inner {
  position: relative; z-index: 1; max-width: 760px;
}
/* Soft readability halo behind hero text so 3D shapes don't fight headlines */
.hero-inner::before {
  content: ""; position: absolute; inset: -40px -60px -20px -40px; z-index: -1;
  background: radial-gradient(ellipse 80% 70% at 30% 50%,
    color-mix(in srgb, var(--bg) 88%, transparent) 0%,
    color-mix(in srgb, var(--bg) 70%, transparent) 45%,
    transparent 80%);
  pointer-events: none;
  filter: blur(2px);
}
.eyebrow {
  font-size: .82rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-muted); margin: 0 0 14px;
}
.hero-title {
  font-size: var(--fs-h1); line-height: 1.04; margin: 0 0 18px; font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-title .grad {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  color: var(--accent);
  -webkit-text-fill-color: transparent;
  display: inline-block;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-title .grad { -webkit-text-fill-color: var(--accent); color: var(--accent); background: none; }
}
.hero-sub { display: block; color: var(--fg); font-weight: 700; font-size: .55em; margin-top: 14px; }
.lead { font-size: var(--fs-lead); color: var(--fg-muted); max-width: 60ch; margin: 0 0 28px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none;
  color: var(--fg-soft); font-size: .9rem;
}
.hero-meta li {
  padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg-card);
}

/* Hero floating cards */
.hero-visual {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
}
.hv-card {
  position: absolute; border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  padding: 18px;
  overflow: hidden;
  will-change: transform;
}
.hv-card .hv-glass {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.08), transparent 60%);
  pointer-events: none;
}
.hv-line { height: 8px; border-radius: 999px; background: var(--line-strong); margin: 8px 0; width: 80%; }
.hv-line:nth-child(3) { width: 55%; }
.hv-bar  { height: 14px; border-radius: 8px; background: var(--grad-1); margin: 10px 0; opacity: .9; }
.hv-bar.w70 { width: 70%; opacity: .7; }
.hv-bar.w40 { width: 40%; opacity: .55; }
.hv-spark { color: var(--accent); width: 100%; height: 60px; }

.hv-card-a { width: 240px; right: 6%; top: 12%; transform: rotate(-3deg); }
.hv-card-b { width: 220px; right: 18%; top: 50%; transform: rotate(2deg); }
.hv-card-c { width: 280px; right: 2%;  bottom: 12%; transform: rotate(-1deg); }

@media (max-width: 980px) {
  .hero-visual { display: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 110px) 0; position: relative; }
.section-alt::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, transparent, var(--bg-elev), transparent);
  opacity: .6;
}
/* Soft readability halo behind section text content (mirrors hero) */
.section .container::before {
  content: ""; position: absolute; inset: -20px 0 -20px 0; z-index: -1;
  background: radial-gradient(ellipse 70% 60% at 30% 50%,
    color-mix(in srgb, var(--bg) 75%, transparent) 0%,
    color-mix(in srgb, var(--bg) 50%, transparent) 50%,
    transparent 85%);
  pointer-events: none;
  filter: blur(2px);
}
.section .container { position: relative; }
.section-head { max-width: 720px; margin-bottom: 34px; }
.section-head h2 {
  font-size: var(--fs-h2); margin: 6px 0 8px; line-height: 1.1;
  letter-spacing: -.01em; font-weight: 800;
}
.section-body p { color: var(--fg-muted); max-width: 60ch; }
.two-col {
  display: grid; gap: 36px; grid-template-columns: 1fr;
}
@media (min-width: 880px) {
  .two-col { grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; }
}

/* ---------- Cards / panels ---------- */
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card, .panel {
  position: relative;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
  overflow: hidden;
}
.card::before, .panel::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: var(--grad-1); opacity: 0; transition: opacity .3s var(--ease);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
}
.card:hover, .panel:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.card:hover::before, .panel:hover::before { opacity: 1; }
.card h3, .panel h3 { margin: 12px 0 6px; font-size: var(--fs-h3); }
.card p, .panel p { margin: 0; color: var(--fg-muted); }
.card-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent-2) 22%, transparent));
  color: var(--accent);
  border: 1px solid var(--line);
}
.card-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.grid-3 {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.bullets { padding-left: 18px; color: var(--fg-muted); }
.bullets li { margin: 6px 0; }

/* ---------- Contact ---------- */
.contact { display: grid; gap: 24px; }
.contact-card {
  border: 1px solid var(--line);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: grid; gap: 18px; justify-items: center;
}
.contact-label {
  margin: 0; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-muted);
}
.email {
  font-size: clamp(1.3rem, 1rem + 1.4vw, 2rem);
  font-weight: 700; letter-spacing: -.01em;
  color: var(--accent);
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block; padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color .25s var(--ease);
  word-break: break-all;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .email { -webkit-text-fill-color: var(--accent); color: var(--accent); background: none; }
}
.email:hover { border-bottom-color: var(--accent); }
.contact-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.contact-actions .btn { font-size: .92rem; padding: 10px 18px; }
.muted { color: var(--fg-soft); margin: 4px 0 0; font-size: .9rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0; color: var(--fg-soft); font-size: var(--fs-small);
  background: var(--bg-elev);
  backdrop-filter: blur(10px);
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-copy { margin: 0; }
.footer-legal { display: block; color: var(--fg-soft); font-size: .82rem; margin-top: 2px; }
.footer-nav { display: flex; gap: 18px; }

/* ---------- Reveal animations ----------
   Self-completing animation. If JS doesn't run, content is fully visible.
   When .js-on is set, each reveal animates in once and ends in the visible
   state (animation-fill-mode: both). No observer required → cannot get stuck. */
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.js-on .reveal { animation: reveal-in .7s var(--ease) both; }
.js-on .reveal:nth-child(2) { animation-delay: .05s; }
.js-on .reveal:nth-child(3) { animation-delay: .10s; }
.js-on .reveal:nth-child(4) { animation-delay: .15s; }
.js-on .reveal:nth-child(5) { animation-delay: .20s; }
.js-on .cards .reveal:nth-child(2) { animation-delay: .06s; }
.js-on .cards .reveal:nth-child(3) { animation-delay: .12s; }
.js-on .cards .reveal:nth-child(4) { animation-delay: .18s; }
.js-on .cards .reveal:nth-child(5) { animation-delay: .24s; }
.js-on .cards .reveal:nth-child(6) { animation-delay: .30s; }

/* Print: keep clean */
@media print { .bg, .site-header, .site-footer { display: none; } }
