/* danielsolves.ai shared stylesheet — single source for tokens + shared components. Page-specific rules stay in each page's inline <style> and load AFTER this sheet. Nav styles live in site-nav.js. */

/* Tokens */
:root {
  --bg: oklch(0.15 0.012 260);
  --bg-2: oklch(from var(--bg) calc(l + 0.03) c h);
  --surface: oklch(from var(--bg) calc(l + 0.06) c h / 0.6);
  --line: oklch(0.95 0.01 260 / 0.09);
  --line-strong: oklch(0.95 0.01 260 / 0.16);
  --text: oklch(0.97 0.008 260);
  --muted: oklch(0.72 0.015 260);
  --faint: oklch(0.56 0.015 260);
  --accent: oklch(0.82 0.14 195);
  --accent-2: oklch(from var(--accent) l c calc(h - 45));
  --accent-3: oklch(from var(--accent) l c calc(h + 85));
  --glow: oklch(from var(--accent) l c h / var(--glow-strength, 0.5));
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --fs-display: clamp(48px, 8.5vw, 104px);
  --fs-h1: clamp(38px, 6.2vw, 76px);
  --fs-h2: clamp(29px, 4.4vw, 48px);
  --fs-lede: clamp(16px, 1.8vw, 19px);
  --fs-hero-lede: clamp(18px, 2.1vw, 22px);
  --r-shell: 24px;
  --r-card: 18px;
  --r-control: 12px;
  --r-pill: 999px;
  --section-pad: clamp(64px, 9vw, 96px);
}

/* Reset / base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--bg); }

/* Aurora backdrop (variant A: index + portfolio) */
.aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.aurora::before, .aurora::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.45;
}
.aurora::before {
  width: 60vw; height: 60vw; top: -20vw; left: -10vw;
  background: radial-gradient(circle, var(--accent), transparent 65%);
  animation: drift1 22s ease-in-out infinite alternate;
}
.aurora::after {
  width: 50vw; height: 50vw; top: 10vw; right: -15vw;
  background: radial-gradient(circle, var(--accent-3), transparent 65%);
  animation: drift2 26s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(12vw, 14vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-10vw, 10vh) scale(1.1); } }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Aurora backdrop (variant B: case pages) */
.aurora--case::before, .aurora--case::after { opacity: 0.4; }
.aurora--case::before { width: 55vw; height: 55vw; top: -22vw; right: -12vw; left: auto; background: radial-gradient(circle, var(--accent), transparent 65%); animation: driftCase1 24s ease-in-out infinite alternate; }
.aurora--case::after { width: 45vw; height: 45vw; top: 30vw; left: -15vw; right: auto; background: radial-gradient(circle, var(--accent-3), transparent 65%); animation: driftCase2 28s ease-in-out infinite alternate; }
@keyframes driftCase1 { to { transform: translate(-10vw, 12vh) scale(1.15); } }
@keyframes driftCase2 { to { transform: translate(10vw, 8vh) scale(1.1); } }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; position: relative; z-index: 2; }

/* Section scaffolding */
section { padding: var(--section-pad) 0; position: relative; }
.eyebrow { font-family: var(--mono); font-size: 12.5px; color: var(--accent); letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--accent); }
h2 { font-size: var(--fs-h2); line-height: 1.04; letter-spacing: -0.025em; font-weight: 600; max-width: 760px; text-wrap: balance; }
.lede, .section-lede { color: var(--muted); color: color-mix(in oklch, oklch(0.99 0.005 260) var(--brighten, 0%), var(--muted)); font-size: var(--fs-lede); max-width: 640px; margin-top: 24px; line-height: 1.6; text-wrap: pretty; }
.lede b, .section-lede b { color: var(--text); font-weight: 500; }

