/* ==========================================================================
   home.css — Home page only: hero, services, projects, stack, CTA.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. HERO
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.9;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding-block: var(--sp-8);
}

.hero-content {
  max-width: 680px;
  display: grid;
  gap: var(--sp-5);
  justify-items: start;
}

.hero-title {
  font-size: var(--fs-hero);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.hero-sub {
  font-size: 1.05rem;
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

/* Stats strip */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: var(--sp-5) var(--sp-6);
  margin-top: var(--sp-3);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  width: 100%;
}

.hero-stats dt {
  font-size: var(--fs-xs);
  color: var(--text-3);
  order: 2;
}

.hero-stats dd {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  order: 1;
}

.hero-stats > div {
  display: grid;
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: var(--sp-5);
  transform: translateX(-50%);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  transition: transform var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.scroll-cue:hover {
  transform: translateX(-50%) translateY(3px);
  color: var(--text);
}

.scroll-cue svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   2. SECTION HEADS
   -------------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.section .eyebrow {
  margin-bottom: var(--sp-3);
}

/* --------------------------------------------------------------------------
   3. SKILLS TERMINAL
   The terminal is intentionally dark in BOTH themes — it's an object,
   not a surface, so it doesn't flip with the theme.
   -------------------------------------------------------------------------- */
.skills-terminal {
  margin-top: var(--sp-6);
  background: #17140F;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.st-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(237, 230, 218, 0.12);
}

.st-dots {
  display: flex;
  gap: 6px;
}

.st-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(237, 230, 218, 0.25);
}

.st-dots i:first-child {
  background: var(--accent);
}

.st-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: rgba(237, 230, 218, 0.55);
  margin-left: var(--sp-2);
  user-select: none;
}

.st-body {
  padding: var(--sp-5) var(--sp-6);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.9;
}

.st-block + .st-block {
  margin-top: var(--sp-4);
}

.st-cmd {
  color: #FFFFFF;
  max-width: none;
}

.st-prompt {
  color: #F0997B;
  margin-right: 0.5ch;
  user-select: none;
}

/* Command text: min-height keeps the line from collapsing while JS types */
.st-type {
  display: inline-block;
  min-height: 1em;
  overflow-wrap: anywhere;
}

.st-out {
  color: #B8B0A5;
  padding-left: 1.5ch;
  max-width: none;
  overflow-wrap: anywhere; /* long tokens (URLs) wrap — no mobile overflow */
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}

.st-out a {
  color: #F0997B;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.st-ok {
  color: #5DCAA5;
  white-space: nowrap;
}

/* JS adds .st-armed to the container before typing begins:
   outputs hide, then .show reveals them one by one.
   Without JS (or with reduced motion) everything is simply visible. */
.st-armed .st-out {
  opacity: 0;
  transform: translateY(4px);
}

.st-armed .st-out.show {
  opacity: 1;
  transform: none;
}

.st-idle {
  margin-top: var(--sp-4);
}

.st-cursor {
  display: inline-block;
  width: 9px;
  height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: st-blink 1.1s steps(1) infinite;
}

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

.st-hint {
  margin-top: var(--sp-4);
  font-size: var(--fs-xs);
}

.st-hint kbd {
  font-family: var(--font-mono);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 5px;
}

