/* ============================================================
 *  MightyFilipns — "populated board" theme
 *  Signature: the hero is a schematic that powers up on load,
 *  and every project/education entry reads like a component on
 *  a datasheet (reference designator + pin row).
 *  ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700;800&family=Inter:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  
  /* --- palette: dark board, white traces, high contrast throughout --- */
  --bg: #0a0a0a;
  --bg-panel: #121212;
  --bg-panel-2: #1a1a1a;
  --line: #333333;
  --copper: #ffffff;
  --copper-bright: #ffffff;
  --gold: #e6e6e6;
  --silk: #ffffff;
  --silk-dim: #999999;
  --danger: #ff6b5e;
  --glow-rgb: 255, 255, 255;
  
  --font-display: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--copper);
  color: #0a0a0a;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--silk);
  background-image:
  radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1.4px);
  background-size: 26px 26px;
}

a {
  color: inherit;
}

/* ---------------------------------- header / nav ---------------------------------- */

.site-header {
  padding: 1rem 1.25rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
}

nav {
  display: flex;
  gap: 0.75rem;
  max-width: 960px;
  margin: 0 auto;
}

.nav-button {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

/* ---------------------------------- layout shells ---------------------------------- */

.content {
  max-width: 680px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.home .content {
  margin: 0 auto;
  max-width: 760px;
}

.project-page {
  min-height: calc(100vh - 73px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-placeholder {
  text-align: center;
}

.section {
  min-height: calc(100vh - 73px);
  display: flex;
  align-items: center;
  padding: 2rem 0;
  position: relative;
}

/* ---------------------------------- hero / landing ---------------------------------- */

.landing {
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
}

.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
  linear-gradient(rgba(238, 242, 236, 0.025) 1px, transparent 1px),
  linear-gradient(90deg, rgba(238, 242, 236, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
  z-index: -2;
}

.hero-schematic {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.85;
}

.hero-schematic path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.hero-schematic path.trace {
  stroke: var(--copper);
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: trace-draw 2.4s ease-out forwards;
}

.hero-schematic circle.pad {
  fill: var(--bg);
  stroke: var(--copper);
  stroke-width: 1.5;
  opacity: 0;
  animation: pad-power 0.6s ease-out forwards;
}

.hero-schematic circle.pad.glow {
  fill: var(--gold);
  stroke: none;
  filter: drop-shadow(0 0 4px var(--gold));
}

@keyframes trace-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes pad-power {
  to {
    opacity: 1;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--copper-bright);
  text-transform: uppercase;
  margin: 0 0 0.85rem;
}

.eyebrow::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.landing h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  line-height: 1.08;
}

.landing .tagline {
  font-size: 1.08rem;
  color: var(--silk-dim);
  max-width: 34ch;
  line-height: 1.55;
  margin: 0;
}

.landing .tagline strong {
  color: var(--silk);
  font-weight: 600;
}

/* ---------------------------------- buttons ---------------------------------- */

.actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.button,
.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 0.35rem;
  text-decoration: none;
  font-weight: 600;
  background: var(--copper);
  color: #0a0a0a;
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover,
.nav-button:hover {
  background: var(--copper-bright);
  color: #0a0a0a;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(var(--glow-rgb), 0.3);
}

.button.secondary,
.nav-button.secondary {
  background: transparent;
  color: var(--silk);
  border: 1px solid var(--line);
}

.button.secondary:hover,
.nav-button.secondary:hover {
  border-color: var(--copper);
  color: var(--copper-bright);
  background: transparent;
  box-shadow: none;
}

.button.icon-link {
  padding: 0.6rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--silk-dim);
}

.button.icon-link:hover {
  border-color: var(--copper);
  color: var(--copper-bright);
  background: transparent;
  box-shadow: 0 0 0 3px rgba(var(--glow-rgb), 0.15);
}

/* ---------------------------------- section headers ---------------------------------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.75rem;
}

h1, h2, h3 {
  color: var(--silk);
}

h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.01em;
  margin: 0;
}

.section-tag {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--silk-dim);
  letter-spacing: 0.08em;
}

/* ---------------------------------- project / education panels ---------------------------------- */

.projects,
.education {
  overflow: hidden;
  isolation: isolate;
}

.projects {
  background: var(--bg-panel);
  border-top: 1px solid var(--line);
  position: relative;
}

.education {
  background: var(--bg-panel-2);
  border-top: 1px solid var(--line);
}

/* projects: scanlines + scattered pixel noise, no color */
.projects::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
  repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.035) 0px,
                            rgba(255, 255, 255, 0.035) 1px,
                            transparent 1px,
                            transparent 4px
  ),
  radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.2px);
  background-size: 100% 100%, 26px 26px;
}

