:root {
  color-scheme: light;
  --ink: #201b1b;
  --muted: #6d6060;
  --red: #c51635;
  --red-dark: #aa1230;
  --paper: #fffaf7;
  --surface: #fff;
  --line: #ece3df;
  --soft-red: #fff0f2;
  --shadow: 0 9px 32px #49221b0a, 0 1px 2px #48201c08;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0, #fff 0%, transparent 46rem), var(--paper);
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
svg { flex-shrink: 0; vertical-align: middle; }

.frame { width: min(100%, 43rem); margin: 0 auto; }
.startup {
  min-height: 100dvh;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  text-align: center;
}
.startup > p { color: var(--muted); font-size: .95rem; }
.startup noscript { max-width: 44rem; margin: 1.5rem auto; }
.fallback-image { width: auto; height: auto; max-height: 36rem; margin: 1rem auto; }
.skip {
  position: fixed;
  z-index: 10;
  top: .5rem;
  left: .5rem;
  padding: .65rem 1rem;
  transform: translateY(-200%);
  border-radius: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
}
.skip:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  padding-top: env(safe-area-inset-top);
  background: #fffdfbeF;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.topbar-inner {
  min-height: 69px;
  padding: 0 clamp(15px, 4vw, 24px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
}
.brand { display: inline-flex; align-items: center; padding-block: 5px; flex-shrink: 1; }
.brand img { width: clamp(128px, 36vw, 155px); height: auto; }
.language { display: flex; align-items: stretch; gap: 1px; }
.language-key {
  min-height: 44px;
  min-width: 34px;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: var(--ink);
  font-size: .77rem;
  font-weight: 740;
  position: relative;
  padding: 0 .36rem;
}
.language-key[aria-pressed="true"] { color: var(--red); }
.language-key[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: auto .39rem .25rem;
  height: 2px;
  border-radius: 1rem;
  background: var(--red);
}
.language-key:hover { background: #f8efeb; }

.main {
  padding: 25px clamp(14px, 4vw, 24px) calc(105px + env(safe-area-inset-bottom));
  min-height: calc(100dvh - 70px);
  outline: none;
}
.page-heading { margin: 0 0 22px; }
.page-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .48rem;
  color: var(--red);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .105em;
  text-transform: uppercase;
}
.kicker-line { width: 13px; height: 1px; background: #d9aeb4; }
.heading-row { display: flex; align-items: end; justify-content: space-between; gap: .45rem; margin-top: .37rem; }
.page-heading h1 {
  font-size: clamp(2.02rem, 10vw, 3.65rem);
  line-height: 1.02;
  font-weight: 850;
  letter-spacing: -.057em;
  overflow-wrap: anywhere;
}
.intro { color: var(--muted); font-size: .95rem; margin-top: .53rem; line-height: 1.4; }
.round-button {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  border-radius: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--red);
}
.round-button:hover:not(:disabled) { background: var(--soft-red); }

.filter-wrap { margin-bottom: 18px; position: relative; }
.filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 4px 3px 8px;
  margin: -4px -3px 0;
  scrollbar-width: thin;
  scrollbar-color: #ecd0d2 transparent;
}
.chip {
  min-height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--surface);
  color: var(--ink);
  font-size: .86rem;
  font-weight: 710;
  padding: 0 .95rem;
}
.chip:hover { border-color: #dfb3b9; }
.chip[aria-pressed="true"] {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  min-width: 64px;
}

.feed-list, .projects-list { display: grid; gap: 15px; }
.card, .notice, .project-row, .settings-card, .discussion {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card { overflow: hidden; }
.media-link {
  position: relative;
  display: block;
  margin: 8px 8px 0;
  background: #f7f0ed;
}
.media-link:focus-visible { outline-offset: -3px; }
.media-link img { width: 100%; height: auto; max-height: min(22rem, 52svh); object-fit: contain; }
.detail .media-link img { max-height: min(38rem, 78svh); }
.media-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: absolute;
  left: 11px;
  bottom: 11px;
  padding: .38rem .6rem;
  background: #fffdfb;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: .7rem;
  color: var(--red-dark);
  font-weight: 780;
  box-shadow: 0 2px 8px #41231a15;
}
.media-badge svg { fill: currentColor; }
.card-content { padding: 15px clamp(14px, 4vw, 20px) 8px; }
.post-meta { display: flex; gap: 9px; align-items: center; margin-bottom: .63rem; }
.project-mark {
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border-radius: 11px;
  color: var(--red-dark);
  background: var(--soft-red);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: -.035em;
}
.project-mark img {
  position: absolute;
  inset: 0;
  padding: 3px;
  background: white;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.post-meta-copy { display: grid; gap: .12rem; color: var(--muted); min-width: 0; }
.post-attribution { display: flex; flex-wrap: wrap; align-items: center; gap: .28rem; font-size: .76rem; line-height: 1.2; }
.project-name { font-weight: 790; color: var(--ink); }
.dot { color: var(--red); }
time { color: var(--muted); font-size: .72rem; }
.post-title { font-size: clamp(1.24rem, 5vw, 1.72rem); line-height: 1.12; font-weight: 825; letter-spacing: -.035em; overflow-wrap: anywhere; }
.post-link:hover { color: var(--red-dark); }
.post-body { margin: .53rem 0 .72rem; line-height: 1.53; color: var(--muted); font-size: .91rem; overflow-wrap: anywhere; }
.post-body:not(.detail-text) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.post-actions {
  display: flex;
  align-items: center;
  gap: .24rem;
  min-height: 50px;
  padding-top: .14rem;
  margin: .33rem -5px 0;
}
.post-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .32rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0 .35rem;
  color: var(--ink);
  border: 0;
  border-radius: 12px;
  background: transparent;
}
.post-action:hover { background: #f8efeb; }
.post-action[aria-pressed="true"] { color: var(--red); }
.post-action[aria-pressed="true"] svg { fill: var(--red); }
.count { color: var(--muted); font-size: .77rem; min-width: .46rem; text-align: center; font-variant-numeric: tabular-nums; }
.view-link {
  display: inline-flex;
  align-items: center;
  justify-content: end;
  gap: .16rem;
  min-height: 44px;
  margin-left: auto;
  padding: 0 .22rem;
  font-size: .76rem;
  color: var(--red-dark);
  font-weight: 760;
  text-align: right;
}
.view-link:hover, .back-link:hover { text-decoration: underline; }

.nav {
  position: fixed;
  z-index: 4;
  bottom: 0;
  left: 0;
  right: 0;
  padding-bottom: env(safe-area-inset-bottom);
  background: #fffdfbf5;
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.nav-inner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 5px 12px 6px; gap: 3px; }
.nav-item {
  min-height: 58px;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 14px;
  color: var(--ink);
  font-size: .73rem;
  font-weight: 680;
}
.nav-item[aria-current] { color: var(--red-dark); background: var(--soft-red); font-weight: 800; }
.nav-item:hover { background: #fff2f0; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  padding: .52rem .9rem;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: .86rem;
  font-weight: 740;
  background: var(--surface);
  text-align: center;
}
.button:hover:not(:disabled) { background: #fff3ef; }
.button.primary { border-color: var(--red); color: #fff; background: var(--red); }
.button.primary:hover:not(:disabled) { background: var(--red-dark); }
.wide-action { width: 100%; margin-top: 16px; }
.notice { text-align: center; padding: 35px clamp(14px, 6vw, 36px); }
.notice h2 { font-size: 1.16rem; font-weight: 790; }
.notice p { margin-top: 6px; color: var(--muted); font-size: .91rem; line-height: 1.45; }
.notice .button { margin-top: 16px; }
.notice-icon {
  display: inline-grid;
  width: 50px;
  height: 50px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 14px;
  background: var(--soft-red);
  color: var(--red);
}
.skeleton { padding-bottom: 15px; }
.skeleton-photo, .skeleton-line { background: #f9eeea; animation: pulse 1.3s ease-in-out infinite alternate; }
.skeleton-photo { height: clamp(145px, 48vw, 270px); margin-bottom: 18px; }
.skeleton-line { width: 70%; height: 16px; border-radius: 10px; margin: 12px 16px; }
.skeleton-line.small { width: 35%; }
@keyframes pulse { to { opacity: .48; } }

.project-row { display: flex; gap: 12px; align-items: center; padding: 12px; }
.project-row .project-mark { width: 44px; height: 44px; flex-basis: 44px; font-size: .8rem; }
.project-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.project-copy strong { font-size: .98rem; }
.project-links, .settings-links { display: flex; flex-wrap: wrap; gap: .22rem .65rem; }
.project-links a, .settings-links a { color: var(--red-dark); display: inline-flex; gap: .13rem; align-items: center; font-size: .76rem; min-height: 29px; }
.project-links a:hover, .settings-links a:hover, .bot-reply a:hover { text-decoration: underline; }
.project-toggle {
  appearance: none;
  position: relative;
  width: 49px;
  height: 44px;
  flex: 0 0 49px;
  margin: 0;
  cursor: pointer;
  border-radius: 100px;
}
.project-toggle::before {
  content: "";
  position: absolute;
  inset: 9px 0;
  border-radius: 100px;
  background: #ded3d1;
  border: 1px solid #baa9a8;
}
.project-toggle::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 4px;
  top: 13px;
  border-radius: 100%;
  background: white;
  box-shadow: 0 1px 2px #603e3b32;
}
.project-toggle:checked::before { background: var(--red); border-color: var(--red); }
.project-toggle:checked::after { left: 27px; }
.project-reset { margin-top: 16px; text-align: center; }

.settings-card { padding: 17px; margin-bottom: 14px; }
.settings-card h2 { font-size: 1.1rem; font-weight: 790; }
.settings-card p { font-size: .88rem; line-height: 1.52; color: var(--muted); }
.settings-card .wide { margin-top: 10px; gap: 7px; flex-wrap: wrap; }
.language.wide .language-key { padding-inline: .7rem; border: 1px solid var(--line); }
.language.wide .language-key[aria-pressed="true"] { background: var(--soft-red); border-color: #ecc8cf; }
.language.wide .language-key::after { display: none; }
.install-title { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.settings-card .primary { margin-top: 12px; }
.settings-links { margin-top: 7px; }

.back-link { display: inline-flex; gap: 6px; min-height: 44px; align-items: center; color: var(--red-dark); font-size: .83rem; font-weight: 730; margin: -9px 0 7px; }
.detail .post-title { font-size: clamp(1.55rem, 6.5vw, 2.26rem); }
.detail-text { white-space: pre-wrap; color: var(--ink); margin: .83rem 0 1rem; font-size: 1rem; }
.original { color: var(--red-dark); margin: .45rem 0 .24rem; }
.discussion { margin-top: 16px; padding: clamp(13px, 4vw, 22px); scroll-margin-top: calc(84px + env(safe-area-inset-top)); }
.discussion-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.discussion-heading h2 { font-size: 1.25rem; }
.thread-count { border-radius: 40px; background: var(--soft-red); color: var(--red-dark); padding: .24rem .55rem; font-size: .76rem; font-weight: 780; }
.comment-form { display: grid; gap: 7px; margin-bottom: 18px; }
.comment-form label { font-size: .8rem; font-weight: 760; margin-top: 4px; }
.comment-form input, .comment-form textarea, .share-dialog input {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 1px solid #dcd0cc;
  border-radius: 11px;
  padding: .61rem .65rem;
  background: #fffcfb;
  color: var(--ink);
  font-size: 16px;
}
.comment-form textarea { resize: vertical; }
.comment-form button { justify-self: start; }
.form-note, .form-error { color: var(--muted); font-size: .81rem; margin-block: 4px; line-height: 1.4; }
.form-error { color: var(--red-dark); }
.form-error:empty { display: none; }
.comment-list { display: grid; gap: 11px; margin-top: 14px; }
.comment { padding: 11px 0; border-top: 1px solid var(--line); scroll-margin-block: 85px; }
.comment-line { display: flex; align-items: flex-start; gap: 8px; }
.comment-copy { min-width: 0; }
.comment-avatar { background: #f4eeec; border-radius: 50%; color: var(--red-dark); font-size: .77rem; font-weight: 800; display: grid; place-items: center; height: 30px; flex: 0 0 30px; }
.comment-meta { display: flex; flex-wrap: wrap; gap: 3px 7px; align-items: baseline; }
.comment-meta strong { overflow-wrap: anywhere; font-size: .85rem; }
.comment p { margin-top: 4px; white-space: pre-wrap; line-height: 1.46; font-size: .89rem; overflow-wrap: anywhere; }
.bot-reply { display: flex; gap: 7px; align-items: flex-start; margin: 8px 0 0 26px; padding: 10px; border-radius: 12px; background: #fff3f2; }
.bot-reply strong, .bot-reply a { color: var(--red-dark); font-size: .81rem; }
.bot-reply a { display: inline-flex; gap: 3px; align-items: center; margin-top: 5px; font-weight: 760; }

.toast {
  position: fixed;
  z-index: 6;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 10px);
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: .72rem .92rem;
  border-radius: 13px;
  border: 1px solid #e9bec6;
  background: #fff5f3;
  color: var(--red-dark);
  font-size: .86rem;
  font-weight: 720;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow);
  transition: opacity .15s ease, transform .15s ease;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.share-dialog { max-width: min(90vw, 410px); border: 1px solid var(--line); padding: 19px; border-radius: 16px; background: white; color: var(--ink); }
.share-dialog::backdrop { background: #4e24202a; }
.share-dialog h2 { font-size: 1.2rem; margin-bottom: 10px; }
.dialog-actions { display: flex; gap: 7px; justify-content: flex-end; margin-top: 12px; }

@media (min-width: 720px) {
  .main { padding-top: 35px; }
  .card:not(.detail) .media-link img { max-height: min(28rem, 60svh); }
  .topbar-inner { min-height: 74px; }
  .nav-inner { gap: 14px; padding-inline: 24px; }
}
@media (max-width: 340px) {
  .language-key { min-width: 30px; }
  .view-link svg { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
