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

:root {
  --paper: #fdfcf9;
  --ink: #17362e;
  --muted: #66736d;
  --line: rgba(23, 54, 46, 0.18);
  --accent: #e55b32;
  --sage: #dfe4dc;
  --sand: #ebe5d7;
  --blue: #dce7e8;
  --gold: #e9dfbd;
  --sans: "Manrope", Arial, sans-serif;
  --mono: "DM Mono", monospace;
  --section-label: 108px;
  --section-content: minmax(0, 1fr);
  --section-gap: 32px;
  --section-top: 32px;
  --section-bottom: 36px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.site-header,
main,
footer {
  width: min(100% - 48px, 1180px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.wordmark-mark {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  object-fit: contain;
  transform: scale(1.2);
}

nav {
  display: flex;
  gap: 30px;
}

nav a {
  padding: 8px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
}

nav a:hover,
nav a[aria-current="page"] { color: var(--accent); }

.page-section {
  padding: var(--section-top) 0 var(--section-bottom);
  border-bottom: 1px solid var(--line);
}

.section-layout {
  display: grid;
  grid-template-columns: var(--section-label) var(--section-content);
  gap: var(--section-gap);
  align-items: start;
}

.section-title {
  margin: 0;
  padding-top: 2px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-align: right;
  text-transform: uppercase;
}

.section-content {
  min-width: 0;
}

.update-post time,
.project-date,
.visual-label,
.project-status {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  line-height: 1.5;
  text-transform: uppercase;
}

.update-post time {
  display: block;
  margin: 3px 0 16px;
  color: var(--muted);
}

.update-post h2 {
  margin-bottom: 0;
  font-size: clamp(27px, 3.4vw, 42px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.markdown-body {
  width: 66.6667%;
}

.markdown-body p,
.markdown-body ol {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.markdown-body ol {
  margin-top: 7px;
  padding-left: 22px;
}

.markdown-body li { padding-left: 3px; }
.markdown-body li + li { margin-top: 3px; }
.markdown-body ol + p,
.markdown-body p + p { margin-top: 12px; }

.update-image {
  width: 66.6667%;
  margin: 32px 0 0;
}

.update-image img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  object-fit: cover;
}

.update-image figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.update-image figcaption a { text-underline-offset: 2px; }

.feature-card {
  display: grid;
  grid-template-columns: 2fr 1fr;
  min-height: 310px;
  margin-top: 36px;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.project-visual {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  color: var(--ink);
}

.project-visual::before {
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(23, 54, 46, 0.16);
  content: "";
}

.sheet-visual { background: var(--blue); }

.music-diagram {
  position: absolute;
  inset: 5% 6% 12%;
  width: 88%;
  height: 83%;
}

.visual-label {
  position: absolute;
  bottom: 9%;
  left: 10%;
}

.project-copy {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 3.5vw, 46px);
}

.project-status {
  margin-bottom: 28px;
  color: #b9c4bf;
}

.project-copy h2,
.project-copy h3 {
  margin-bottom: 14px;
  font-size: clamp(25px, 2.8vw, 37px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.06;
}

.project-copy h3 { font-size: clamp(23px, 2.4vw, 30px); }

.project-copy p {
  margin-bottom: 0;
  color: #cbd2ce;
  font-size: 14px;
  line-height: 1.65;
}

.visit-link {
  display: flex;
  justify-content: flex-end;
  gap: 11px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid rgba(250, 248, 242, 0.3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.visit-link b {
  font-size: 17px;
  font-weight: 400;
  transition: transform 180ms ease;
}

a:hover .visit-link b { transform: translate(3px, -3px); }

.archive-link {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
  margin-top: 30px;
  padding: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
}

.archive-link span {
  font-size: 17px;
  transition: transform 180ms ease;
}

.archive-link:hover span { transform: translate(3px, -3px); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 16px;
}

.project-date {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

#projects .section-title { padding-top: 22px; }

.project-card {
  display: grid;
  grid-template-rows: 54% 46%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  text-decoration: none;
}

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

.project-card .project-copy {
  position: relative;
  min-height: 0;
  justify-content: flex-start;
  padding: 17px 18px 18px;
}

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

.project-card .project-copy h3 {
  margin-bottom: 7px;
  font-size: clamp(17px, 1.7vw, 21px);
  letter-spacing: -0.035em;
}

.project-card .project-copy p:not(.project-status) {
  max-width: 29ch;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.project-link {
  position: absolute;
  right: 17px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project-link b {
  display: inline-block;
  right: 17px;
  font-size: 18px;
  font-weight: 400;
  transition: transform 180ms ease;
}

a.project-card:hover .project-link b { transform: translate(3px, -3px); }

.project-card.is-inactive {
  opacity: 0.58;
}

.tuner-visual { background: var(--sage); }

.tuner-note {
  position: absolute;
  top: 18%;
  left: 14%;
  font-size: 50px;
  font-weight: 500;
  letter-spacing: -0.06em;
}

.tuner-reading {
  position: absolute;
  top: 28%;
  right: 13%;
  font-family: var(--mono);
  font-size: 15px;
}

.tuner-reading span { color: var(--muted); font-size: 9px; }

.tuner-scale {
  position: absolute;
  top: 57%;
  right: 13%;
  left: 13%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.tuner-scale i {
  width: 1px;
  height: 18px;
  background: rgba(23, 54, 46, 0.5);
}

.tuner-scale i:nth-child(odd) { height: 10px; }

.tuner-needle {
  position: absolute;
  top: 46%;
  left: 50%;
  width: 2px;
  height: 44px;
  background: var(--accent);
  transform: rotate(4deg);
  transform-origin: bottom;
}

.flashcard-visual { background: var(--sand); }

.flashcard {
  position: absolute;
  width: 48%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(23, 54, 46, 0.3);
  background: var(--paper);
}

.flashcard-back { top: 24%; left: 23%; transform: rotate(-7deg); }

.flashcard-front {
  top: 20%;
  left: 27%;
  display: grid;
  place-items: center;
  padding: 12px;
  transform: rotate(4deg);
  text-align: center;
}

.flashcard-front span {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 1;
}

.flashcard-front small {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.03em;
}

.metronome-visual { background: var(--gold); }

.tempo-display {
  position: absolute;
  top: 20%;
  left: 50%;
  display: flex;
  align-items: baseline;
  gap: 8px;
  transform: translateX(-50%);
}

.tempo-display strong {
  font-size: 58px;
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 1;
}

.tempo-display span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.beat-row {
  position: absolute;
  top: 61%;
  right: 18%;
  left: 18%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.beat-row::before {
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: rgba(23, 54, 46, 0.35);
  content: "";
}

.beat-row i {
  z-index: 1;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(23, 54, 46, 0.45);
  border-radius: 50%;
  background: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
}

.beat-row i:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
}

.updates-archive { min-height: calc(100vh - 208px); }

.update-list .update-post {
  padding: 0 0 46px;
  border-bottom: 1px solid var(--line);
}

.update-list .update-post + .update-post { padding-top: 46px; }

.update-list .update-post:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 48px;
  min-height: 126px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

footer p { margin: 0; }

.footer-mark {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: -0.01em;
  text-transform: none;
}

.footer-mark .wordmark-mark {
  width: 30px;
  height: 30px;
}

@media (max-width: 900px) {
  :root {
    --section-label: 108px;
    --section-content: minmax(0, 1fr);
    --section-gap: 26px;
  }

  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .markdown-body,
  .update-image { width: 100%; }
  .feature-card { grid-template-columns: 1fr; }
  .feature-card .project-visual { min-height: 260px; }
}

@media (max-width: 680px) {
  :root {
    --section-top: 32px;
    --section-bottom: 36px;
  }

  .site-header,
  main,
  footer { width: min(100% - 32px, 1180px); }

  .site-header { min-height: 74px; }
  .wordmark { gap: 9px; font-size: 24px; }

  .wordmark-mark {
    width: 34px;
    height: 34px;
    font-size: 19px;
  }

  nav { gap: 14px; }
  nav a { font-size: 9px; }

  .section-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .section-title {
    font-size: 18px;
    text-align: left;
  }

  #projects .section-title { padding-top: 0; }

  .update-post h2 { font-size: 31px; }
  .markdown-body p,
  .markdown-body ol { font-size: 15px; }
  .feature-card { margin-top: 30px; }
  .feature-card .project-visual { min-height: 230px; }
  .feature-card .project-copy { min-height: 265px; }

  .project-grid { gap: 24px 12px; }
  .project-card .project-copy { padding: 13px 14px 14px; }
  .project-card .project-copy h3 { font-size: clamp(14px, 4.1vw, 18px); }
  .project-card .project-copy p:not(.project-status) { display: none; }
  .project-card .project-status { font-size: 7px; }
  .project-link { right: 12px; bottom: 8px; gap: 5px; font-size: 6px; }
  .project-link b { font-size: 14px; }

  footer {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 36px 0;
  }
}

@media (max-width: 390px) {
  .wordmark { font-size: 21px; }
  nav { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after { transition-duration: 0.01ms !important; }
}
