/* v3 preview, additive only. Does not touch /assets/styles.css */

.preview-flag {
  position: fixed; bottom: 16px; left: 16px; z-index: 900;
  background: var(--fg); color: var(--bg);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; padding: 8px 14px; border-radius: 100px;
}

/* Currently running */
.stack-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border); border: 1px solid var(--border);
}
.stack-item { background: var(--bg-raised); padding: 32px 28px; }
.stack-item .meta {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 16px;
}
.stack-item .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: livepulse 2.6s ease-in-out infinite;
}
@keyframes livepulse { 0%,100% { opacity:.3 } 50% { opacity:1 } }
.stack-item h4, .stack-item h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.stack-item p { font-size: 15px; color: var(--muted); }
.stack-item .tag {
  display: inline-block; margin-top: 16px; font-family: var(--font-mono);
  font-size: 11px; color: var(--accent); border: 1px solid var(--accent-soft);
  background: var(--accent-soft); padding: 3px 10px; border-radius: 100px;
}

/* Capability blocks (services) */
.cap { padding: 56px 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; }
.cap:first-of-type { border-top: none; padding-top: 0; }
.cap .cap-num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); display: block; margin-bottom: 12px; }
.cap h3 { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 14px; }
.cap .cap-side p { font-size: 15px; color: var(--muted); }
.cap .cap-body p { font-size: 17px; margin-bottom: 18px; }
.cap ul.checks li {
  font-size: 15px; color: var(--fg-soft); padding: 9px 0 9px 22px;
  border-top: 1px solid var(--border); position: relative;
}
.cap ul.checks li:first-child { border-top: none; }
.cap ul.checks li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.cap .evidence {
  margin-top: 20px; font-family: var(--font-mono); font-size: 12px;
  color: var(--muted); letter-spacing: .04em; line-height: 1.7;
}

/* Built list */
.built-item { padding: 40px 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: 200px 1fr; gap: 40px; }
.built-item:first-of-type { border-top: none; padding-top: 0; }
.built-item .b-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); line-height: 2; text-transform: uppercase; letter-spacing: .06em; }
.built-item h3 { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 12px; }
.built-item p { font-size: 17px; margin-bottom: 12px; }
.built-item .b-link { font-size: 15px; border-bottom: 1px solid var(--border-strong); padding-bottom: 2px; }
.built-item .b-link:hover { border-color: var(--fg); }
.built-item.private h3::after {
  content: "Client work"; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--border-strong); padding: 4px 9px; border-radius: 100px;
  margin-left: 12px; vertical-align: middle;
}

/* Contact prompts */
.prompt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 48px; }
.prompt { border-top: 1px solid var(--fg); padding-top: 16px; }
.prompt .q { font-family: var(--font-display); font-size: 16px; font-weight: 500; margin-bottom: 6px; }
.prompt p { font-size: 14px; color: var(--muted); }

.note-box {
  border-left: 2px solid var(--accent); padding: 4px 0 4px 20px;
  font-size: 15px; color: var(--muted); max-width: 640px; margin-top: 40px;
}

@media (max-width: 900px) {
  .stack-grid { grid-template-columns: 1fr; }
  .cap { grid-template-columns: 1fr; gap: 24px; padding: 40px 0; }
  .built-item { grid-template-columns: 1fr; gap: 16px; }
  .prompt-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ═══════════════════════════════════════════════
   MOTION LAYER — bolder, dynamic without noise
   ═══════════════════════════════════════════════ */

/* Page transitions (progressive enhancement, Chrome/Edge) */
@view-transition { navigation: auto; }

/* 1. Scroll progress */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: var(--accent); z-index: 999;
  transition: transform .1s linear;
}

/* 2. Hero: living background grid + cursor spotlight */
.hero { --mx: 50%; --my: 40%; }
.hero-grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at var(--mx) var(--my), #000 0%, transparent 62%);
  -webkit-mask-image: radial-gradient(circle at var(--mx) var(--my), #000 0%, transparent 62%);
  opacity: .9;
  transition: mask-image .2s ease;
}
.hero-glow {
  position: absolute; z-index: 0; pointer-events: none;
  width: 620px; height: 620px; border-radius: 50%;
  left: var(--mx); top: var(--my); transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(181,83,60,.13) 0%, rgba(181,83,60,0) 68%);
  transition: left .6s cubic-bezier(.2,.8,.2,1), top .6s cubic-bezier(.2,.8,.2,1);
}

/* 3. Headline reveal, line by line */
.reveal-mask { display: block; overflow: hidden; }
.reveal-mask > span {
  display: block;
  animation: line-up .9s cubic-bezier(.16,1,.3,1) backwards;
}
.reveal-mask:nth-of-type(1) > span { animation-delay: .05s; }
.reveal-mask:nth-of-type(2) > span { animation-delay: .15s; }
.reveal-mask:nth-of-type(3) > span { animation-delay: .25s; }
@keyframes line-up { from { transform: translateY(105%); } to { transform: translateY(0); } }

