:root {
  color-scheme: dark;
  --bg: #111a22;
  --bg-soft: #17232d;
  --panel: rgba(31, 44, 56, 0.76);
  --panel-strong: rgba(38, 53, 66, 0.9);
  --text: #f3f6f8;
  --muted: #a9b6c1;
  --soft: #d2d9df;
  --line: rgba(165, 184, 199, 0.24);
  --accent: #ff930f;
  --accent-soft: rgba(255, 147, 15, 0.18);
  --tech-accent: #20d6bd;
  --tech-accent-soft: rgba(32, 214, 189, 0.17);
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.26);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f4;
  --bg-soft: #e2e8ec;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --text: #17212a;
  --muted: #5c6973;
  --soft: #303b45;
  --line: rgba(64, 84, 101, 0.22);
  --accent-soft: rgba(255, 147, 15, 0.2);
  --tech-accent: #009f94;
  --tech-accent-soft: rgba(0, 159, 148, 0.16);
  --shadow: 0 18px 42px rgba(36, 52, 65, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 50% 16%, rgba(55, 75, 92, 0.34), transparent 32rem),
    linear-gradient(115deg, var(--bg) 0%, var(--bg-soft) 54%, var(--bg) 100%);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent 72%);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 40px, 1440px);
  margin: 0 auto;
  padding: 18px 0 14px;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-mark {
  color: var(--accent);
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
  font-weight: 850;
  line-height: 1;
}

.brand strong,
.brand small {
  display: block;
  overflow-wrap: anywhere;
}

.brand strong {
  font-size: 1rem;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 4vw, 48px);
}

.main-nav a {
  position: relative;
  color: var(--soft);
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--accent);
}

.theme-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--text);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  cursor: pointer;
}

.theme-toggle svg,
.project-icon svg,
.text-link svg,
.primary-link svg,
.back-link svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main {
  width: min(100% - 40px, 1440px);
  margin: 0 auto;
}

.intro {
  display: block;
  padding: 22px 0 10px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 2.45rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.detail-copy h1,
.not-found h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.2rem, 4.4vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.62;
}

.timeline-section {
  position: relative;
  padding: 14px 0 78px;
  --center-gap: clamp(112px, 13vw, 190px);
  --connector-width: calc(var(--center-gap) / 2);
}

.timeline-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, transparent, var(--line) 8%, var(--line) 92%, transparent);
  box-shadow: 0 0 18px rgba(153, 180, 200, 0.18);
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  --item-accent: var(--accent);
  --item-accent-soft: var(--accent-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--center-gap) minmax(0, 1fr);
  align-items: center;
  min-height: 174px;
}

.timeline-item + .timeline-item {
  margin-top: clamp(-58px, -4.4vw, -34px);
}

.timeline-item--electronics {
  --item-accent: var(--tech-accent);
  --item-accent-soft: var(--tech-accent-soft);
}

.timeline-item--notice {
  --item-accent: var(--accent);
  --item-accent-soft: var(--accent-soft);
}

.timeline-item--left .project-card {
  grid-column: 1;
  justify-self: end;
}

.timeline-item--right .project-card {
  grid-column: 3;
  justify-self: start;
}

.project-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: min(100%, 560px);
  padding: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--panel), rgba(25, 37, 48, 0.58));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transform: translateY(0);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

:root[data-theme="light"] .project-card {
  background: linear-gradient(145deg, var(--panel), rgba(232, 239, 243, 0.72));
}

.project-card:hover {
  border-color: color-mix(in srgb, var(--item-accent) 58%, transparent);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28), 0 0 0 5px var(--item-accent-soft);
  transform: translateY(-5px);
}

.project-card:active {
  transform: translateY(-1px) scale(0.99);
}

.notice-card {
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 186px;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

.notice-mark {
  display: grid;
  width: 100%;
  min-height: 100%;
  place-items: center;
  color: var(--accent);
  font-size: 3rem;
  font-weight: 900;
  background:
    linear-gradient(135deg, rgba(255, 147, 15, 0.18), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

.project-image {
  min-width: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.04);
}

.project-image img {
  padding: 10px;
}

.project-image img,
.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 2px 4px 8px;
}

.project-type {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.project-type--electronics {
  color: var(--tech-accent);
}

.project-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
}

.project-type--electronics .project-icon {
  color: var(--tech-accent);
  background: var(--tech-accent-soft);
}

.project-card h2 {
  margin: 0 0 5px;
  font-size: 1.14rem;
  line-height: 1.18;
}

.project-subtitle {
  margin: 0 0 10px;
  color: var(--item-accent, var(--accent));
  font-weight: 700;
}

.project-card p:not(.project-subtitle) {
  margin: 0;
  color: var(--soft);
  font-size: 0.9rem;
  line-height: 1.48;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.project-tags span {
  color: var(--muted);
  font-size: 0.74rem;
}

.text-link,
.primary-link,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--item-accent, var(--accent));
  font-weight: 750;
}

