@import url('https://fonts.googleapis.com/css2?family=M+PLUS+1:wght@400;500;700&family=M+PLUS+1+Code:wght@400;500&display=swap');

:root {
  --font-mplus: 'M PLUS 1';
  --font-mplus-code: 'M PLUS 1 Code';
}

:root {
  --paper: #f6f6f1;
  --paper-soft: #eeeee6;
  --card: #ffffff;
  --fern: #3f5e3a;
  --fern-deep: #2c4429;
  --fern-soft: #e6ede1;
  --fern-line: #d6e0cd;
  --amber: #c9962f;
  --amber-deep: #a8771c;
  --amber-soft: #f6ead0;
  --ink: #1f2a1c;
  --ink-soft: #4c5747;
  --muted: #828c79;
  --board-bg: #233a21;
  --board-line: #3a5236;
  --board-amber: #e7b94f;
  --board-paper: #eef3e6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 16px 40px rgba(36, 58, 33, 0.14);
  --shadow-soft: 0 8px 22px rgba(36, 58, 33, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mplus), system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 30;
  background: var(--fern-deep);
  color: var(--board-paper);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-mplus), system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--amber-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.mono,
.board-stamp,
.dep-time,
.lane-time,
.recent-time,
.dateline-stamp {
  font-family: var(--font-mplus-code), ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

/* ---------- Station header (departure-board status line) ---------- */
.board-head {
  background: var(--fern-deep);
  color: var(--board-paper);
  border-bottom: 3px solid var(--amber);
}

.board-head-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.board-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 0 14px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--board-paper);
}

.wordmark-glyph {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: rgba(231, 185, 79, 0.16);
  color: var(--board-amber);
}

.wordmark-text strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.wordmark-text small {
  display: block;
  margin-top: 2px;
  color: rgba(238, 243, 230, 0.66);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

/* the departure-strip: mono stamp + line + status chips */
.board-strip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--board-line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
}

.board-stamp {
  color: var(--board-amber);
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.board-line {
  color: var(--board-paper);
  font-size: 0.82rem;
  font-weight: 700;
  padding-left: 12px;
  border-left: 1px solid var(--board-line);
}

.board-chips {
  display: inline-flex;
  gap: 6px;
}

.board-chip {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--board-amber);
  border: 1px solid rgba(231, 185, 79, 0.5);
  border-radius: 999px;
  padding: 2px 9px;
}

.board-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  padding: 11px 0;
  border-top: 1px solid var(--board-line);
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(238, 243, 230, 0.82);
}

.board-nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.board-nav a:hover {
  color: var(--board-amber);
}

.nav-code {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 5px;
  background: var(--amber);
  color: var(--fern-deep);
  font-family: var(--font-mplus-code), monospace;
  font-size: 0.7rem;
  font-weight: 700;
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* ---------- Lead ---------- */
.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 40px;
  padding: 58px 0 44px;
}

.lead h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.85rem);
  line-height: 1.4;
  letter-spacing: 0.005em;
}

.lead-lede {
  max-width: 520px;
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.85;
}

.lead-legend {
  display: flex;
  gap: 10px;
  margin: 26px 0 0;
}

