/*
  Page-specific styling for home, biography, projects, contact, and 404 pages.
  These styles intentionally vary composition to avoid template-like repetition.
*/
.hero {
  position: relative;
  overflow: hidden;
  padding: 4.4rem 0 2.8rem;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 8% 8% auto auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(73, 228, 255, 0.12), transparent 62%);
  filter: blur(20px);
  z-index: 0;
}

.hero-panel {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1.4rem;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  align-items: start;
}

.hero-copy {
  max-width: 62ch;
}

.hero-sub {
  max-width: 56ch;
  font-size: clamp(1.05rem, 0.35vw + 0.98rem, 1.18rem);
  line-height: 1.72;
}

.tagline {
  font-size: clamp(1.3rem, 2.5vw, 1.95rem);
  line-height: 1.33;
  color: #dce8ff;
  margin-bottom: 1.05rem;
}

.hero-rail {
  border: 1px solid rgba(118, 138, 236, 0.34);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(17, 24, 49, 0.88), rgba(9, 14, 31, 0.88));
  padding: 1rem;
}

.rail-metric {
  border-bottom: 1px dashed rgba(118, 138, 236, 0.3);
  padding: 0.7rem 0;
}

.rail-metric:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.metric-value {
  display: block;
  color: #eff4ff;
  font-size: clamp(1.04rem, 0.35vw + 0.98rem, 1.16rem);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.metric-label {
  display: block;
  color: #aeb8df;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.action-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.intro-grid .card-soft h2 {
  margin-bottom: 0.45rem;
}

.focus-strip {
  margin-top: 1.1rem;
}

.meta-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meta-card {
  border-radius: 13px;
  border: 1px solid rgba(112, 130, 236, 0.25);
  background: rgba(112, 130, 236, 0.08);
  padding: 1rem;
}

/* Page masthead creates a distinct top rhythm across non-home pages. */
.page-mast {
  position: relative;
  margin-bottom: 1.2rem;
}

.page-mast h1 {
  max-width: 18ch;
}

.page-mast::before {
  content: "";
  position: absolute;
  right: 16px;
  top: 14px;
  width: 130px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(73, 228, 255, 0.65));
}

.story-columns {
  columns: 2 280px;
  column-gap: 2rem;
}

.story-columns p {
  break-inside: avoid;
  margin-bottom: 1.05rem;
}

.timeline {
  position: relative;
  margin-left: 0.3rem;
  border-left: 1px dashed rgba(113, 136, 255, 0.4);
  padding-left: 1.25rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 1rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgba(112, 130, 236, 0.2);
  border-radius: 10px;
  background: rgba(112, 130, 236, 0.07);
  font-size: 0.96rem;
  line-height: 1.56;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.73rem;
  top: 0.85rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(140deg, #4ea0ff, #966bff);
  box-shadow: 0 0 10px rgba(78, 160, 255, 0.7);
}

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

.tool-tile {
  border: 1px solid rgba(118, 142, 255, 0.26);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(112, 130, 236, 0.11), rgba(112, 130, 236, 0.04));
  padding: 0.88rem;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.tool-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(73, 228, 255, 0.45);
}

.projects-filter {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filter-btn {
  border-radius: 999px;
  border: 1px solid rgba(124, 148, 255, 0.4);
  background: rgba(124, 148, 255, 0.08);
  color: #d9e2ff;
  padding: 0.45rem 0.85rem;
  font-size: 0.83rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
  border-color: rgba(73, 228, 255, 0.55);
  background: rgba(73, 228, 255, 0.14);
  transform: translateY(-1px);
}

.project-card {
  position: relative;
  overflow: hidden;
}

.project-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 11px;
  margin-bottom: 0.9rem;
  border: 1px solid rgba(124, 148, 255, 0.36);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

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

.project-thumb::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(4, 6, 16, 0.58));
}

.thumb-one {
  background-image:
    radial-gradient(circle at 20% 32%, rgba(73, 228, 255, 0.28), transparent 26%),
    linear-gradient(130deg, #1f2f6a, #3f1d73, #1d4965);
}

.thumb-two {
  background-image:
    radial-gradient(circle at 72% 24%, rgba(150, 107, 255, 0.24), transparent 30%),
    linear-gradient(130deg, #17324f, #2a1453, #384a7f);
}

.thumb-three {
  background-image:
    radial-gradient(circle at 40% 70%, rgba(78, 160, 255, 0.24), transparent 24%),
    linear-gradient(130deg, #2f1a56, #114c6f, #1f3465);
}

.project-meta {
  font-size: 0.84rem;
  letter-spacing: 0.015em;
  color: #c2cced;
  margin-bottom: 0.8rem;
}

.youtube-link-box {
  border: 1px solid rgba(255, 50, 76, 0.4);
  background: linear-gradient(145deg, rgba(255, 50, 76, 0.1), rgba(255, 50, 76, 0.04));
  border-radius: 14px;
  padding: 1.2rem;
}

.contact-layout .section-shell {
  height: 100%;
}

form .field-wrap {
  margin-bottom: 0.95rem;
}

label {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #d2dbff;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid rgba(115, 138, 245, 0.45);
  background: rgba(8, 12, 26, 0.9);
  border-radius: 10px;
  color: #e8ecff;
  padding: 0.75rem 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.textarea {
  min-height: 150px;
  resize: vertical;
}

.input:focus,
.textarea:focus {
  outline: 0;
  border-color: rgba(73, 228, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(73, 228, 255, 0.16);
}

.input.is-error,
.textarea.is-error {
  border-color: rgba(251, 113, 133, 0.8);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.16);
}

.feedback {
  margin-top: 0.8rem;
  min-height: 1.2em;
  font-size: 0.92rem;
}

.feedback.ok { color: var(--success); }
.feedback.err { color: var(--danger); }

.particles-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.5;
}

.not-found-wrap {
  max-width: 760px;
  margin: 10vh auto;
}

.not-found-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  text-align: left;
}

.ghost-hint {
  opacity: 0.66;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 1rem;
}

.error-rune {
  border: 1px dashed rgba(118, 138, 236, 0.42);
  border-radius: 12px;
  padding: 1rem;
  min-height: 180px;
  background: rgba(118, 138, 236, 0.07);
}

.error-rune p {
  margin: 0;
  color: #c8d2f3;
}

@media (max-width: 991px) {
  .hero-panel,
  .not-found-grid {
    grid-template-columns: 1fr;
  }

  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .hero {
    padding: 3.2rem 0 2.15rem;
  }

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

  .story-columns {
    columns: 1;
  }

  .page-mast::before {
    display: none;
  }

  .page-mast h1 {
    max-width: 100%;
  }
}
