@import url('fonts/fonts.css');

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

:root {
  --bg: #0a0a0b;
  --bg-raised: #111113;
  --bg-hover: #18181b;
  --text: #e4e4e7;
  --text-dim: #a1a1aa;
  --text-muted: #71717a;
  --accent: #e0b87a;            /* brighter warm amber */
  --accent-dim: #c39a5e;
  --accent-glow: #f0cc8a;
  --border: #27272a;
  --border-light: #3f3f46;
  --max-narrow: 640px;
  --max-wide: 1180px;
}

html { scroll-behavior: smooth; font-size: 17px; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--bg); }

a { color: inherit; text-decoration: none; }

/* ─── NAV ──────────────────────────────────────────────── */

nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.1rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
nav.scrolled {
  background: rgba(10, 10, 11, 0.92);
  border-bottom-color: var(--border);
}
.nav-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.85rem; font-weight: 500; letter-spacing: 0.14em;
}
.nav-logo .varjo { color: var(--text); }
.nav-logo .soft  { color: var(--text-muted); }
.nav-links {
  display: flex; gap: 2rem; list-style: none;
}
.nav-links a {
  font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.06em;
  transition: color 0.2s;
  text-transform: lowercase;
}
.nav-links a:hover { color: var(--accent); }
.nav-toggle {
  display: none;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.25rem; cursor: pointer; padding: 0;
}

/* ─── HERO ─────────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 8rem 2rem 4rem;
  position: relative;
}
.hero-inner {
  max-width: var(--max-wide); margin: 0 auto; width: 100%;
}
.hero-eyebrow {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent-dim);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 3rem;
  opacity: 0; transform: translateY(8px);
  animation: rise 1.1s 0.2s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero h1 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(4rem, 11vw, 9.5rem);
  font-weight: 300;
  line-height: 0.96;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 3rem;
  opacity: 0; transform: translateY(12px);
  animation: rise 1.4s 0.35s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero h1 .dot {
  color: var(--accent);
  font-family: inherit;
}
.hero-sub {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 300;
  line-height: 1.4;
  color: var(--text-dim);
  max-width: 640px;
  font-style: italic;
  opacity: 0; transform: translateY(12px);
  animation: rise 1.4s 0.7s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero-foot {
  position: absolute; left: 0; right: 0; bottom: 2.5rem;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 2rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  animation: fade 1.5s 1.6s forwards;
}
.hero-scroll {
  display: inline-flex; align-items: center; gap: 0.6rem;
}
.hero-scroll::after {
  content: '';
  display: inline-block; width: 28px; height: 1px;
  background: var(--accent-dim);
  animation: scroll-line 2.2s ease-in-out infinite;
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  to { opacity: 1; }
}
@keyframes scroll-line {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(1.6); }
}

/* ─── DRIFT ────────────────────────────────────────────── */

.drift {
  padding: 10rem 2rem 8rem;
  border-top: 1px solid var(--border);
}
.drift-inner {
  max-width: var(--max-narrow); margin: 0 auto;
}
.section-label {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}
.drift h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}
.drift p {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.18rem;
  line-height: 1.65;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}
.drift p strong {
  color: var(--text);
  font-weight: 500;
}
.drift p em {
  color: var(--accent);
  font-style: italic;
}

/* ─── STACK (three products) ──────────────────────────── */

.stack {
  padding: 8rem 2rem 10rem;
  border-top: 1px solid var(--border);
}
.stack-header {
  max-width: var(--max-narrow); margin: 0 auto 5rem;
}
.stack-header h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}
.stack-header p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-dim);
}

