/* RISC Zero — risczero.com
   Hand-written replacement for the Tailwind/shadcn theme the Next.js site used.
   Colors are the same HSL tokens; only what the pages use is kept. */

@font-face {
  font-family: "Europa";
  src: url("/fonts/EuropaGroteskSH-Bold.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: fallback;
}
@font-face {
  font-family: "Europa";
  src: url("/fonts/EuropaGroteskSH-Med.otf") format("opentype");
  font-weight: 600 800;
  font-style: normal;
  font-display: fallback;
}
@font-face {
  font-family: "Europa";
  src: url("/fonts/EuropaGroteskSH-Reg.otf") format("opentype");
  font-weight: 100 500;
  font-style: normal;
  font-display: fallback;
}

/* ---------- theme tokens ---------- */

:root {
  --background: 45 28.57% 91.76%;
  --foreground: 20 14.3% 4.1%;
  --card: 0 0% 100%;
  --card-foreground: 20 14.3% 4.1%;
  --popover: 0 0% 100%;
  --popover-foreground: 20 14.3% 4.1%;
  --primary: 24 9.8% 10%;
  --primary-foreground: 60 9.1% 97.8%;
  --secondary: 60 4.8% 95.9%;
  --secondary-foreground: 24 9.8% 10%;
  --muted-foreground: 25 5.3% 44.7%;
  --accent: 60 4.8% 95.9%;
  --accent-foreground: 24 9.8% 10%;
  --border: 20 5.9% 90%;
  --ring: 20 14.3% 4.1%;
  --radius: 0.75rem;

  --nav-border: #d4d4d4;        /* neutral-300 */
  --panel-border: #e5e5e5;      /* neutral-200 */
  --newspaper: #f0ede4;
  --text-default-light: hsl(20 14.3% 4.1%);
  --planet: url("/misc/planet.webp");
  --h1-from: #000;
  --h1-to: rgb(31 41 55 / 0.8);  /* gray-800/80 */

  --font-sans: "Europa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: light;
}

html.dark {
  --background: 0 0% 11.76%;
  --foreground: 60 9.1% 97.8%;
  --card: 20 14.3% 4.1%;
  --card-foreground: 60 9.1% 97.8%;
  --popover: 20 14.3% 4.1%;
  --popover-foreground: 60 9.1% 97.8%;
  --primary: 61 100% 80.8%;
  --primary-foreground: 0 0% 0%;
  --secondary: 12 6.5% 15.1%;
  --secondary-foreground: 60 9.1% 97.8%;
  --muted-foreground: 24 5.4% 63.9%;
  --accent: 12 6.5% 15.1%;
  --accent-foreground: 60 9.1% 97.8%;
  --border: 12 6.5% 15.1%;
  --ring: 61 100% 80.8%;

  --nav-border: #525252;        /* neutral-600 */
  --panel-border: #404040;      /* neutral-700 */
  --planet: url("/misc/planet-dark.webp");
  --h1-from: #fff;
  --h1-to: rgb(245 245 245 / 0.8);

  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after {
  box-sizing: border-box;
  border-color: hsl(var(--border));
  letter-spacing: 0.025em; /* tracking-wide */
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1 0 auto; }

h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px hsl(var(--ring));
}
button, summary { font: inherit; color: inherit; cursor: pointer; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }

.font-mono, code, pre { font-family: var(--font-mono); letter-spacing: initial; }
.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;
}

.icon { width: 1rem; height: 1rem; flex: none; stroke-width: 1.75; }
.icon-muted { color: hsl(var(--muted-foreground)); }

/* Tailwind's container at the 2xl=1400px screen, 2rem padding (6rem from lg) */
.container {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: 2rem;
}
@media (min-width: 1024px) {
  .container { padding-inline: 6rem; }
}

/* ---------- type ---------- */

.subtitle {
  text-wrap: pretty;
  font-size: 1.125rem;
  line-height: 1.75rem;
}
@media (min-width: 768px) {
  .subtitle { max-width: 32rem; font-size: 1.5rem; line-height: 2rem; }
}

.title {
  text-wrap: pretty;
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 2.5rem;
  max-width: 768px;
}
@media (min-width: 768px) {
  .title { font-size: 3.75rem; line-height: 1; }
}

.muted { color: hsl(var(--muted-foreground)); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.25rem;
  height: 2.25rem;
  padding: 0.5rem 1rem;
  transition: background-color 150ms, color 150ms;
}
.btn:focus-visible {
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}
.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.btn-primary:hover { background: hsl(var(--primary) / 0.9); }
.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}
.btn-secondary:hover { background: hsl(var(--secondary) / 0.8); }
.btn-outline {
  background: hsl(var(--background));
  border: 1px dashed var(--nav-border);
}
.btn-outline:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.btn-lg {
  height: 2.5rem;
  padding-inline: 2rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
}
.btn-lg .icon { width: 1.25rem; height: 1.25rem; }
.btn-icon { width: 2.25rem; padding: 0; }