.lead-legend div {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--fern-line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.lead-legend dt {
  margin: 0;
  color: var(--amber-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.lead-legend dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.lead-visual {
  height: clamp(240px, 30vw, 340px);
  border-radius: 16px;
  border: 1px solid var(--fern-line);
  box-shadow: var(--shadow);
  background:
    linear-gradient(150deg, rgba(44, 68, 41, 0.06), rgba(44, 68, 41, 0.34)),
    url("/images/fernstation-lead.jpg") center / cover no-repeat,
    linear-gradient(150deg, #3f5e3a 0%, #2c4429 58%, #233a21 100%);
  position: relative;
  overflow: hidden;
}

.lead-visual::after {
  content: "FERN STATION";
  position: absolute;
  left: 18px;
  bottom: 16px;
  font-family: var(--font-mplus-code), monospace;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  color: rgba(231, 185, 79, 0.9);
}

/* ---------- Section heading ---------- */
.band-heading {
  margin-bottom: 22px;
}

.band-heading h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}

.band-heading p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.board,
.lines,
.recent,
.about {
  padding: 46px 0;
}

/* ---------- Departure board (signature) ---------- */
.board-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.board-bar h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}

.board-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.board-bar-count {
  font-family: var(--font-mplus-code), monospace;
  color: var(--amber-deep);
  font-weight: 700;
}

.depboard {
  background: var(--board-bg);
  border-radius: var(--radius);
  border: 1px solid var(--board-line);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.depboard-head,
.depboard-row {
  display: grid;
  grid-template-columns: 92px 168px 1fr 84px;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
}

.depboard-head {
  height: 42px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--board-amber);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--board-line);
}

.depboard-row {
  min-height: 76px;
  padding-top: 16px;
  padding-bottom: 16px;
  color: var(--board-paper);
  border-bottom: 1px solid var(--board-line);
  transition: background 0.16s ease;
}

.depboard-row:last-child {
  border-bottom: 0;
}

.depboard-row:hover {
  background: rgba(231, 185, 79, 0.08);
}

.dep-time {
  color: var(--board-amber);
  font-size: 1.18rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.dep-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.84rem;
  font-weight: 700;
  color: rgba(238, 243, 230, 0.82);
}

.dep-line-code {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--amber);
  color: var(--fern-deep);
  font-family: var(--font-mplus-code), monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.dep-dest {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dep-dest strong {
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.45;
  color: #fff;
}

.dep-dest small {
  color: rgba(238, 243, 230, 0.6);
  font-size: 0.82rem;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.dep-status {
  justify-self: end;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 11px;
  border-radius: 999px;
}

.dep-status-new {
  color: var(--fern-deep);
  background: var(--board-amber);
}

.dep-status-upd {
  color: var(--board-amber);
  border: 1px solid rgba(231, 185, 79, 0.6);
}

/* ---------- Lines (grouped by topic) ---------- */
.lane-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.lane {
  background: var(--card);
  border: 1px solid var(--fern-line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
}

.lane-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--fern-line);
}

.lane-code {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--fern-soft);
  color: var(--fern-deep);
  font-family: var(--font-mplus-code), monospace;
  font-size: 1rem;
  font-weight: 700;
}

.lane-head h3 {
  font-size: 1.1rem;
}

.lane-head p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}

.lane-count {
  color: var(--amber-deep);
  font-family: var(--font-mplus-code), monospace;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.lane-items {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.lane-items a {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 9px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.16s ease;
}

.lane-items a:hover {
  background: var(--fern-soft);
}

.lane-time {
  color: var(--amber-deep);
  font-size: 0.86rem;
  font-weight: 500;
}

.lane-title {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
}

/* ---------- Recent ---------- */
.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.recent-list a {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 18px;
  background: var(--card);
  border: 1px solid var(--fern-line);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.recent-list a:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow-soft);
}

.recent-time {
  color: var(--amber-deep);
  font-size: 1.02rem;
  font-weight: 500;
}

.recent-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.recent-body strong {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.recent-body small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.recent-go {
  color: var(--fern);
  font-size: 1.2rem;
  font-weight: 700;
}

/* ---------- About ---------- */
.desk-notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  max-width: 760px;
}

.desk-notes li {
  position: relative;
  padding: 16px 18px 16px 46px;
  background: var(--card);
  border: 1px solid var(--fern-line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  line-height: 1.7;
}

.desk-notes li::before {
  content: "›";
  position: absolute;
  left: 18px;
  top: 14px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--fern-soft);
  color: var(--fern-deep);
  font-weight: 700;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--fern-deep);
  color: rgba(238, 243, 230, 0.82);
  margin-top: 36px;
  border-top: 3px solid var(--amber);
}

.site-footer > * {
  width: min(1120px, calc(100% - 40px));
  margin-left: auto;
  margin-right: auto;
}

.footer-mark {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-top: 34px;
}

.footer-mark strong {
  color: var(--board-paper);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
}

.footer-mark span {
  color: rgba(238, 243, 230, 0.55);
  font-size: 0.8rem;
}

.footer-desc {
  margin: 14px auto;
  max-width: 620px;
  line-height: 1.7;
  font-size: 0.92rem;
}

.footer-note {
  margin: 0 auto;
  padding-bottom: 46px;
  color: rgba(238, 243, 230, 0.6);
  font-size: 0.82rem;
}

/* ---------- Article (single column, date-first) ---------- */
.article-shell {
  max-width: 760px;
  padding: 30px 0 72px;
}