.stack-grid {
  max-width: var(--max-wide); margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
}
.product {
  padding: 3rem 2.5rem 3.5rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex; flex-direction: column;
  min-height: 520px;
  transition: background 0.3s;
}
.product:last-child { border-right: none; }
.product:hover { background: var(--bg-raised); }
.product:hover .product-cta { color: var(--accent); }
.product-tag {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
}
.product-tag .status {
  color: var(--text-muted);
  margin-left: 0.5rem;
}
.product h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 2.4rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  line-height: 1;
}
.product-pitch {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--accent);
  line-height: 1.4;
  margin-bottom: 2rem;
}
.product-body {
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.product-body + .product-body { margin-top: 0; }
.product-cta {
  margin-top: auto;
  padding-top: 2rem;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  transition: color 0.2s;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.product-cta::after {
  content: '→';
  transition: transform 0.2s;
}
.product:hover .product-cta::after {
  transform: translateX(4px);
}

/* Dots product tile — has a live mini-demo area */
.product--dots .product-demo {
  margin-top: auto;
  margin-bottom: 1.5rem;
  padding: 1.2rem;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.product--dots .product-demo .dot-pair {
  display: inline-flex; gap: 5px; vertical-align: middle;
  margin-right: 0.4rem;
}
.product--dots .product-demo .dot-pair span {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-dim);
  opacity: 0.5;
}

/* ─── MANIFESTO ────────────────────────────────────────── */

.manifesto {
  padding: 8rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.manifesto-inner {
  max-width: 900px; margin: 0 auto;
}
.manifesto p {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 300;
  line-height: 1.3;
  color: var(--text-dim);
  letter-spacing: -0.015em;
}
.manifesto p strong {
  color: var(--text);
  font-weight: 400;
}
.manifesto p em {
  color: var(--accent);
  font-style: italic;
}
.manifesto-attr {
  margin-top: 3rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ─── WRITING ──────────────────────────────────────────── */

.writing {
  padding: 8rem 2rem 6rem;
  border-top: 1px solid var(--border);
}
.writing-inner {
  max-width: var(--max-narrow); margin: 0 auto;
}
.writing h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 3rem;
}
.writing-list { list-style: none; }
.writing-list li { border-bottom: 1px solid var(--border); }
.writing-list li:last-child { border-bottom: none; }
.writing-list a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1.6rem 0;
  gap: 2rem;
  transition: color 0.2s;
}
.writing-list a:hover { color: var(--accent); }
.writing-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  flex: 1;
}
.writing-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ─── ABOUT ────────────────────────────────────────────── */

.about {
  padding: 8rem 2rem;
  border-top: 1px solid var(--border);
}
.about-inner {
  max-width: var(--max-narrow); margin: 0 auto;
}
.about h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 2rem;
}
.about p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
}
.about p strong { color: var(--text); font-weight: 500; }
.about-links {
  margin-top: 2.5rem;
  display: flex; gap: 1.6rem; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.about-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}
.about-links a:hover { color: var(--accent); }

/* ─── CONTACT ──────────────────────────────────────────── */

.contact {
  padding: 8rem 2rem;
  border-top: 1px solid var(--border);
}
.contact-inner {
  max-width: var(--max-narrow); margin: 0 auto;
}
.contact h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 1.2rem;
}
.contact-intro {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 2.5rem;
}
.contact form {
  display: flex; flex-direction: column; gap: 1rem;
  margin-top: 1rem;
}
.contact input,
.contact textarea {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.95rem 1.1rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.contact input:focus,
.contact textarea:focus {
  border-color: var(--accent);
  background: var(--bg-raised);
}
.contact textarea {
  min-height: 120px; resize: vertical; line-height: 1.6;
}
.contact button {
  margin-top: 0.6rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 1rem 1.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
  align-self: flex-start;
}
.contact button:hover { background: var(--accent-glow); }
.contact-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1.2rem;
  line-height: 1.6;
}

/* ─── FOOTER ───────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}
footer a {
  color: var(--text-dim);
  transition: color 0.2s;
  margin: 0 0.6rem;
}
footer a:hover { color: var(--accent); }

/* ─── DOTS PRESENCE (mock) ─────────────────────────────── */

.dots-presence {
  position: fixed; bottom: 1.8rem; right: 1.8rem;
  z-index: 80;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 0.8rem;
  pointer-events: none;
}
.dots-presence > * { pointer-events: auto; }