/* ---------- header ---------- */

.site-header {
  position: relative;
  z-index: 70;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 7rem;
}

.logo {
  display: flex;
  min-width: 59px;
  transition: opacity 150ms;
}
.logo:hover { opacity: 0.8; }
.logo img { width: 59px; height: 43px; }
html.dark .logo img { filter: invert(1); }

.nav { position: relative; display: flex; align-items: center; gap: 0.625rem; }
.nav > li { display: flex; }

/* Desktop dropdowns: <details> so they work without JS; site.js closes them on outside click */
.nav-menu { display: none; position: static; }
@media (min-width: 768px) { .nav-menu { display: flex; } }
.nav-menu > summary { user-select: none; }
.nav-menu > summary .chev { transition: transform 200ms; margin-left: 0.25rem; width: 0.75rem; height: 0.75rem; }
.nav-menu[open] > summary .chev { transform: rotate(180deg); }
.nav-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 400px;
  max-width: calc(100vw - 4rem);
  padding: 1rem;
  border: 1px dashed var(--panel-border);
  border-radius: 0.375rem;
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  display: grid;
  gap: 1rem;
  animation: fade-in-down 150ms ease-out both;
}
@media (min-width: 768px) { .nav-panel { width: 500px; } }
@media (min-width: 1024px) { .nav-panel { width: 600px; } }
.nav-panel.two-col { grid-template-columns: 1fr 1fr; }
.nav-group-label {
  margin-bottom: 0.5rem;
  font-weight: 400;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.nav-list { display: grid; gap: 0.5rem; }

.nav-item {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 66px;
  padding: 0.75rem 1.25rem;
  border: 1px dashed var(--panel-border);
  border-radius: 0.375rem;
  user-select: none;
  transition: background-color 150ms, color 150ms;
}
.nav-item:hover, .nav-item:focus {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.nav-item-text { display: flex; flex-direction: column; gap: 0.25rem; }
.nav-item-title {
  display: flex; align-items: center; gap: 0.75rem;
  margin-top: 1px; font-weight: 700; font-size: 0.875rem; line-height: 1;
}
.nav-item-desc {
  font-size: 0.875rem; line-height: 1.375;
  color: hsl(var(--muted-foreground));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.nav-actions { display: flex; flex-direction: row-reverse; gap: 0.75rem; }
@media (min-width: 768px) { .nav-actions { flex-direction: row; gap: 0.625rem; } }

/* theme toggle: show the icon for the theme you would switch to */
.theme-toggle .sun { display: none; }
html.dark .theme-toggle .sun { display: block; }
html.dark .theme-toggle .moon { display: none; }

/* mobile menu: a <dialog> sheet from the right */
.menu-button { margin-left: 0.75rem; }
@media (min-width: 768px) { .menu-button { display: none; } }
.sheet {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: 75%; max-width: 24rem; height: 100dvh; max-height: none;
  padding: 0; border: 0; border-left: 1px solid hsl(var(--border));
  background: hsl(var(--background)); color: hsl(var(--foreground));
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}
.sheet[open] { animation: slide-in-right 300ms cubic-bezier(0.32, 0.72, 0, 1) both; }
.sheet::backdrop { background: rgb(0 0 0 / 0.8); }
.sheet-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 1.75rem; height: 1.75rem; padding: 0; border: 0; background: none;
  border-radius: 0.125rem; opacity: 0.7;
}
.sheet-close:hover { opacity: 1; }
.sheet-body { height: 100%; overflow: auto; padding: 2rem 1.5rem 1rem; }
.sheet-body .nav-group-label { margin: 1rem 0 0.5rem; font-size: 1.125rem; }
.sheet-body .nav-item { border: 0; min-height: 0; padding: 0.75rem; }
.sheet-body .sep { height: 1px; background: hsl(var(--border)); margin: 1rem 0; }

/* ---------- home ---------- */

.home {
  position: relative;
  margin-top: -7rem;
  padding-top: 7rem;
  background-repeat: no-repeat;
}
@media (min-width: 768px) {
  .home {
    background-image: var(--planet);
    background-size: 640px 640px;
    background-position: calc(100% + 284px) 32px;
  }
}
@media (min-width: 1024px) {
  .home {
    background-size: 900px 900px;
    background-position: calc(100% + 184px) -16px;
  }
}

.hero {
  display: flex;
  align-items: center;
  min-height: 56dvh;
  margin-bottom: 3rem;
}
.hero-inner {
  width: 100%;
  max-width: 38rem;
  margin-inline: auto;
  padding-top: 2rem;
  overflow: hidden;
  text-align: center;
}
@media (min-width: 768px) {
  .hero-inner { margin-left: 0; text-align: left; }
}
.hero h1 {
  padding-block: 1.5rem;
  font-weight: 700;
  font-size: 3.75rem;
  line-height: 3.5rem;
  background: linear-gradient(to bottom, var(--h1-from), var(--h1-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (min-width: 768px) {
  .hero h1 { font-size: 4.5rem; line-height: 4rem; word-spacing: 1rem; }
}
@media (min-width: 1024px) {
  .hero h1 { font-size: 6rem; line-height: 5rem; }
}
.hero .tagline { font-size: 1.5rem; line-height: 2rem; max-width: none; }
@media (min-width: 1024px) { .hero .tagline { font-size: 1.875rem; line-height: 2.25rem; } }
.hero-cta { display: flex; justify-content: center; margin-top: 2.5rem; }
@media (min-width: 768px) { .hero-cta { justify-content: flex-start; } }
.hero-cta .btn { min-width: 300px; }
@media (min-width: 640px) { .hero-cta .btn { min-width: 0; } }
.hero .subtitle { margin-inline: auto; }
@media (min-width: 768px) { .hero .subtitle { margin-inline: 0; } }
.hero .subtitle + .subtitle { margin-top: 1.5rem; }
.hero-cta { margin-bottom: 1.5rem; }

.home-spacer { min-height: 368px; padding-block: 3rem; }
@media (min-width: 768px) { .home-spacer { padding-block: 6rem; } }

/* staggered reveal, replaces the motion BoxReveal */
.reveal { animation: fade-in-up 500ms ease-out both; }
.reveal:nth-child(2) { animation-delay: 100ms; }
.reveal:nth-child(3) { animation-delay: 200ms; }
.reveal:nth-child(4) { animation-delay: 300ms; }
.reveal:nth-child(5) { animation-delay: 400ms; }

/* ---------- our story ---------- */

.story-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-top: 3rem;
  text-align: center;
}
.story-head > div { display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 768px) {
  .story-head { flex-direction: row; padding-top: 6rem; text-align: left; }
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding-block: 3rem;
}
@media (min-width: 768px) { .cards { padding-block: 6rem; } }
@media (min-width: 1024px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: flex;
  flex-direction: column;
  min-height: 18rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  color: var(--text-default-light);
  animation: fade-in-up 300ms ease-out both;
}
html.dark .card { background: var(--newspaper); }
.card:nth-child(2) { animation-delay: 75ms; }
.card:nth-child(3) { animation-delay: 150ms; }
.card h2 {
  padding: 2rem;
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 1;
}
.card img {
  width: 408px; max-width: 100%; height: 12rem;
  margin-inline: auto; object-fit: contain; object-position: center;
  -webkit-user-drag: none; user-select: none;
}
.card p {
  padding: 2rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
}

/* ---------- 404 ---------- */

.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  min-height: 56dvh;
  max-width: 1024px;
  margin-bottom: -6rem;
  padding-block: 3rem;
}
@media (min-width: 1024px) { .not-found { flex-direction: row; } }
.not-found .copy { display: grid; gap: 2.5rem; justify-items: start; }
.badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1rem;
}
.not-found .title { font-size: 1.5rem; line-height: 2rem; }
.not-found .subtitle { font-size: 1.125rem; line-height: 1.75rem; }
.ascii {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  opacity: 0.6;
  white-space: pre;
  overflow-x: auto;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 12rem;
  padding-block: 7rem;
  background: #e5e3d5;
  color: #262626;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  max-width: 1280px;
}
@media (min-width: 768px) { .footer-inner { flex-direction: row; } }
.footer-logo { display: none; }
@media (min-width: 768px) { .footer-logo { display: flex; } }
.footer-logo img { width: 59px; height: 43px; }
html.dark .footer-logo img { filter: none; }
.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  flex: 1;
}
@media (min-width: 768px) { .footer-links { justify-self: end; margin-left: auto; flex: none; } }
@media (min-width: 1024px) { .footer-links { gap: 6rem; } }
.footer-links ul { display: grid; gap: 0.5rem; }
.footer-links a {
  font-family: var(--font-mono);
  letter-spacing: initial;
  font-size: 1.125rem;
  line-height: 1.75rem;
  text-underline-offset: 2px;
}
.footer-links a:hover { text-decoration: underline; }

/* ---------- animation ---------- */

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .card, .nav-panel, .sheet[open] { animation: none; }
  html { scroll-behavior: auto; }
}
