/* ─── tobiasbuilds.com — the lab ─────────────────────────────── */

:root {
  --bg: #07090f;
  --bg-raised: #0c101a;
  --ink: #eef2f6;
  --ink-dim: #8a94a6;
  --line: rgba(238, 242, 246, 0.1);
  --hot: #ff6b4a;
  --display: "Bricolage Grotesque", sans-serif;
  --serif: "Instrument Serif", serif;
  --mono: "Martian Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: var(--hot); color: var(--bg); }

a { color: inherit; }

/* background dust canvas */
#dust {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* grain overlay for texture */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.5;
  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.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, .topbar, .footer { position: relative; z-index: 1; }

/* ─── top bar ─── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem clamp(1.2rem, 4vw, 3.5rem);
}

.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.wordmark span { color: var(--hot); }

.status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0.45rem 0.9rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ee6a8;
  box-shadow: 0 0 8px #3ee6a8;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.65); opacity: 0.6; }
}

/* ─── hero ─── */
.hero {
  padding: clamp(4rem, 12vh, 9rem) clamp(1.2rem, 4vw, 3.5rem) 4rem;
  max-width: 1200px;
}

.hero-kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--hot);
  margin-bottom: 1.6rem;
}

.hero-title {
  font-size: clamp(2.6rem, 8.5vw, 7rem);
  font-weight: 750;
  font-stretch: 95%;
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.hero-title .line { display: block; }

.hero-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0;
  color: var(--hot);
  padding-right: 0.06em;
}

.blink {
  color: var(--hot);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
  max-width: 34rem;
  margin-top: 2rem;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.65;
  color: var(--ink-dim);
}

.hero-cta {
  display: inline-block;
  margin-top: 2.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hot);
  padding-bottom: 0.4rem;
  transition: color 0.2s, letter-spacing 0.3s;
}

.hero-cta:hover { color: var(--hot); letter-spacing: 0.22em; }

/* staggered load reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.reveal:nth-of-type(1) { animation-delay: 0.05s; }
.hero .reveal:nth-child(1) { animation-delay: 0.05s; }
.hero .reveal:nth-child(2) { animation-delay: 0.15s; }
.hero .reveal:nth-child(3) { animation-delay: 0.3s; }
.hero .reveal:nth-child(4) { animation-delay: 0.45s; }
.hero-title .reveal:nth-child(1) { animation-delay: 0.15s; }
.hero-title .reveal:nth-child(2) { animation-delay: 0.25s; }
.hero-title .reveal:nth-child(3) { animation-delay: 0.35s; }

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

/* ─── marquee ─── */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 0.85rem 0;
  background: rgba(255, 107, 74, 0.04);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: scroll 28s linear infinite;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  white-space: nowrap;
}

@keyframes scroll {
  to { transform: translateX(-50%); }
}

/* ─── experiments ─── */
.experiments {
  padding: clamp(3rem, 8vh, 6rem) clamp(1.2rem, 4vw, 3.5rem);
  max-width: 1400px;
  margin: 0 auto;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  color: var(--ink-dim);
  margin-bottom: 2.2rem;
}

.section-label::before { content: "▞ "; color: var(--hot); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.4rem;
}

.card {
  --accent: var(--hot);
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  transform-style: preserve-3d;
  transition: border-color 0.25s, box-shadow 0.25s;
  opacity: 0;
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.22s; }
.card:nth-child(3) { animation-delay: 0.34s; }

.card:hover, .card:focus-visible {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px var(--accent),
    0 18px 60px -18px color-mix(in srgb, var(--accent) 55%, transparent);
}

.card-sim {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #05070b;
  border-bottom: 1px solid var(--line);
}

.card-sim canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.card-num {
  position: absolute;
  top: 0.9rem;
  left: 1rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
}

.card-live {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 99px;
  padding: 0.25rem 0.6rem;
  background: rgba(5, 7, 11, 0.6);
  backdrop-filter: blur(4px);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.5rem 1.5rem 1.6rem;
  gap: 0.7rem;
}

.card-tag {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.card-name {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 700;
  font-stretch: 95%;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.card-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-dim);
  flex: 1;
}

.card-cta {
  margin-top: 0.9rem;
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--bg);
  background: var(--accent);
  border-radius: 99px;
  padding: 0.7rem 1.2rem;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1.4);
}

.card:hover .card-cta { transform: translateX(4px) scale(1.04); }

.card-cta::after { content: " →"; }

/* ─── empty slot ─── */
.slot {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-top: 1.4rem;
  padding: 1.4rem 1.6rem;
  border: 1.5px dashed rgba(238, 242, 246, 0.22);
  border-radius: 18px;
  text-decoration: none;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  transition: border-color 0.25s, color 0.25s;
  animation-delay: 0.5s;
}

.slot:hover { border-color: var(--hot); color: var(--ink); }

.slot-num { color: rgba(238, 242, 246, 0.25); }

.slot-text { flex: 1; }

.dots i {
  display: inline-block;
  font-style: normal;
  animation: blink 1.4s steps(1) infinite;
}

.dots i:nth-child(2) { animation-delay: 0.25s; }
.dots i:nth-child(3) { animation-delay: 0.5s; }

.slot-hint {
  font-size: 0.62rem;
  color: var(--hot);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s, transform 0.25s;
}

.slot:hover .slot-hint { opacity: 1; transform: translateX(0); }

/* ─── field-tested ─── */
.field-tested {
  border-top: 1px solid var(--line);
  padding: clamp(3.5rem, 9vh, 6.5rem) clamp(1.2rem, 4vw, 3.5rem);
}

.ft-inner { max-width: 900px; margin: 0 auto; }

.ft-big {
  font-size: clamp(1.5rem, 3.4vw, 2.6rem);
  font-weight: 550;
  font-stretch: 95%;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.ft-big em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--hot);
}

/* ─── footer ─── */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  border-top: 1px solid var(--line);
  padding: 1.6rem clamp(1.2rem, 4vw, 3.5rem);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
}

.footer-links a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.footer-links a:hover { color: var(--hot); border-color: var(--hot); }

/* scroll-triggered reveals outside the hero */
.field-tested .reveal { animation: none; }
.field-tested .reveal.in { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }

/* ─── reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .reveal, .card, .slot { opacity: 1; transform: none; animation: none; }
  .marquee-track, .status-dot, .blink, .dots i { animation: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 640px) {
  .slot { flex-wrap: wrap; gap: 0.6rem; }
  .slot-hint { opacity: 1; transform: none; }
}

/* ─── language switch ─── */
.lang-switch {
  display: inline-flex;
  gap: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0.25rem;
}

.lang-switch button {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  background: transparent;
  border: 0;
  border-radius: 99px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.lang-switch button:hover { color: var(--ink); }
.lang-switch button.active { color: var(--bg); background: var(--ink); }