/* Hero */
h1.hero {
  font-size: var(--fs-display); line-height: 0.96; letter-spacing: -0.03em; font-weight: 600;
}
h1.hero .grad {
  background: linear-gradient(110deg, var(--accent), var(--accent-3) 60%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-lede { font-size: var(--fs-hero-lede); color: var(--text); max-width: 620px; margin-top: 28px; line-height: 1.45; text-wrap: pretty; }
.hero-lede b { color: var(--accent); font-weight: 500; }

/* Buttons */
.btn {
  font-family: var(--mono); font-size: 14px; padding: 14px 26px; border-radius: var(--r-pill); text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px; transition: all 0.22s; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: oklch(0.16 0.01 260); font-weight: 600; }
.btn-primary:hover { box-shadow: 0 0 32px var(--glow); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.copy-btn:focus-visible,
.code-copy:focus-visible,
.slot-card:focus-visible,
.lang-btn:focus-visible,
.nav-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Projects */
.projects { margin-top: 60px; display: flex; flex-direction: column; gap: 22px; }
.project { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r-shell); overflow: hidden; background: var(--surface); transition: all 0.3s; }
.project:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.project:nth-child(even) { grid-template-columns: 1fr 1.1fr; }
.project:nth-child(even) .p-media { order: 2; }
.p-body { padding: 40px; display: flex; flex-direction: column; }
.p-tag { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 14px; }
.p-body h3 { font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; }
.p-body h3 a { color: inherit; text-decoration: none; transition: color 0.2s; }
.p-body h3 a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.p-body p { color: var(--muted); font-size: 15px; line-height: 1.6; margin-top: 16px; text-wrap: pretty; }
.p-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.p-stack span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding: 5px 11px; border: 1px solid var(--line); border-radius: var(--r-pill); }
.p-links { display: flex; gap: 18px; margin-top: 28px; }
.p-links a { font-family: var(--mono); font-size: 13px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 2px; transition: color 0.2s; }
.p-links a:hover { color: var(--accent); }
.p-links a.disabled { color: var(--faint); border-bottom-color: var(--line); cursor: default; }
.p-links a.disabled:hover { color: var(--faint); }
.p-media { position: relative; min-height: 280px; background:
  repeating-linear-gradient(135deg, oklch(0.22 0.016 260) 0 12px, oklch(0.2 0.016 260) 12px 24px);
  display: flex; align-items: center; justify-content: center; }
.p-media .ph { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: 0.1em; border: 1px dashed var(--line-strong); padding: 10px 16px; border-radius: 8px; }
@media (max-width: 820px) { .project, .project:nth-child(even) { grid-template-columns: 1fr; } .project:nth-child(even) .p-media { order: 0; } }
.work-more { margin-top: 44px; display: flex; justify-content: flex-start; }

/* Case-study shared */
.crumb { font-family: var(--mono); font-size: 12.5px; color: var(--faint); letter-spacing: 0.04em; margin-bottom: 26px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.crumb .sep { color: var(--line-strong); }
.hero-tag { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 12.5px; color: var(--accent); padding: 7px 14px; border-radius: var(--r-pill); border: 1px solid oklch(from var(--accent) l c h / 0.3); background: oklch(from var(--accent) l c h / 0.07); margin-bottom: 26px; }

/* Problem / outcome panels */
.twoup { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--r-card); padding: 32px; background: var(--surface); backdrop-filter: blur(8px); }
.panel .ph { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 18px; display: flex; align-items: center; gap: 9px; }
.panel.problem .ph { color: var(--faint); }
.panel.problem .ph::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--faint); }
.panel.outcome { border-color: oklch(from var(--accent) l c h / 0.3); }
.panel.outcome .ph { color: var(--accent); }
.panel.outcome .ph::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px var(--glow); }
.panel ul { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.panel li { font-size: 15.5px; line-height: 1.55; color: var(--muted); padding-left: 26px; position: relative; }
.panel li::before { position: absolute; left: 0; top: 0; font-family: var(--mono); font-size: 14px; }
.panel.problem li::before { content: "\2715"; color: var(--faint); }
.panel.outcome li::before { content: "\2713"; color: var(--accent); }
.panel.outcome li b { color: var(--text); font-weight: 600; }
@media (max-width: 760px) { .twoup { grid-template-columns: 1fr; } }

/* Tech stack chips */
.stack-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.stack-grid span { font-family: var(--mono); font-size: 13px; color: var(--text); padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: all 0.2s; }
.stack-grid span:hover { border-color: var(--accent); color: var(--accent); }

/* CTA card */
.cta { text-align: center; border: 1px solid var(--line-strong); border-radius: var(--r-shell); padding: 64px 40px; background: var(--surface); backdrop-filter: blur(8px); position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; width: 60%; height: 200%; top: -50%; left: 20%; background: radial-gradient(ellipse, var(--glow), transparent 70%); opacity: 0.5; pointer-events: none; }
.cta h2 { margin: 0 auto; max-width: 18ch; position: relative; }
.cta p { color: var(--muted); font-size: 17px; margin: 20px auto 0; max-width: 48ch; position: relative; }
.cta .btn { margin-top: 36px; position: relative; }

/* Next project card */
.next { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--r-card); padding: 30px 36px; background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 24px; text-decoration: none; transition: all 0.3s; }
.next:hover { border-color: var(--accent); transform: translateX(6px); }
.next .k { font-family: var(--mono); font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.next .t { font-size: clamp(20px, 2.6vw, 28px); font-weight: 600; letter-spacing: -0.02em; margin-top: 8px; }
.next .arrow { font-size: 28px; color: var(--accent); flex: none; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 40px 0; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.foot-inner .c { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.foot-links { display: flex; gap: 22px; }
.foot-links a { font-family: var(--mono); font-size: 12.5px; color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--accent); }

/* --- Scroll reveals (reveal.js) ------------------------------------- */
/* Hidden state only applies when JS is running (html.js set inline in <head>),
   so no-JS visitors and failed script loads still see all content. */
html.js [data-reveal]:not(.is-revealed) {
  opacity: 0;
  transform: translateY(24px);
}
[data-reveal].is-revealed {
  animation: reveal-in 0.7s ease backwards;
  animation-delay: var(--reveal-delay, 0s);
}
@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal]:not(.is-revealed) {
    opacity: 1;
    transform: none;
  }
  [data-reveal].is-revealed {
    animation: none;
  }
  .aurora::before,
  .aurora::after {
    animation: none;
  }
}