.breadcrumb {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.breadcrumb a:hover {
  color: var(--fern-deep);
}

.crumb-code,
.dateline-code {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 4px;
  background: var(--fern-soft);
  color: var(--fern-deep);
  font-family: var(--font-mplus-code), monospace;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}

.article-body {
  background: var(--card);
  border: 1px solid var(--fern-line);
  border-top: 4px solid var(--fern);
  border-radius: 14px;
  padding: clamp(24px, 4.5vw, 48px);
  box-shadow: var(--shadow-soft);
}

.dateline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--fern-line);
}

.dateline-stamp {
  color: var(--amber-deep);
  font-size: 1.24rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.dateline-status {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
}

.dateline-status-new {
  color: var(--fern-deep);
  background: var(--amber-soft);
}

.dateline-status-upd {
  color: var(--amber-deep);
  border: 1px solid var(--amber);
}

.dateline-line {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.article-head h1 {
  margin: 18px 0 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.42;
}

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

.article-lede {
  margin: 26px 0 0;
  padding: 18px 20px;
  background: var(--fern-soft);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.78;
  font-weight: 500;
}

.article-content {
  margin-top: 26px;
  color: #29331f;
  font-size: 1.04rem;
  line-height: 1.92;
}

.article-content h2 {
  margin: 38px 0 12px;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  padding-left: 14px;
  border-left: 4px solid var(--amber);
}

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

.article-content a {
  color: var(--fern-deep);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--amber);
  text-underline-offset: 3px;
}

.article-content a:hover {
  color: var(--amber-deep);
}

.article-content ul,
.article-content ol {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.article-content ul li {
  position: relative;
  padding-left: 26px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.article-content ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--amber);
}

.article-content ol {
  counter-reset: step;
}

.article-content ol li {
  position: relative;
  padding-left: 30px;
  counter-increment: step;
  color: var(--ink-soft);
  line-height: 1.7;
}

.article-content ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--fern-soft);
  color: var(--fern-deep);
  font-family: var(--font-mplus-code), monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.article-content blockquote {
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--board-bg);
  border-radius: var(--radius-sm);
  color: var(--board-paper);
  font-size: 1.02rem;
  line-height: 1.75;
}

.article-content blockquote::before {
  content: "掲示";
  display: inline-block;
  margin-bottom: 8px;
  font-family: var(--font-mplus-code), monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--board-amber);
}

.article-content blockquote p {
  margin: 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.94rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--fern-line);
}

.article-content th,
.article-content td {
  border-bottom: 1px solid var(--fern-line);
  border-right: 1px solid var(--fern-line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.article-content th:last-child,
.article-content td:last-child {
  border-right: 0;
}

.article-content tbody tr:last-child td {
  border-bottom: 0;
}

.article-content th {
  background: var(--fern-deep);
  color: var(--board-paper);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.article-content tbody tr:nth-child(even) {
  background: var(--paper-soft);
}

/* ---------- FAQ + sources ---------- */
.faq-section,
.source-note {
  margin-top: 38px;
}

.faq-section h2,
.source-note h2 {
  font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  margin-bottom: 8px;
}

.faq-section details {
  border-bottom: 1px solid var(--fern-line);
  padding: 15px 0;
}

.faq-section summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  display: flex;
  gap: 10px;
}

.faq-section summary::-webkit-details-marker {
  display: none;
}

.faq-section summary::before {
  content: "Q";
  flex: none;
  width: 1.5em;
  color: var(--amber-deep);
  font-family: var(--font-mplus-code), monospace;
  font-weight: 700;
}

.faq-section details p {
  margin: 10px 0 0 1.5em;
  color: var(--ink-soft);
  line-height: 1.74;
}

.source-note {
  padding: 20px 22px;
  background: var(--paper-soft);
  border: 1px dashed var(--fern-line);
  border-radius: var(--radius);
}

.source-note p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.74;
}

.article-foot {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--fern-line);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fern-deep);
  font-weight: 700;
}

.back-link::before {
  content: "←";
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .lead {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .lane-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .board-head-top {
    gap: 14px;
  }

  .depboard-head {
    display: none;
  }

  .depboard-row {
    grid-template-columns: 70px 1fr;
    grid-template-areas:
      "time line"
      "dest dest"
      "status status";
    gap: 6px 14px;
  }

  .dep-time {
    grid-area: time;
  }

  .dep-line {
    grid-area: line;
    justify-self: end;
  }

  .dep-dest {
    grid-area: dest;
  }

  .dep-status {
    grid-area: status;
    justify-self: start;
  }

  .recent-list a {
    grid-template-columns: 56px 1fr;
  }

  .recent-go {
    display: none;
  }

  .article-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
