:root {
  --ink: #1a1f2e;
  --ink-muted: #5c6578;
  --ink-faint: #8b93a7;
  --accent: #c45c26;
  --accent-soft: rgba(196, 92, 38, 0.12);
  --line: rgba(26, 31, 46, 0.08);
  --bg-top: #e8edf4;
  --bg-mid: #f3f0eb;
  --bg-bottom: #dfe8ef;
  --font-display: "Syne", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", sans-serif;
  --radius: 2px;
  --max: 720px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-mid);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.bg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 60% at 10% -10%, #c5d4e8 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 15%, #e8d5c4 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, #b8c9d9 0%, transparent 55%),
    linear-gradient(165deg, var(--bg-top), var(--bg-mid) 45%, var(--bg-bottom));
  animation: atmosphere-drift 18s ease-in-out infinite alternate;
}

.bg-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  pointer-events: none;
}

@keyframes atmosphere-drift {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(8deg); }
}

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 4.5rem) clamp(1.25rem, 4vw, 2rem) 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.75rem, 9vw, 4.25rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--ink);
}

.brand-sub {
  margin-top: 0.55rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.live-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0;
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft);
  animation: pulse-live 2s ease-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-live {
  0% { box-shadow: 0 0 0 0 rgba(196, 92, 38, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(196, 92, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(196, 92, 38, 0); }
}

.live-label {
  font-weight: 500;
  color: var(--ink);
}

.refresh-meta {
  color: var(--ink-faint);
}

.refresh-meta::before {
  content: "·";
  margin-right: 0.5rem;
  color: var(--ink-faint);
}

.feed {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem) 3rem;
}

.feed-loading {
  padding: 3rem 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.9375rem;
}

.flash-item {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem 1.25rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(12px);
  animation: item-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.flash-item:hover .flash-title,
.flash-item:focus-visible .flash-title {
  color: var(--accent);
}

.flash-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.flash-item.is-new {
  background: linear-gradient(
    90deg,
    var(--accent-soft) 0%,
    transparent 40%
  );
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--radius);
}

.important-block {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 1.15rem 0 0.35rem;
  border-top: 1px solid var(--line);
}

.important-heading {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(196, 92, 38, 0.22);
}

.important-heading-label {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.important-heading-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(196, 92, 38, 0.28),
    transparent 85%
  );
}

.flash-item.is-important {
  gap: 1rem 1.25rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid rgba(26, 31, 46, 0.06);
}

.flash-item.is-important:last-child {
  border-bottom: none;
}

.flash-item.is-important .flash-time {
  font-weight: 700;
}

.flash-item.is-important .flash-title {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.flash-item.is-important .flash-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-muted);
}

.flash-item.is-important .flash-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.feed-rest {
  list-style: none;
  border-top: 1px solid var(--line);
}

.feed-rest-label {
  padding: 0.85rem 0 0.15rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

@keyframes item-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flash-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  padding-top: 0.2rem;
  letter-spacing: 0.02em;
}

.flash-body {
  min-width: 0;
}

.flash-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.flash-title {
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
}

.flash-summary {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem) 2.5rem;
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 31, 46, 0.42);
  backdrop-filter: blur(6px);
  animation: backdrop-in 0.25s ease;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  max-height: min(88dvh, 820px);
  overflow-y: auto;
  padding: 2rem 2.25rem 2.25rem;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.94), rgba(243, 240, 235, 0.96));
  border: 1px solid rgba(26, 31, 46, 0.08);
  border-radius: 4px;
  box-shadow: 0 24px 48px rgba(26, 31, 46, 0.14);
  animation: panel-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--ink);
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-right: 2rem;
}

.modal-tag {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.modal-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.modal-title {
  font-size: clamp(1.25rem, 3.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}

.modal-body {
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--ink);
  line-height: 1.85;
}

.modal-body p + p {
  margin-top: 1rem;
}

.modal-source {
  margin-top: 1.25rem !important;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

body.modal-open {
  overflow: hidden;
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 480px) {
  .flash-item {
    grid-template-columns: 3.75rem 1fr;
    gap: 0.75rem 1rem;
  }

  .flash-title {
    font-size: 1rem;
  }

  .flash-item.is-important .flash-title {
    font-size: 1.05rem;
  }

  .modal-panel {
    padding: 1.5rem 1.25rem 1.75rem;
    max-height: 88dvh;
  }
}