/* Accent sweep on a key phrase */
.marked {
  position: relative; white-space: nowrap;
  background-image: linear-gradient(rgba(181,83,60,.20), rgba(181,83,60,.20));
  background-repeat: no-repeat;
  background-position: 0 78%;
  background-size: 0% .34em;
  animation: mark-in .9s cubic-bezier(.16,1,.3,1) .85s forwards;
}
@keyframes mark-in { to { background-size: 100% .34em; } }

/* 4. Inverted full-bleed section */
section.inverted {
  background: var(--fg); color: var(--bg);
  border-bottom: none; position: relative; overflow: hidden;
}
section.inverted h2, section.inverted h3, section.inverted h4 { color: #FAFAF8; }
section.inverted p { color: #A5A1A9; }
section.inverted .eyebrow { color: #E08A72; }
section.inverted .stack-grid { background: #2A272E; border-color: #2A272E; }
section.inverted .stack-item { background: #1D1B21; position: relative; overflow: hidden; }
section.inverted .stack-item h4, section.inverted .stack-item h3 { color: #FAFAF8; }
section.inverted .stack-item .tag { background: rgba(181,83,60,.16); border-color: transparent; color: #E08A72; }
section.inverted .btn-secondary { border-color: #3A363F; color: #FAFAF8; }
section.inverted .btn-secondary:hover { border-color: #FAFAF8; }

/* Cursor-tracking glow border on cards */
.stack-item { --cx: 50%; --cy: 50%; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.stack-item::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(340px circle at var(--cx) var(--cy), rgba(181,83,60,.20), transparent 60%);
  transition: opacity .35s ease;
}
.stack-item:hover::before { opacity: 1; }
.stack-item:hover { transform: translateY(-3px); }

/* 5. Terminal panel */
.term {
  margin-top: 56px; border: 1px solid #2A272E; border-radius: 8px;
  background: #141317; overflow: hidden; font-family: var(--font-mono);
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid #2A272E;
}
.term-bar i { width: 9px; height: 9px; border-radius: 50%; background: #3A363F; display: block; }
.term-bar span { font-size: 11px; color: #75726C; letter-spacing: .08em; margin-left: 8px; text-transform: uppercase; }
.term-body { padding: 22px 20px; min-height: 220px; font-size: 13px; line-height: 2.1; }
.term-line { display: block; color: #A5A1A9; opacity: 0; }
.term-line.on { opacity: 1; }
.term-line .k { color: #E08A72; }
.term-line .v { color: #6F6B75; }
.term-cursor { display: inline-block; width: 7px; height: 14px; background: #E08A72; vertical-align: middle; animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 0%,49% { opacity: 1 } 50%,100% { opacity: 0 } }

/* 6. Dual marquee */
.marquee-track.reverse { animation-direction: reverse; margin-top: 20px; opacity: .45; }
.marquee-track.reverse span { font-size: 16px; }

/* 7. Counters */
.number-item .val { font-variant-numeric: tabular-nums; }

/* 8. Magnetic CTA */
.btn.magnetic { transition: transform .25s cubic-bezier(.2,.8,.2,1), background .2s; will-change: transform; }

/* 9. Section entrance for lists */
.stagger > * { animation: rise .7s cubic-bezier(.16,1,.3,1) backwards; }
.stagger > *:nth-child(1) { animation-delay: .04s }
.stagger > *:nth-child(2) { animation-delay: .10s }
.stagger > *:nth-child(3) { animation-delay: .16s }
.stagger > *:nth-child(4) { animation-delay: .22s }
.stagger > *:nth-child(5) { animation-delay: .28s }
.stagger > *:nth-child(6) { animation-delay: .34s }
@keyframes rise { from { opacity: 0; transform: translateY(18px) } to { opacity: 1; transform: none } }

/* 10. Work rows: accent sweep on hover */
.work-item { position: relative; }
.work-item::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .5s cubic-bezier(.16,1,.3,1);
}
.work-list a.work-item:hover::after { transform: scaleX(1); }
.work-list a.work-item:hover { opacity: 1; }
.work-item .arrow { transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.work-list a.work-item:hover .arrow { transform: translateX(8px); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-mask > span, .stagger > * { opacity: 1 !important; transform: none !important; }
  .marked { background-size: 100% .34em; }
  .term-line { opacity: 1; }
}

/* Hero proportions for v3: big, but the CTA still lands above the fold */
.hero { padding: 186px 0 108px; }
.hero h1 { font-size: clamp(36px, 4.7vw, 62px); }
.hero .lead { font-size: 19px; max-width: 600px; }

/* Nav adapts over dark sections */
header.site-nav.on-dark {
  background: rgba(23, 22, 26, .82);
  border-bottom-color: #2A272E;
}
header.site-nav.on-dark .nav-brand { color: #FAFAF8; }
header.site-nav.on-dark .nav-links a { color: #A5A1A9; }
header.site-nav.on-dark .nav-links a:hover { color: #FAFAF8; }
