/* Visual tone: devotd.net — paper, hairlines, quiet mono meta. */
:root, [data-theme="light"] {
  color-scheme: light;
  --background: #ffffff;
  --surface: #f6f6f6;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --soft-line: #ececec;
  --line-strong: #c9c9c9;
  --accent: #0f5c52;
  --accent-hover: #0c4a42;
  --content: 980px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
[data-theme="dark"] {
  color-scheme: dark;
  --background: #1b1b1b;
  --surface: #242424;
  --text: #dcdcdc;
  --muted: #9a9a9a;
  --line: #303030;
  --soft-line: #2a2a2a;
  --line-strong: #424242;
  --accent: #6fbfae;
  --accent-hover: #8ad2c2;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --background: #1b1b1b; --surface: #242424; --text: #dcdcdc; --muted: #9a9a9a;
    --line: #303030; --soft-line: #2a2a2a; --line-strong: #424242;
    --accent: #6fbfae; --accent-hover: #8ad2c2;
  }
}
* { box-sizing: border-box; }
html {
  background: var(--background); color: var(--text);
  font: 15px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body { margin: 0; }
button, input, select { font: inherit; }
button, summary, select { cursor: pointer; }
a { color: inherit; text-decoration: none; text-underline-offset: .22em; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
::selection { background: rgba(15,92,82,.18); color: var(--text); }

/* ---------- Shell / header ---------- */
.shell { width: min(100% - 64px, 1140px); margin: 0 auto; }
.wide { max-width: var(--content); margin: 0 auto; }
.top {
  min-height: 60px; display: flex; align-items: center; gap: 30px;
  border-bottom: 1px solid var(--line); position: relative; z-index: 10;
}
.wordmark {
  font: 700 21px/1 var(--mono); letter-spacing: -.02em; white-space: nowrap;
}
.wordmark:hover { color: var(--accent); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.nav a {
  padding: 20px 0 18px; color: var(--muted); white-space: nowrap;
  font: 400 13px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.languages { flex-shrink: 0; position: relative; }
.locale-picker { position: relative; }
.locale-picker summary {
  display: flex; align-items: center; gap: 8px; list-style: none;
  border: 1px solid var(--line); border-radius: 2px; padding: 7px 10px;
  font: 400 13px/1.3 var(--mono); letter-spacing: .02em;
  min-width: 64px; min-height: 34px; justify-content: space-between;
}
.locale-picker summary::-webkit-details-marker { display: none; }
.chevron { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.locale-picker[open] .chevron { transform: rotate(225deg) translate(-2px, -1px); }
.locale-options {
  position: absolute; right: 0; top: calc(100% + 8px); width: 170px;
  border: 1px solid var(--line); border-radius: 2px; background: var(--background);
  padding: 4px; z-index: 20;
}
.locale-options a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 11px; font-size: 13px; color: var(--text); border-radius: 2px;
}
.locale-options a:hover, .locale-options a[aria-current="page"] { background: var(--surface); color: var(--accent); }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 2px;
  background: transparent; color: var(--muted);
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 48px; border-top: 1px solid var(--line); padding: 20px 0 40px;
  color: var(--muted); font: 400 13px/1.6 var(--mono);
  display: flex; justify-content: space-between; gap: 24px; align-items: baseline;
}
.footer p { margin: 0; flex: 1; }
.footer nav { display: flex; gap: 22px; }
.footer a:hover { text-decoration: underline; }

/* ---------- Shared bits ---------- */
.eyebrow {
  color: var(--accent); margin: 0 0 14px;
  font: 600 13px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase;
}
.eyebrow a { color: inherit; }
.feed-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin: 0 0 10px; }
.feed-heading h1 { font-size: 24px; line-height: 1.3; font-weight: 600; margin: 0; word-break: keep-all; }
.section { margin: 44px 0; }
.section > h2 { font-size: 22px; font-weight: 600; margin: 0 0 14px; }
.lead-feed { margin-top: 30px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  border-top: 1px solid var(--text); padding-top: 12px; margin-bottom: 6px;
}
.section-head h2 { font-size: 20px; line-height: 1.4; font-weight: 600; margin: 0; }
.section-head > a { color: var(--muted); font: 400 13px/1.5 var(--mono); }
.section-head > a:hover { color: var(--accent); }
.section-count, .results-count { color: var(--muted); font: 400 13px/1.5 var(--mono); }
.empty { color: var(--muted); font-size: 14px; padding: 20px 0; }
.more-news a { min-height: 44px; display: inline-flex; align-items: center; color: var(--accent); font-size: 14px; }

/* ---------- Feed ---------- */
.feed-controls { display: flex; gap: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 6px 0 0; }
.feed-controls a, .feed-controls button {
  display: inline-flex; align-items: center; min-height: 32px;
  border: 0; border-bottom: 1px solid transparent; margin-bottom: -1px;
  background: transparent; color: var(--muted);
  padding: 8px 0 10px; font: 400 13px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase;
}
.feed-controls a:hover, .feed-controls button:hover { color: var(--text); }
.feed-controls button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.story-list { border-top: 1px solid var(--line); }
.feed-controls + .story-list { border-top: none; }
.story {
  position: relative;
  display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 18px;
  padding: 15px 0 16px; border-bottom: 1px solid var(--line);
}
.story-rail { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding-top: 4px; }
.story-type {
  color: var(--accent);
  font: 600 11px/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase;
}
.story[data-kind="discovery"] .story-type { color: var(--muted); }
.story-rail time { color: var(--muted); font: 400 12px/1.4 var(--mono); }
.story-content { min-width: 0; }
.story-repository, .repo-name, .monospace { font-family: var(--mono); overflow-wrap: anywhere; }
.story-repository { color: var(--muted); font-size: 12px; }
.story h2 { font-size: 17px; line-height: 1.45; font-weight: 600; margin: 0 0 4px; word-break: keep-all; }
.story h2 a { position: static; }
.story h2 a::after { content: ""; position: absolute; inset: 0; }
.story h2 a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.story h2 a:hover { text-decoration: underline; color: var(--text); }
.story-meta a, .story-meta span { position: relative; z-index: 1; }
.story-meta a, .story-repository a, .chip, .tags a, .breadcrumbs a, .footer a, .feed-controls a,
.project-category, .meta a, .article-kicker a, .article-actions a, .category-links a, .featured-projects a,
.repo-list h2 a, .repo-snapshot-top a { min-height: 32px; display: inline-flex; align-items: center; }
.story-description {
  margin: 0 0 6px; color: var(--muted); font-size: 13.5px; line-height: 1.6;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2;
}
.story-meta { display: flex; gap: 3px 16px; flex-wrap: wrap; color: var(--muted); font: 400 12px/1.5 var(--mono); }
.story-meta a { color: var(--accent); }
.field-link { color: var(--accent); }

/* ---------- Secondary sections on home ---------- */
.secondary-section { margin-top: 44px; }
.category-links { display: flex; flex-wrap: wrap; gap: 12px 26px; }
.category-links a { font-size: 14px; color: var(--text); padding: 8px 0; border-bottom: 1px solid var(--line); }
.category-links span { font: inherit; font-size: 12px; color: var(--muted); margin-left: 5px; }
.featured-projects { display: flex; flex-wrap: wrap; gap: 14px 26px; font-size: 14px; }
.featured-projects a { padding-bottom: 7px; border-bottom: 1px solid var(--line); }

/* ---------- Listing / directory pages ---------- */
.page-title { padding: 30px 0 20px; }
.page-title .eyebrow { margin-bottom: 12px; }
.page-title h1 { font-size: 24px; line-height: 1.3; font-weight: 600; margin: 0 0 8px; word-break: keep-all; }
.page-title p { color: var(--muted); font-size: 15px; margin: 0; }
.listing-page > .feed-block { margin-top: 10px; }
.category-list, .repo-list { border-top: 1px solid var(--line); }
.category-list article, .repo-list article {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.category-list h2, .repo-list h2 { margin: 0; font-size: 17px; font-weight: 600; }
.category-list > article > span, .project-category { color: var(--muted); font: 400 13px/1.5 var(--mono); white-space: nowrap; }
.project-category { color: var(--accent); }
.repo-list article { align-items: center; }
.repo-list h2 { margin-bottom: 4px; font-size: 16px; }
.repo-list p { margin: 0 0 5px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.meta { color: var(--muted); font: 400 12px/1.5 var(--mono); display: flex; flex-wrap: wrap; gap: 8px 18px; }
.project-controls { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(150px, 1fr)); gap: 14px; margin: 12px 0 22px; }
.project-controls label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.project-controls label span { font: 400 13px/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.project-controls input, .project-controls select {
  appearance: none; width: 100%; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 2px;
  background: var(--background); color: var(--text); padding: 0 12px; font-size: 14px;
}
.project-controls select { padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.project-controls input::placeholder { color: var(--muted); }
.results-count { min-height: 17px; margin: 0 0 12px; }
.supplementary-description { color: var(--muted); font-size: 13px; line-height: 1.55; }
.supplementary-description span { font-weight: 600; }
.pagination { display: flex; gap: 18px; align-items: center; margin: 22px 0; font: 400 13px/1.5 var(--mono); color: var(--muted); }
.pagination a { color: var(--accent); min-height: 32px; display: inline-flex; align-items: center; }

/* ---------- Article / post ---------- */
.post { max-width: 760px; margin: 0 auto; padding: 30px 0 10px; }
.post h1 { font-size: 34px; line-height: 1.3; font-weight: 600; margin: 9px 0 12px; word-break: keep-all; }
.post .summary { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0 0 15px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font: 400 13px/1.5 var(--mono); margin-bottom: 22px; }
.breadcrumbs a { min-height: 0; }
.breadcrumbs a:hover { color: var(--accent); }
.article-kicker { display: flex; gap: 18px; color: var(--accent); font: 600 13px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.article-kicker a { color: var(--accent); }
.article-deck { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0; word-break: keep-all; }
.article-byline { margin: 14px 0 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; font: 400 13px/1.5 var(--mono); color: var(--muted); }
.article-actions { border-bottom: 1px solid var(--line); padding: 10px 0; display: flex; flex-wrap: wrap; gap: 9px 23px; align-items: center; }
.article-actions a { font-size: 14px; font-weight: 400; }
.source-link { color: var(--accent); font-weight: 600; }
.post-body { font-size: 15px; line-height: 1.8; margin: 26px 0 30px; overflow-wrap: anywhere; word-break: keep-all; }
.post-body p { margin: 0 0 1.3em; }
.repo-snapshot { border-top: 1px solid var(--line); padding: 12px 0 12px; }
.repo-snapshot-top { display: flex; align-items: baseline; gap: 8px 14px; flex-wrap: wrap; }
.repo-snapshot-label { font: 600 12px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.repo-snapshot-top .repo-name { font-size: 13px; color: var(--accent); font-weight: 600; }
.repo-snapshot-description {
  flex-basis: 100%; min-width: 0; color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2;
}
.repo-snapshot-facts { display: flex; gap: 5px 18px; flex-wrap: wrap; margin: 12px 0 0; }
.repo-snapshot-facts div { display: inline-flex; gap: 5px; align-items: baseline; font-size: 12px; }
.repo-snapshot-facts dt { color: var(--muted); font-family: var(--mono); }
.repo-snapshot-facts dd { color: var(--text); font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0; }
.chip {
  color: var(--accent); font-size: 13px; font-weight: 400; padding: 4px 2px;
}
.chip:hover { text-decoration: underline; }
.related-stories { margin-top: 40px; }

/* ---------- Repo detail ---------- */
.project-detail > .eyebrow { margin-top: 10px; }
.project-detail .source-link { font-size: 14px; }
.project-facts { margin: 26px 0 32px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-facts div { padding: 13px 0; border-bottom: 1px solid var(--line); }
.project-facts dt { font: 400 13px/1.5 var(--mono); color: var(--muted); }
.project-facts dd { margin: 4px 0 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.details { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); margin: 30px 0; }
.details div { padding: 15px 0; border-bottom: 1px solid var(--line); }
.details span, .details strong { display: block; }
.details span { color: var(--muted); font-size: 13px; }
.details strong { font-size: 14px; margin-top: 4px; font-weight: 600; }

/* ---------- Legacy card/grid classes (unused by editorial layer) ---------- */
.tagline { color: var(--muted); font-size: 15px; margin: 24px 0 0; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.item, .tracked { padding: 20px 0; border-bottom: 1px solid var(--line); }
.item h2, .tracked h3 { font-size: 20px; line-height: 1.4; font-weight: 600; margin: 7px 0 8px; }
.item p, .tracked p { color: var(--muted); font-size: 14px; }
.badges { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.badge {
  font: 600 13px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 2px; padding: 2px 7px;
}
.badge.new { color: var(--muted); border-color: var(--line-strong); }
.version { font: 12px var(--mono); color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .shell { width: calc(100% - 40px); }
  .top { flex-wrap: wrap; gap: 0 18px; padding: 14px 0 0; }
  .wordmark { font-size: 19px; }
  .languages { margin-left: auto; }
  .nav { order: 3; margin: 6px 0 0; width: 100%; gap: 18px; justify-content: flex-start; flex-wrap: wrap; }
  .nav a { padding: 10px 0 12px; }
  .page-title { padding: 26px 0 14px; }
  .section { margin: 36px 0; }
  .story { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; }
  .project-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .project-controls label:first-child { grid-column: 1 / -1; }
  .post { padding-top: 24px; }
  .post h1 { font-size: 26px; }
}
@media (max-width: 480px) {
  .shell { width: calc(100% - 40px); }
  .nav { justify-content: flex-start; gap: 16px; }
  .nav a { font-size: 12px; }
  .story { display: block; padding: 14px 0; }
  .story-rail { flex-direction: row; gap: 12px; align-items: center; padding: 0; margin-bottom: 6px; }
  .story h2 { font-size: 15.5px; }
  .story-description { font-size: 13px; }
  .feed-controls { gap: 16px; }
  .feed-controls a, .feed-controls button { font-size: 12px; }
  .feed-heading h1 { font-size: 21px; }
  .page-title h1 { font-size: 21px; }
  .category-list article, .repo-list article { gap: 12px; }
  .repo-list article { align-items: flex-start; flex-direction: column; }
  .project-controls { gap: 10px; }
  .project-controls label span { font-size: 12px; }
  .project-controls select { font-size: 13px; padding-left: 10px; }
  .post h1 { font-size: 26px; }
  .project-facts { grid-template-columns: 1fr; }
  .footer { margin-top: 40px; flex-wrap: wrap; gap: 8px 18px; }
  .footer p { flex-basis: 100%; order: 3; }
  .grid { gap: 16px; }
  .repo-snapshot-facts { gap: 6px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* layout width kept as before restyle */
.shell { width: min(100% - 40px, 760px); }
.shell > main, .wide, .post { max-width: none; width: 100%; margin-left: 0; margin-right: 0; }
@media (max-width: 800px) { .shell { width: calc(100% - 40px); } }
html:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
