:root {
  color-scheme: light;
  --background: #ffffff;
  --text: #181818;
  --muted: #676767;
  --soft: #f5f5f2;
  --line: #deded9;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--text); color: var(--background); }

a { color: inherit; }

.site-shell {
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 4vw, 2.45rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 22px;
}

.site-nav a,
.footer-links a,
.inline-link {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.active,
.footer-links a:hover,
.footer-links a:focus-visible,
.inline-link:hover,
.inline-link:focus-visible {
  color: var(--text);
  text-decoration-color: currentColor;
}

.site-nav a.active { font-weight: 700; }

main { min-height: 68vh; }

.hero {
  max-width: 760px;
  padding: 74px 0 62px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  margin-bottom: 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 8vw, 5.25rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

h2 {
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

h3 {
  margin-bottom: 4px;
  font-size: 1.08rem;
  line-height: 1.35;
}

.hero-copy {
  max-width: 690px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
}

.home-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 66px;
}

.home-link-card {
  min-height: 170px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

.home-link-card:hover,
.home-link-card:focus-visible {
  border-color: var(--text);
  transform: translateY(-2px);
}

.home-link-card span {
  display: block;
  margin-top: 30px;
  color: var(--muted);
}

.page-heading {
  max-width: 720px;
  padding: 68px 0 42px;
}

.page-heading p {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.experience-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.experience-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 34px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.logo-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 90px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.logo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-fallback {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.experience-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

.experience-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.experience-body > p {
  margin-bottom: 11px;
  color: var(--muted);
}

.experience-body ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.experience-body li + li { margin-top: 5px; }

.subsection-title {
  margin: 56px 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 22px;
}

.project-card { min-width: 0; }

.project-image {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 3;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

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

.project-card p {
  margin-bottom: 8px;
  color: var(--muted);
}

.project-stack {
  font-size: 0.88rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 72px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer p { margin-bottom: 0; white-space: nowrap; }

@media (max-width: 760px) {
  body { font-size: 16px; }

  .site-shell {
    width: min(calc(100% - 34px), var(--max-width));
    padding-top: 22px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .site-nav { justify-content: flex-start; }

  .hero { padding: 54px 0 44px; }

  .home-links,
  .projects-grid { grid-template-columns: 1fr; }

  .home-link-card { min-height: 135px; }

  .page-heading { padding: 50px 0 32px; }

  .experience-item {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 26px 0;
  }

  .logo-frame {
    width: 138px;
    height: 80px;
  }

  .experience-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .experience-meta p { white-space: normal; }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
}

/* Project Cards */
.project-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--background);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-4px);
  border-color: #b8b8b1;
  box-shadow: 0 12px 28px rgba(24, 24, 24, 0.08);
}

.project-card .project-image {
  margin-bottom: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.project-card .project-image img {
  transition: transform 220ms ease;
}

.project-card:hover .project-image img,
.project-card:focus-within .project-image img {
  transform: scale(1.025);
}

.project-card-content {
  padding: 20px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
}

.project-links a {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
  transition: text-decoration-color 150ms ease;
}

.project-links a:hover,
.project-links a:focus-visible {
  text-decoration-color: currentColor;
}

@media (prefers-reduced-motion: reduce) {
  .project-card,
  .project-card .project-image img {
    transition: none;
  }
}

/* Home Hero And Embedded Animation */
:root {
  --max-width: 1180px;
}

.hero {
  max-width: none;
  padding: 78px 0 62px;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(520px, 1.05fr);
  align-items: center;
  gap: clamp(56px, 7vw, 120px);
  width: 100%;
}

.hero-copy {
  min-width: 0;
  max-width: 550px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.1vw, 1.28rem);
}

.hero-copy h1 {
  color: var(--text);
  font-size: clamp(3.4rem, 6vw, 5.15rem);
  white-space: nowrap;
}

.hero-description {
  max-width: 560px;
}

.embedded-animation {
  width: 100%;
  max-width: 700px;
  justify-self: center;
}

.embedded-animation svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.fpga-board,
.fpga-top-strip,
.port,
.mini-port,
.board-module,
.chip,
.chip-small,
.chip-tiny,
.lcd-shell,
.switch-slot rect:first-child,
.pb-ring {
  fill: #ffffff;
  stroke: #181818;
  stroke-width: 2;
}

.fpga-top-strip {
  fill: #f7f7f4;
  stroke: none;
}

.board-hole,
.port-dark {
  fill: #181818;
}

.mini-port,
.board-module,
.chip,
.chip-small,
.chip-tiny,
.digit-bg,
.lcd-shell {
  fill: #f3f3f0;
}

.digit-bg {
  stroke: #c9c9c3;
  stroke-width: 1.5;
}

.sevenseg .seg {
  fill: #deded8;
}

.sevenseg-left {
  animation: seg-left-cycle 8s infinite steps(1);
}

.sevenseg-right {
  animation: seg-right-cycle 8s infinite steps(1);
}

@keyframes seg-left-cycle {
  0%, 24%, 100% { opacity: 1; }
  25%, 49% { opacity: 0.75; }
  50%, 74% { opacity: 0.35; }
  75%, 99% { opacity: 0.85; }
}

@keyframes seg-right-cycle {
  0%, 24%, 100% { opacity: 0.55; }
  25%, 49% { opacity: 1; }
  50%, 74% { opacity: 0.75; }
  75%, 99% { opacity: 0.4; }
}

.chip-pins,
.trace {
  fill: none;
  stroke: #7f7f79;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lcd-screen {
  fill: #f4fbf5;
  stroke: #9cb8a3;
  stroke-width: 1.8;
}

.lcd-frame {
  opacity: 0;
}

.lcd-frame .px {
  fill: #2b6f4c;
}

.lcd-frame-1 { animation: lcd-frame-one 8s infinite steps(1); }
.lcd-frame-2 { animation: lcd-frame-two 8s infinite steps(1); }
.lcd-frame-3 { animation: lcd-frame-three 8s infinite steps(1); }
.lcd-frame-4 { animation: lcd-frame-four 8s infinite steps(1); }

@keyframes lcd-frame-one {
  0%, 22%, 100% { opacity: 1; }
  23%, 99% { opacity: 0; }
}

@keyframes lcd-frame-two {
  0%, 24% { opacity: 0; }
  25%, 47% { opacity: 1; }
  48%, 100% { opacity: 0; }
}

@keyframes lcd-frame-three {
  0%, 49% { opacity: 0; }
  50%, 72% { opacity: 1; }
  73%, 100% { opacity: 0; }
}

@keyframes lcd-frame-four {
  0%, 74% { opacity: 0; }
  75%, 97% { opacity: 1; }
  98%, 100% { opacity: 0; }
}

.status-led {
  fill: #ffffff;
  stroke: #181818;
  stroke-width: 1.8;
}

.status-led-1 { animation: status-led-red 8s infinite; }
.status-led-2 { animation: status-led-amber 8s infinite; }
.status-led-3 { animation: status-led-green 8s infinite; }

@keyframes status-led-red {
  0%, 17%, 100% { fill: #ffffff; filter: none; }
  19%, 31% { fill: #d76b6b; filter: drop-shadow(0 0 6px rgba(215, 107, 107, 0.55)); }
}

@keyframes status-led-amber {
  0%, 35%, 100% { fill: #ffffff; filter: none; }
  37%, 49% { fill: #d8a246; filter: drop-shadow(0 0 6px rgba(216, 162, 70, 0.55)); }
}

@keyframes status-led-green {
  0%, 55%, 100% { fill: #ffffff; filter: none; }
  57%, 69% { fill: #6eac79; filter: drop-shadow(0 0 6px rgba(110, 172, 121, 0.55)); }
}

.signal {
  fill: #181818;
}

.switch-slot rect:first-child {
  fill: #f5f5f2;
  stroke-width: 1.7;
}

.switch-knob {
  fill: #181818;
  transform-box: fill-box;
  transform-origin: center;
}

.toggle-a { animation: toggle-a 8s infinite ease-in-out; }
.toggle-b { animation: toggle-b 8s infinite ease-in-out; }
.toggle-c { animation: toggle-c 8s infinite ease-in-out; }

@keyframes toggle-a {
  0%, 20%, 100% { transform: translateY(0); }
  24%, 44% { transform: translateY(16px); }
  48%, 100% { transform: translateY(0); }
}

@keyframes toggle-b {
  0%, 34%, 100% { transform: translateY(0); }
  38%, 58% { transform: translateY(-16px); }
  62%, 100% { transform: translateY(0); }
}

@keyframes toggle-c {
  0%, 54%, 100% { transform: translateY(0); }
  58%, 78% { transform: translateY(-16px); }
  82%, 100% { transform: translateY(0); }
}

.pb-cap {
  fill: #181818;
  transform-box: fill-box;
  transform-origin: center;
}

.pb-press {
  animation: pb-press 8s infinite ease-in-out;
}

@keyframes pb-press {
  0%, 72%, 100% { transform: translateY(0); opacity: 1; }
  76%, 84% { transform: translateY(3px) scale(0.96); opacity: 0.85; }
  88%, 100% { transform: translateY(0); opacity: 1; }
}

@media (max-width: 980px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .embedded-animation {
    width: min(100%, 720px);
    justify-self: center;
  }
}

@media (max-width: 680px) {
  .hero-copy h1 {
    white-space: normal;
  }

  .embedded-animation {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .signal {
    display: none;
  }

  .status-led,
  .sevenseg,
  .lcd-frame,
  .toggle-a,
  .toggle-b,
  .toggle-c,
  .pb-press {
    animation: none !important;
  }

  .lcd-frame-1 {
    opacity: 1;
  }

  .lcd-frame-2,
  .lcd-frame-3,
  .lcd-frame-4 {
    opacity: 0;
  }
}
