/* Casualstack — casualstack.dev */

:root {
  color-scheme: dark;
  --bg: #070706;
  --bg-elevated: #0f0e0c;
  --line: rgba(236, 234, 228, 0.1);
  --line-strong: rgba(236, 234, 228, 0.18);
  --text: #eceae4;
  --text-dim: rgba(236, 234, 228, 0.55);
  --text-faint: rgba(236, 234, 228, 0.32);
  --accent: #5eb3ff;
  --accent-glow: rgba(94, 179, 255, 0.15);
  --serif: "Fraunces", "Georgia", serif;
  --sans: "Manrope", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 1120px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 450;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: rgba(94, 179, 255, 0.22);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover { color: var(--accent); }

img, svg { display: block; max-width: 100%; }

/* Film grain */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Ambient */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(94, 179, 255, 0.07), transparent 55%),
    radial-gradient(ellipse 40% 30% at 100% 60%, rgba(37, 99, 235, 0.05), transparent),
    var(--bg);
}

.wrap {
  width: min(100% - 3rem, var(--max));
  margin-inline: auto;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.35rem 0;
  transition: background 0.4s var(--ease), border-color 0.4s;
}

header.solid {
  background: rgba(7, 7, 6, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img { height: 28px; width: auto; opacity: 0.95; }

.header-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.header-links a { color: var(--text-dim); }
.header-links a:hover { color: var(--text); }

.menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.25rem;
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  padding: 5rem 1.5rem 2rem;
  flex-direction: column;
  gap: 1.5rem;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
}

.mobile-menu.open { display: flex; }

/* Hero */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8rem 0 4rem;
  position: relative;
}

.hero-inner { position: relative; }

.hero-mark {
  position: absolute;
  top: -2rem;
  right: -2rem;
  width: min(42vw, 320px);
  opacity: 0.12;
  pointer-events: none;
  filter: saturate(0.8);
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(3rem, 8.5vw, 6.5rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 2rem;
  max-width: 14ch;
  font-variation-settings: "SOFT" 50, "WONK" 1;
}

.hero-lead {
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 38ch;
  margin: 0 0 2.75rem;
  font-weight: 450;
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.scroll-hint {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.scroll-hint::after {
  content: "";
  width: 1px;
  height: 48px;
  background: linear-gradient(var(--text-faint), transparent);
  animation: scroll-line 2s ease infinite;
}

@keyframes scroll-line {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

.link-arrow {
  font-size: 0.9375rem;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.link-arrow span {
  transition: transform 0.3s var(--ease);
}

.link-arrow:hover span { transform: translateX(4px); }

/* Manifesto */
.manifesto {
  padding: 8rem 0;
  border-top: 1px solid var(--line);
}

.manifesto blockquote {
  margin: 0;
  padding: 0;
  border: none;
}

.manifesto .statement {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 3.25rem);
  font-weight: 450;
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 22ch;
  margin: 0 0 3rem;
  font-variation-settings: "SOFT" 40;
}

.manifesto .body {
  columns: 1;
  gap: 3rem;
  max-width: 68ch;
}

@media (min-width: 768px) {
  .manifesto .body { columns: 2; max-width: none; }
}

.manifesto .body p {
  margin: 0 0 1.25rem;
  color: var(--text-dim);
  font-size: 1.0625rem;
  line-height: 1.75;
  break-inside: avoid;
}

.manifesto .body p strong {
  color: var(--text);
  font-weight: 550;
}

/* Stack diagram */
.stack {
  padding: 6rem 0 8rem;
  border-top: 1px solid var(--line);
}

.stack-header {
  margin-bottom: 4rem;
}

.stack-header h2 {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 1rem;
}

.stack-header p {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin: 0;
  font-weight: 450;
  letter-spacing: -0.02em;
  max-width: 28ch;
}

.stack-layers {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.layer {
  display: grid;
  grid-template-columns: 4rem 1fr auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease;
}

.layer:first-child { border-top: 1px solid var(--line); }

.layer:hover {
  background: linear-gradient(90deg, var(--accent-glow), transparent 40%);
}

.layer-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.layer h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.layer p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-dim);
  max-width: 48ch;
  line-height: 1.6;
}

.layer-status {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.layer-status.soon { color: rgba(251, 191, 36, 0.7); }

/* Vision */
.vision {
  padding: 8rem 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.vision-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: end;
}

.vision h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0;
  font-variation-settings: "SOFT" 50;
}

.vision-aside {
  font-size: 1.0625rem;
  color: var(--text-dim);
  line-height: 1.75;
  margin: 0;
}

.vision-aside em {
  font-style: normal;
  color: var(--text);
}

/* Closing */
.closing {
  padding: 10rem 0 8rem;
  text-align: center;
}

.closing h2 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 2rem;
  max-width: 16ch;
  margin-inline: auto;
}

.closing p {
  color: var(--text-dim);
  font-size: 1.0625rem;
  max-width: 36ch;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}

.closing-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  font-size: 0.875rem;
  font-weight: 550;
}

.closing-links a {
  color: var(--text);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}

.closing-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Footer */
footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.footer-row a { color: var(--text-faint); }
.footer-row a:hover { color: var(--text-dim); }

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.35s; }

/* Responsive */
@media (max-width: 768px) {
  .header-links { display: none; }
  .menu-btn { display: block; }
  .hero-mark { display: none; }
  .hero { justify-content: center; padding-top: 6rem; }
  .hero h1 { max-width: none; }
  .layer { grid-template-columns: 1fr; gap: 0.5rem; }
  .layer-status { justify-self: start; }
  .vision-grid { grid-template-columns: 1fr; gap: 2rem; }
  .manifesto { padding: 5rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint::after { animation: none; }
}