.text-link {
  margin-top: 13px;
  font-size: 0.9rem;
}

.text-link svg,
.primary-link svg {
  width: 17px;
  height: 17px;
}

.project-connector {
  position: absolute;
  top: 50%;
  width: var(--connector-width);
  height: 48px;
  color: var(--item-accent);
  pointer-events: none;
  transform: translateY(-50%);
}

.timeline-item--left .project-connector {
  left: calc(50% - var(--connector-width));
}

.timeline-item--right .project-connector {
  left: 50%;
}

.project-connector path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1 11;
}

.timeline-node {
  position: absolute;
  left: 50%;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  transform: translateX(-50%);
  background: var(--item-accent);
  border: 5px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  box-shadow: 0 0 0 8px var(--item-accent-soft), 0 0 22px color-mix(in srgb, var(--item-accent) 55%, transparent);
}

.detail-meta span {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.detail-meta strong {
  display: block;
  overflow-wrap: anywhere;
}

.project-detail {
  padding-bottom: 96px;
}

.back-link {
  margin: 44px 0 24px;
}

.back-link svg {
  transform: rotate(180deg);
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.78fr);
  gap: 42px;
  align-items: stretch;
  padding: 36px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-copy p {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--soft);
  font-size: 1.08rem;
  line-height: 1.7;
}

.detail-actions {
  margin-top: 30px;
}

.primary-link {
  padding: 13px 18px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 147, 15, 0.42);
  border-radius: 8px;
}

.detail-image {
  min-height: 360px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.detail-image img {
  padding: 18px;
}

.detail-meta {
  display: grid;
  grid-template-columns: 0.55fr 0.7fr 1.75fr;
  gap: 18px;
  margin: 24px 0 52px;
}

.detail-meta div {
  min-width: 0;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.markdown-content {
  width: min(100%, 860px);
  margin: 0 auto;
  color: var(--soft);
}

.markdown-content h1,
.markdown-content h2 {
  margin: 42px 0 14px;
  color: var(--text);
  letter-spacing: 0;
}

.markdown-content h2 {
  font-size: 1.65rem;
}

.markdown-content p,
.markdown-content li {
  font-size: 1.02rem;
  line-height: 1.8;
}

.markdown-content ul {
  padding-left: 20px;
}

.markdown-content a {
  color: var(--accent);
}

.markdown-content pre {
  overflow: auto;
  padding: 18px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.not-found {
  min-height: 70vh;
  padding: 120px 0;
}

.not-found p {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .project-card {
    width: min(100%, 520px);
  }
}

@media (max-width: 860px) {
  .site-header {
    width: min(100% - 28px, 1440px);
  }

  .brand small {
    display: none;
  }

  .main-nav {
    gap: 16px;
  }

  main {
    width: min(100% - 28px, 1440px);
  }

  .intro,
  .detail-hero,
  .detail-meta {
    grid-template-columns: 1fr;
  }

  .timeline-rail {
    left: 18px;
  }

  .timeline {
    gap: 18px;
  }

  .timeline-item + .timeline-item {
    margin-top: 0;
  }

  .timeline-item,
  .timeline-item--left,
  .timeline-item--right {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 0;
  }

  .timeline-item--left .project-card,
  .timeline-item--right .project-card {
    grid-column: 2;
    justify-self: stretch;
  }

  .project-card {
    width: 100%;
  }

  .project-connector {
    display: none;
  }

  .timeline-node {
    left: 18px;
  }

  .detail-hero {
    padding: 22px;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    padding-top: 18px;
  }

  .brand {
    gap: 10px;
  }

  .brand strong {
    max-width: 120px;
  }

  .main-nav {
    gap: 10px;
  }

  .main-nav a {
    font-size: 0.9rem;
  }

  .theme-toggle {
    width: 34px;
    height: 34px;
  }

  .intro {
    padding-top: 36px;
  }

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

  .notice-card {
    grid-template-columns: 1fr;
  }

  .notice-mark {
    min-height: 96px;
  }

  .project-copy {
    padding: 8px 4px 6px;
  }

  .detail-image {
    min-height: 240px;
  }
}
