/* ==========================================================================
   index.css — homepage styling, scoped to .home
   Loaded after base.css so these rules win on shared class names without
   touching other pages. Colors, radii, shadows, and fonts (including the
   light/dark flip) come from the shared token set in base.css :root.
   ========================================================================== */

.home {
  font-family: var(--font);
  color: var(--ink);
}

body:has(.home) {
  background: var(--surface);
}

/* -------------------------------------------------------------------- */
/* Hero                                                                  */
/* -------------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  /* the glow below bleeds wider than the hero by design (soft edges need
     room to fade out); clip it here — not on an ancestor of the sticky
     career panel further down the page, which position:sticky needs to
     stay visible (any ancestor with overflow other than visible disables
     sticky for its descendants). */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(2.5rem, 6vw, 5rem) 1rem clamp(2rem, 5vw, 3.5rem);
  gap: 0.75rem;
}

/* a quiet red glow behind the title — the page's ambient accent, standing
   in for the old red masthead block */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: min(56rem, 140vw);
  height: 26rem;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--red-glow), transparent 70%);
  filter: blur(10px);
  opacity: 0.5;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .hero::before {
    animation: home-glow-in 0.8s ease both;
  }
}

@keyframes home-glow-in {
  from { opacity: 0; }
  to { opacity: 0.5; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--red);
  background: color-mix(in srgb, var(--red) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 25%, transparent);
  border-radius: var(--radius-sm);
}

.title {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

.subtitle {
  max-width: 40rem;
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.6;
  color: var(--ink-soft);
  text-align: center;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  color: #fff;
  background: var(--red);
  border: 1px solid var(--red);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  color: #fff;
  background: var(--red-dark);
  border-color: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  color: var(--ink);
  border-color: var(--ink-faint);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------- */
/* Work section                                                         */
/* -------------------------------------------------------------------- */

.work {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  padding: 0 0 3rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.panel:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--red) 20%, var(--border));
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.item {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.5;
}

.item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.item-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  margin-bottom: 0.15rem;
}

.item-link {
  color: var(--blue);
  text-decoration: none;
  word-break: break-word;
}

.item-link:hover {
  text-decoration: underline;
}

.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.tag-frontend {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent);
}

.tag-backend {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, transparent);
}

.tag-fullstack {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 14%, transparent);
}

/* -------------------------------------------------------------------- */
/* Work grid — three panels get distinct treatments instead of one       */
/* repeated card, since the content types actually differ: career is a   */
/* real sequence (timeline), open source is a scannable list (compact).  */
/* -------------------------------------------------------------------- */

.work-grid {
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.65fr);
  align-items: start;
}

.work-secondary {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* the career column is naturally shorter than the stacked Projects/Open
   Source column; pinning it avoids a dead gap once the taller column
   scrolls past it. Desktop only — stacked mobile layout doesn't need it. */
@media screen and (min-width: 861px) {
  .panel-timeline {
    position: sticky;
    top: 5.5rem;
  }
}

/* Career — the timeline rail itself lives in base.css (shared with the
   About page); this bit is specific to how Home combines a title with an
   inline "current" tag. */

.timeline-item .item-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-current {
  color: var(--red);
  background: var(--red-tint);
}

/* Open source — compact, described list instead of bare links */

.list-compact {
  gap: 0.75rem;
}

.list-compact .item {
  padding-bottom: 0.75rem;
}

.list-compact .item-link {
  font-weight: 600;
  font-size: 0.92rem;
}

.list-compact .item-desc {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
}

/* -------------------------------------------------------------------- */
/* Motion (subtle entrance, respects reduced-motion)                    */
/* -------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .hero > * {
    animation: home-fade-up 0.5s ease both;
  }
  .hero > *:nth-child(1) { animation-delay: 0s; }
  .hero > *:nth-child(2) { animation-delay: 0.05s; }
  .hero > *:nth-child(3) { animation-delay: 0.1s; }
  .hero > *:nth-child(4) { animation-delay: 0.15s; }

  .panel {
    animation: home-fade-up 0.5s ease both;
  }
  .panel:nth-child(1) { animation-delay: 0.1s; }
  .panel:nth-child(2) { animation-delay: 0.18s; }
  .panel:nth-child(3) { animation-delay: 0.26s; }
}

@keyframes home-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------------------------------------------------------------------- */
/* Mobile                                                                */
/* -------------------------------------------------------------------- */

@media screen and (max-width: 860px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 640px) {
  .work {
    grid-template-columns: 1fr;
  }

  .cta {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}
