:root {
  color-scheme: light;
  --ink: #27231d;
  --body: #4d463c;
  --muted: #83796b;
  --paper: #fffaf0;
  --paper-soft: #fbf2df;
  --paper-edge: #e6d8bd;
  --desk: #efe4d0;
  --accent: #8d5d33;
  --accent-strong: #5f3d20;
  --shadow: 0 26px 70px rgba(79, 56, 30, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(135deg, rgba(141, 93, 51, 0.08), transparent 34%),
    var(--desk);
  color: var(--body);
  font-family: "Gowun Dodum", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(95, 61, 32, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 61, 32, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

a {
  color: inherit;
}

.site-header,
.site-footer,
main {
  width: min(1060px, calc(100% - 36px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 22px 0 14px;
}

.github-brand,
.site-footer {
  font-size: 14px;
  font-weight: 700;
}

.github-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  text-shadow: 0 5px 14px rgba(79, 56, 30, 0.14);
  transition: color 160ms ease, text-shadow 160ms ease;
}

.github-brand svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  filter: drop-shadow(0 5px 12px rgba(79, 56, 30, 0.16));
  transition: filter 160ms ease;
}

.site-footer a,
.text-link {
  text-decoration: none;
}

.github-brand:hover,
.github-brand:focus-visible,
.site-footer a:hover,
.text-link:hover {
  color: var(--accent-strong);
}

.github-brand:hover,
.github-brand:focus-visible {
  text-shadow:
    0 8px 18px rgba(79, 56, 30, 0.2),
    0 0 12px rgba(141, 93, 51, 0.16);
}

.github-brand:hover svg,
.github-brand:focus-visible svg {
  filter:
    drop-shadow(0 8px 16px rgba(79, 56, 30, 0.24))
    drop-shadow(0 0 10px rgba(141, 93, 51, 0.16));
}

.journal-hero {
  padding: 64px 0 34px;
}

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

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: "Gowun Batang", Georgia, serif;
  letter-spacing: 0;
}

.journal-hero h1 {
  font-size: clamp(48px, 8vw, 92px);
  line-height: 1;
}

.intro {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--body);
  font-size: 18px;
  line-height: 1.8;
}

.paper-panel {
  position: relative;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(141, 93, 51, 0.08) 1px, transparent 1px) 42px 0 / 1px 100% no-repeat,
    linear-gradient(rgba(95, 61, 32, 0.055) 1px, transparent 1px) 0 74px / 100% 32px,
    var(--paper);
  box-shadow: var(--shadow);
}

.paper-panel::after {
  position: absolute;
  inset: 10px;
  z-index: 0;
  border: 1px solid rgba(95, 61, 32, 0.05);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
  content: "";
}

.paper-panel > * {
  position: relative;
  z-index: 1;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: 30px;
}