@media (max-width: 640px) {
  .st-body {
    padding: var(--sp-4);
    font-size: 0.78rem;
    line-height: 1.8;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-cursor {
    animation: none;
  }

  .st-armed .st-out {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   4. PROJECTS
   -------------------------------------------------------------------------- */
.project-feature {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--sp-4);
}

.project-feature-visual {
  background: var(--text);
  min-height: 220px;
  overflow: hidden;
}

.project-feature-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-feature-body {
  padding: var(--sp-6);
  display: grid;
  gap: var(--sp-3);
  align-content: center;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  display: grid;
  gap: var(--sp-3);
  align-content: start;
  box-shadow: var(--shadow-sm);
}

.project-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.project-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.project-link {
  margin-left: auto;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   5. TECH STACK
   -------------------------------------------------------------------------- */
.stack-title {
  max-width: 26ch;
  margin-bottom: var(--sp-6);
}

.tech-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.6rem 1.1rem;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
}

.tech-pill img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* --------------------------------------------------------------------------
   6. CTA BAND
   -------------------------------------------------------------------------- */
.cta-band {
  background: var(--bg-sunken);
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
}

.cta-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   7. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .project-feature {
    grid-template-columns: 1fr;
  }

  .project-feature-visual {
    min-height: 150px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: auto;
  }

  .hero-inner {
    padding-block: var(--sp-7) var(--sp-8);
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .scroll-cue {
    display: none;
  }
}



/* --------------------------------------------------------------------------
   8. PRIVACY PEEK — dark scan console, same visual language as the
   skills terminal. Dark in both themes: it's an object, not a surface.
   -------------------------------------------------------------------------- */
.peek-sub {
  margin-top: var(--sp-2);
  max-width: 52ch;
}

.peek-card {
  position: relative;
  margin-top: var(--sp-6);
  max-width: 620px;
  background: #17140F;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* Scan-line sweep, played once when .is-scanned lands */
.peek-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -3px;
  height: 3px;
  background: var(--accent);
  opacity: 0;
}

.peek-card.is-scanned::after {
  animation: peek-sweep 900ms var(--ease-out) forwards;
}

@keyframes peek-sweep {
  0%   { opacity: 0.9; transform: translateY(0); }
  100% { opacity: 0;   transform: translateY(340px); }
}

.peek-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(237, 230, 218, 0.12);
}

.peek-dots {
  display: flex;
  gap: 6px;
}

.peek-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(237, 230, 218, 0.25);
}

.peek-dots i:first-child {
  background: var(--accent);
}

.peek-title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: rgba(237, 230, 218, 0.55);
  user-select: none;
}

.peek-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: #F0997B;
}

.peek-badge.is-done {
  color: #5DCAA5;
}

.peek-rows {
  padding: var(--sp-4) var(--sp-5);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.peek-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-4);
  padding-block: 7px;
  /* rows print one by one once .is-scanned lands */
  opacity: 0;
  transform: translateY(5px);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}

.is-scanned .peek-row {
  opacity: 1;
  transform: none;
}

.is-scanned .peek-row:nth-child(1) { transition-delay: 100ms; }
.is-scanned .peek-row:nth-child(2) { transition-delay: 220ms; }
.is-scanned .peek-row:nth-child(3) { transition-delay: 340ms; }
.is-scanned .peek-row:nth-child(4) { transition-delay: 460ms; }
.is-scanned .peek-row:nth-child(5) { transition-delay: 580ms; }
.is-scanned .peek-row:nth-child(6) { transition-delay: 700ms; }
.is-scanned .peek-row:nth-child(7) { transition-delay: 820ms; }

.peek-row dt {
  color: rgba(237, 230, 218, 0.45);
  flex-shrink: 0;
}

.peek-row dd {
  color: #EDE6DA;
  text-align: right;
  overflow-wrap: anywhere;   /* long values wrap — no mobile overflow */
}

.peek-row dd.peek-good {
  color: #5DCAA5;
}

.peek-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(216, 90, 48, 0.12);
  border-top: 1px solid rgba(237, 230, 218, 0.1);
  font-size: var(--fs-xs);
  color: #F5C4B3;
}

.peek-cta {
  font-weight: 600;
  color: #F0997B;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out);
}

.peek-cta:hover {
  color: #FFFFFF;
}

@media (max-width: 560px) {
  .peek-rows {
    padding: var(--sp-3) var(--sp-4);
    font-size: 0.76rem;
  }

  .peek-row {
    flex-direction: column;
    gap: 0;
    padding-block: 8px;
  }

  .peek-row dd {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .peek-card::after {
    animation: none;
  }

  .peek-row {
    opacity: 1;
    transform: none;
    transition: none;
  }
}