/* education: diagonal cross-hatch traces, no color */
.education::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
  linear-gradient(135deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
  linear-gradient(45deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
}

.projects .content,
.education .content {
  position: relative;
  z-index: 1;
}

.project-grid {
  display: grid;
  gap: 1.1rem;
}

.project-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.project-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 40%), var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 1.4rem 1.25rem 1.1rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.projects .project-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 40%), var(--bg-panel);
}

/* pin rows, like a DIP package */
.project-card::before,
.project-card::after {
  content: "";
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  height: 1px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--line) 0,
                                              var(--line) 4px,
                                              transparent 4px,
                                              transparent 12px
  );
}

.project-card::before {
  top: 0;
}

.project-card::after {
  bottom: 0;
}

.ref-tag {
  position: absolute;
  top: -0.6rem;
  left: 1.1rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--copper-bright);
  background: inherit;
  padding: 0 0.4rem;
}

.ref-tag::after {
  content: "_";
  margin-left: 0.15rem;
  animation: blink-cursor 1.1s steps(1) infinite;
}

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

.project-card h3 {
  font-size: 1.05rem;
  margin: 0.35rem 0 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
}

.project-card p {
  margin: 0;
  color: var(--silk-dim);
  font-size: 0.94rem;
  line-height: 1.5;
}

.project-link-card {
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.project-card-link:hover .project-link-card,
.project-card-link:focus-visible .project-link-card {
  transform: translateY(-4px);
  border-color: var(--copper);
  box-shadow: 0 10px 26px rgba(var(--glow-rgb), 0.18);
}

.project-card-link:hover .project-link-card .ref-tag,
.project-card-link:focus-visible .project-link-card .ref-tag {
  color: var(--gold);
}

/* ---------------------------------- datasheet-style spec list ---------------------------------- */

.content ul {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0;
}

.content ul li {
  margin-bottom: 0.4rem;
}

.spec-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  column-gap: 1.5rem;
  row-gap: 0.5rem;
  margin: 1rem 0;
  text-align: left;
}

.spec-list dt {
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--copper-bright);
}

.spec-list dd {
  margin: 0;
  color: var(--silk-dim);
}

/* ---------------------------------- blog / post ---------------------------------- */

.post {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 1rem;
}

/* ---------------------------------- footer ---------------------------------- */

.site-footer {
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--bg-panel);
  border-top: 1px solid var(--line);
}

.site-footer .board-id {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--silk-dim);
  text-transform: uppercase;
}

.site-footer p {
  margin: 0.25rem 0;
  color: var(--silk-dim);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--copper);
  margin: 0 0.5rem;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--copper-bright);
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-link svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

/* ---------------------------------- 404 ---------------------------------- */

.not-found {
  background: var(--bg);
  text-align: center;
}

.not-found .content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.error-code {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  margin: 0;
  color: var(--copper);
  letter-spacing: 0.05em;
}

.not-found .actions {
  justify-content: center;
}

/* ---------------------------------- motion & accessibility ---------------------------------- */

:focus-visible {
  outline: 2px solid var(--copper-bright);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-schematic path.trace,
  .hero-schematic circle.pad {
    animation: none;
    stroke-dashoffset: 0;
    opacity: 1;
  }
  .ref-tag::after {
    animation: none;
  }
  .project-link-card,
  .button,
  .nav-button {
    transition: none;
  }
}

@media (max-width: 640px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
  .spec-list {
    grid-template-columns: 1fr;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}