.post-count {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.post-list {
  display: grid;
  border-top: 1px solid rgba(95, 61, 32, 0.14);
}

.post-row {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(95, 61, 32, 0.14);
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.post-row:hover,
.post-row:focus-visible {
  color: var(--accent-strong);
  transform: translateX(4px);
}

.post-row time {
  color: var(--accent);
  font-family: "Gowun Batang", serif;
  font-weight: 700;
}

.post-row-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.post-row-title {
  color: var(--ink);
  font-family: "Gowun Batang", serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.28;
}

.post-row-summary {
  color: var(--body);
  font-size: 15px;
  line-height: 1.7;
}

.post-row-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.empty-state {
  margin: 28px 0 0;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 28px 0 38px;
  color: var(--muted);
}

.article-page main {
  padding-top: 42px;
}

.article {
  max-width: 860px;
}

.article-header {
  margin-bottom: 34px;
}

.article-header h1 {
  max-width: 760px;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.16;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.article-content {
  color: var(--body);
  font-size: 18px;
  line-height: 1.95;
}

.article-content h2 {
  margin: 36px 0 10px;
  font-size: 30px;
}

.article-content p {
  margin: 0 0 18px;
}

.article-content ul {
  margin: 0 0 20px;
  padding-left: 22px;
}

.article-content li + li {
  margin-top: 8px;
}

.article-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(141, 93, 51, 0.11);
  color: var(--accent-strong);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.9em;
}

.article-figure {
  margin: 30px 0;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(95, 61, 32, 0.16);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 18px 42px rgba(79, 56, 30, 0.12);
}

.article-figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.note-box {
  margin: 26px 0;
  padding: 20px;
  border: 1px solid rgba(95, 61, 32, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.58);
}

.note-box h2 {
  margin-top: 0;
}

.intro-brief {
  display: grid;
  gap: 16px;
  margin: 30px 0 34px;
  padding: 22px;
  border: 1px solid rgba(95, 61, 32, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(141, 93, 51, 0.09), transparent 46%),
    rgba(255, 250, 240, 0.64);
}

.intro-brief h2 {
  margin: 0;
}

.intro-brief p {
  margin-bottom: 0;
}

.video-reference {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 9px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(95, 61, 32, 0.18);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.74);
  color: #b33a2f;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.video-reference svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.video-reference:hover,
.video-reference:focus-visible {
  background: var(--paper);
  box-shadow: 0 10px 22px rgba(79, 56, 30, 0.14);
  transform: translateY(-1px);
}

.timeline {
  display: grid;
  gap: 0;
  margin-top: 30px;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 22px;
  padding: 28px 0;
  border-top: 1px solid rgba(95, 61, 32, 0.14);
}

.timeline-entry > time {
  position: sticky;
  top: 18px;
  align-self: start;
  color: var(--accent-strong);
  font-family: "Gowun Batang", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.timeline-entry h2 {
  margin: 0 0 12px;
}

.submission-card {
  display: grid;
  gap: 7px;
  margin: 18px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(141, 93, 51, 0.08);
}

.submission-card strong {
  color: var(--accent-strong);
  font-family: "Gowun Batang", Georgia, serif;
  font-size: 20px;
}

.submission-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.submission-card p {
  margin-bottom: 0;
}

.submission-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.submission-action {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(95, 61, 32, 0.16);
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.78);
  color: var(--accent-strong);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.submission-action svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.submission-card a.submission-action svg {
  display: none;
}

.submission-card a.submission-action::before {
  content: "</>";
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.submission-action:hover,
.submission-action:focus-visible {
  background: var(--paper);
  box-shadow: 0 10px 22px rgba(79, 56, 30, 0.14);
  color: var(--accent);
  transform: translateY(-1px);
}

.youtube-action {
  color: #c53b2f;
}

.video-dialog {
  width: min(860px, calc(100% - 34px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
}

.video-dialog::backdrop {
  background: rgba(39, 35, 29, 0.46);
  backdrop-filter: blur(3px);
}

.video-dialog-panel {
  overflow: hidden;
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.video-dialog-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(95, 61, 32, 0.14);
}

.video-dialog-panel h2 {
  font-size: 22px;
}

.video-dialog-close {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(95, 61, 32, 0.16);
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.72);
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  line-height: 1;
}

.video-frame {
  display: grid;
  min-height: 240px;
  place-items: center;
  background: #1c1712;
  color: var(--paper);
}

.video-frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.video-frame p {
  margin: 0;
  padding: 32px;
  color: var(--paper);
  text-align: center;
}

.article-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(95, 61, 32, 0.14);
}

.text-link {
  color: var(--accent);
  font-weight: 700;
}

.error-page {
  display: grid;
  min-height: 100vh;
  align-items: center;
}

@media (max-width: 720px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    align-items: flex-end;
  }

  .journal-hero {
    padding-top: 42px;
  }

  .section-head,
  .article-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .timeline-entry {
    grid-template-columns: 1fr;
  }

  .timeline-entry > time {
    position: static;
  }
}