.dots-widget {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0.75rem 0.95rem;
  background: rgba(17, 17, 19, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 0;
}
.dots-widget:hover { border-color: var(--border-light); }
.dots-widget.ready { border-color: var(--accent-dim); }
.dots-widget.ready:hover { border-color: var(--accent); background: rgba(24, 24, 27, 0.95); }

.dots-pair {
  display: inline-flex; gap: 6px;
}
.dots-pair span {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.6s ease, box-shadow 0.6s ease, transform 0.4s ease;
}
.dots-widget.ready .dots-pair span {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.dots-widget.active .dots-pair span:nth-child(1) {
  transform: translateX(1px);
}
.dots-widget.active .dots-pair span:nth-child(2) {
  transform: translateX(-1px);
}

.dots-label {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: color 0.3s;
}
.dots-widget.ready .dots-label { color: var(--accent); }

.dots-panel {
  width: min(380px, calc(100vw - 3rem));
  background: rgba(17, 17, 19, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 1.2rem;
  opacity: 0; transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-dim);
}
.dots-panel.visible {
  opacity: 1; transform: none;
  pointer-events: auto;
}
.dots-panel-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.dots-panel-head .close {
  cursor: pointer; color: var(--text-muted);
}
.dots-panel-head .close:hover { color: var(--accent); }
.dots-messages {
  display: flex; flex-direction: column; gap: 0.85rem;
  max-height: 300px; overflow-y: auto;
  margin-bottom: 0.9rem;
}
.dots-msg {
  font-size: 0.88rem;
  line-height: 1.55;
}
.dots-msg.user {
  color: var(--text);
  padding-left: 0.9rem;
  border-left: 2px solid var(--accent-dim);
}
.dots-msg.dots {
  color: var(--text-dim);
}
.dots-msg.system {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.8rem;
}
.dots-input-row {
  display: flex; gap: 0.5rem;
  margin-top: 0.5rem;
}
.dots-input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.55rem 0.75rem;
  outline: none;
  border-radius: 4px;
}
.dots-input:focus { border-color: var(--accent); }
.dots-input:disabled {
  opacity: 0.4; cursor: not-allowed;
}
.dots-input::placeholder { color: var(--text-muted); }
.dots-send {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 0 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}
.dots-send:hover { background: var(--accent-glow); }
.dots-send:disabled {
  background: var(--border-light); color: var(--text-muted);
  cursor: not-allowed;
}

/* Attention progress (shown until ready) */
.dots-progress-bar {
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
  margin-top: 0.8rem;
}
.dots-progress-fill {
  height: 100%; width: 0;
  background: var(--accent);
  transition: width 0.5s ease;
}

/* Mock banner */
.mock-banner {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--accent);
  color: var(--bg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.35rem 1rem;
  z-index: 200;
}
.mock-banner a {
  text-decoration: underline; color: var(--bg);
  font-weight: 500;
}

/* ─── MOBILE ───────────────────────────────────────────── */

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute; top: 100%; right: 0;
    background: rgba(10, 10, 11, 0.96);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.8rem;
    min-width: 160px;
  }
  .nav-links.open { display: flex; }

  .hero { padding: 6rem 1.5rem 4rem; }
  .hero-foot { padding: 0 1.5rem; flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  .drift, .stack, .manifesto, .writing, .about, .contact {
    padding-left: 1.5rem; padding-right: 1.5rem;
  }

  .stack-grid { grid-template-columns: 1fr; }
  .product {
    border-right: none;
    min-height: auto;
  }
  .product:last-child { border-bottom: none; }

  .writing-list a { flex-direction: column; gap: 0.4rem; padding: 1.2rem 0; }
  .writing-meta { align-self: flex-start; }

  .dots-presence { bottom: 1rem; right: 1rem; }
  .dots-widget { padding: 0.6rem 0.8rem; }
  .dots-label { display: none; }
}

/* ─── REDUCED MOTION ───────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hero-eyebrow, .hero h1, .hero-sub, .hero-foot { opacity: 1; transform: none; }
}
