@font-face {
  font-family: DM Sans;
  src: url('/assets/dm-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: Instrument Serif;
  src: url('/assets/instrument-serif.woff2') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: Material Symbols;
  src: url('/assets/symbols.woff2') format('woff2');
  font-display: block;
}

:root {
  color-scheme: light;
  --ink: #19332e;
  --text: #334d45;
  --muted: #5e6c62;
  --green: #21594b;
  --paper: #f6f5ef;
  --panel: #fdfcf8;
  --line: #dce1d7;
  --display: 'Instrument Serif', Georgia, serif;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, select { font: inherit; }
a { color: inherit; }
p, h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }

.wrap { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }

.icon {
  display: inline-block;
  flex: 0 0 auto;
  font: normal 400 20px/1 'Material Symbols';
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  font-feature-settings: 'liga';
  font-variant-ligatures: contextual;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible { outline: 2px solid #487c68; outline-offset: 4px; }
.skip-link { position: absolute; left: 12px; top: 12px; z-index: 3; transform: translateY(-150%); padding: 10px 15px; background: white; }
.skip-link:focus { transform: none; }

.masthead { border-bottom: 1px solid #e4e6dd; }
.navbar { min-height: 74px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 17px; font-weight: 700; line-height: 1.12; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; color: #f4fbf5; background: #255548; font-size: 23px; }
.brand-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .13em; }
nav { display: flex; gap: 32px; align-self: stretch; }
nav a { display: flex; align-items: center; position: relative; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
nav a:hover, nav a[aria-current] { color: var(--green); }
nav a[aria-current]::after { content: ''; position: absolute; inset: auto 0 0; height: 2px; background: #3e7362; border-radius: 2px 2px 0 0; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.button:hover { background: #eaf1e9; border-color: #becfc2; }
.button .icon { font-size: 17px; }
.button[aria-busy="true"] .icon { animation: turn .9s infinite linear; }
.button:disabled { cursor: wait; }
@keyframes turn { to { transform: rotate(360deg); } }

.hero {
  margin-top: 28px;
  min-height: 324px;
  padding: clamp(26px, 4.1vw, 55px);
  border-radius: 17px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
  background: linear-gradient(90deg, #102b2ce8 0%, #102b2c92 53%, #102b2c42 100%),
    url('/assets/yakushima.webp') center 52% / cover no-repeat #233b3a;
  color: #fffdf6;
}
.hero h1 { font: 400 clamp(50px, 6.2vw, 93px)/.97 var(--display); letter-spacing: -.026em; }
.hero-summary { margin-top: 16px; font-size: clamp(14px, 1.5vw, 17px); color: #f5f5e9; }
.location { display: flex; align-items: center; gap: 9px; margin-bottom: 21px; color: #f6f8ed; font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.location .icon { font-size: 15px; }
.location-divider { width: 3px; height: 3px; border-radius: 50%; background: #d3ddd1; }
.local-clock { display: flex; gap: 11px; align-items: center; flex: 0 0 auto; padding: 12px 15px; border-radius: 10px; border: 1px solid #f4fff363; background: #152d2bcb; }
.local-clock .icon { font-size: 23px; }
.local-clock small { display: block; font-size: 9px; font-weight: 700; letter-spacing: .10em; }
.local-clock time { display: block; font-size: 21px; font-weight: 600; margin-top: 3px; line-height: 1; font-variant-numeric: tabular-nums; }

.section { margin-top: 37px; scroll-margin-top: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 17px; }
h2 { font: 400 clamp(37px, 4vw, 47px)/1.04 var(--display); letter-spacing: -.015em; }
.subline { margin-top: 6px; font-size: 14px; color: var(--muted); }
.minor { color: var(--muted); font-size: 13px; line-height: 1.45; }
.sync, .timezone { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--muted); font-size: 13px; }
.sync-dot { width: 7px; height: 7px; flex: 0 0 7px; background: #77857a; border-radius: 50%; }
.sync[data-state="fresh"] .sync-dot { background: #4a805e; box-shadow: 0 0 0 4px #dfebdc; }
.sync[data-state="error"] .sync-dot { background: #a65c2e; box-shadow: 0 0 0 4px #f4e4cd; }

.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.status-card { display: flex; flex-direction: column; align-items: flex-start; padding: 19px 17px 15px; min-height: 166px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-decoration: none; box-shadow: 0 2px 5px #233b2910; transition: border-color .15s, transform .15s; }
.status-card:hover { border-color: #96b6a6; transform: translateY(-2px); }
.card-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: #e6efe5; color: #2b6553; font-size: 22px; }
.status-card h3 { margin-top: 12px; font-size: 17px; letter-spacing: -.025em; }
.status-card p { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 4px; margin-bottom: 12px; }
.card-bottom { display: flex; width: 100%; justify-content: space-between; gap: 5px; align-items: center; margin-top: auto; }
.jump { color: #506e60; font-size: 17px; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; border-radius: 100px; padding: 3px 9px; font-size: 11px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.badge::before { content: ''; width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: currentColor; }
.badge.good { color: #245438; background: #e2f0e4; }
.badge.bad { color: #8c3830; background: #f8e6e1; }
.badge.warn { color: #79501a; background: #f6ebd1; }
.badge.neutral { color: #4b5c54; background: #edf0ea; }

.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); scroll-margin-top: 18px; }
.ferry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.ferry-panel { padding: 17px 19px; }
.ferry-panel header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ferry-panel h3, .board h3 { font-size: 17px; letter-spacing: -.015em; }
.source-links { display: flex; align-items: center; gap: 12px 17px; flex-wrap: wrap; }
.source { display: inline-flex; text-decoration: none; align-items: center; gap: 4px; white-space: nowrap; color: var(--green); font-size: 12px; font-weight: 700; }
.source:hover { text-decoration: underline; }
.source .icon { font-size: 14px; }
.ferry-details { margin-top: 11px; display: grid; gap: 8px; }
.ferry-details [lang="ja"] { font-size: 13px; line-height: 1.55; color: var(--text); }
.ferry-rows { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.ferry-rows li { display: flex; justify-content: space-between; gap: 6px 14px; align-items: center; flex-wrap: wrap; color: var(--text); font-size: 13px; }

.board { overflow: hidden; }
.board-header, .board-controls { padding: 15px 19px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.board-header { border-bottom: 1px solid var(--line); }
.board-title { display: flex; align-items: center; gap: 11px; }
.board-title .minor { margin-top: 2px; }
.direction { border: 0; display: inline-flex; gap: 3px; background: #edf0e9; padding: 4px; margin: 0; border-radius: 8px; }
.direction label { position: relative; cursor: pointer; }
.direction input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.direction span { display: block; color: var(--muted); border-radius: 5px; padding: 8px 11px; line-height: 1; white-space: nowrap; font-size: 13px; font-weight: 600; }
.direction input:checked + span { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px #223c3021; }
.direction input:focus-visible + span { outline: 2px solid #487c68; outline-offset: 1px; }
.date-control { display: inline-flex; gap: 7px; align-items: center; color: var(--muted); font-size: 13px; }
.date-control .icon { font-size: 16px; }
.date-control select { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); padding: 7px 7px; min-height: 34px; }
.board-message, .message { padding: 9px 12px; border: 1px solid #e9debf; background: #fbf4e3; border-radius: 6px; color: #6c4d21; font-size: 13px; }
.board-message { margin: 0 19px 12px; }
.board-notice { margin: 0 19px 12px; color: var(--muted); font-size: 13px; }
.board-notice summary { cursor: pointer; width: fit-content; }
.board-notice summary span { margin-left: 4px; font-size: 11px; }
.board-notice ul { margin-bottom: 0; padding-left: 20px; }

.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline-offset: -2px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 14px; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 19px; }
th { background: #eff1ea; border-block: 1px solid var(--line); color: #516158; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
td { border-bottom: 1px solid #e8ebe4; color: var(--text); font-size: 14px; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; color: var(--ink); }
.table-scroll .empty { color: var(--muted); padding-block: 24px; font-weight: 500; white-space: normal; }
.route-note { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.board-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 12px 19px; }
.board-footer p { color: var(--muted); font-size: 12px; }
.board-footer p:first-child { display: flex; align-items: center; gap: 7px; }
.board-footer .icon { font-size: 15px; }

.site-footer { margin-top: 43px; border-top: 1px solid var(--line); }
.foot { padding-block: 19px 23px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; }
.foot-brand { display: flex; align-items: center; gap: 7px; color: var(--green); font-weight: 700; }
.foot-brand .icon { font-size: 18px; }
.foot a { text-underline-offset: 2px; }

@media (max-width: 1000px) {
  .wrap { width: calc(100% - 48px); }
  .status-card { padding-inline: 13px; }
}

@media (max-width: 770px) {
  .hero { min-height: 285px; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .status-card { padding: 15px; min-height: 154px; }
  .ferry-grid { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .navbar { min-height: 0; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
  .brand-mark { width: 34px; height: 34px; }
  .refresh { margin-left: auto; }
  nav { order: 1; gap: 26px; width: 100%; justify-content: center; }
  nav a { padding: 8px 0 10px; }
  .hero { margin-top: 14px; padding: 23px 18px; align-items: flex-start; justify-content: flex-end; flex-direction: column; min-height: 275px; background-position: 60% center; }
  .hero h1 { font-size: clamp(47px, 11.4vw, 61px); line-height: .94; }
  .hero-summary { margin-top: 10px; }
  .location { margin-bottom: 13px; }
  .local-clock { padding: 6px 9px; gap: 6px; }
  .local-clock div { display: flex; gap: 8px; align-items: center; }
  .local-clock time { font-size: 14px; margin-top: 0; }
  .local-clock small { font-size: 8px; }
  .local-clock .icon { font-size: 15px; }
  .section { margin-top: 28px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 9px; margin-bottom: 13px; }
  .sync, .timezone { font-size: 12px; justify-content: flex-start; }
  .status-card { padding: 12px; min-height: 158px; }
  .status-card h3 { font-size: 15px; }
  .status-card p { font-size: 11px; }
  .card-icon { width: 34px; height: 34px; font-size: 20px; }
  .jump { font-size: 13px; }
  .board-header, .board-controls, .board-footer, .ferry-panel { padding-inline: 12px; }
  .board-message { margin-inline: 12px; }
  .board-notice { margin-inline: 12px; }
  th:first-child, td:first-child { padding-left: 12px; }
  .badge { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
