:root {
  --ink: #111827;
  --paper: #fffbe7;
  --line: #1f2937;
  --blue: #136fbb;
  --teal: #0f9f8f;
  --yellow: #ffe66d;
  --coral: #ff7a70;
  --green: #9bdc7a;
  --shadow: #9aa0a6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "MS PGothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background:
    linear-gradient(90deg, rgba(19, 111, 187, .16) 1px, transparent 1px),
    linear-gradient(rgba(255, 122, 112, .18) 1px, transparent 1px),
    #c9f0e8;
  background-size: 18px 18px;
}

a {
  color: #003dcc;
  font-weight: bold;
}

a:visited {
  color: #7d2394;
}

a:hover,
a:focus-visible {
  color: #d60000;
}

.page-shell {
  width: min(920px, calc(100% - 24px));
  margin: 14px auto;
  border: 3px double var(--line);
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--shadow);
}

.site-header {
  padding: 18px 16px 14px;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 230, 109, .9), rgba(255, 122, 112, .85)),
    repeating-linear-gradient(45deg, #136fbb 0 10px, #0f9f8f 10px 20px);
  border-bottom: 3px solid var(--line);
  text-shadow: 2px 2px 0 #000;
}

.compact-header h1 {
  font-size: clamp(2rem, 7vw, 3.6rem);
}

.eyebrow,
.tagline {
  margin: 0;
  font-weight: bold;
}

h1 {
  margin: 2px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 8vw, 4.6rem);
  letter-spacing: 0;
}

h2 {
  margin: 0 0 10px;
  padding: 3px 8px;
  color: #fff;
  font-size: 1rem;
  background: var(--blue);
  border: 2px outset #8cc6ff;
}

.top-links {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 3px solid var(--line);
  background: var(--yellow);
}

.top-links a {
  min-width: 0;
  padding: 8px 6px;
  text-align: center;
  color: #111827;
  border-right: 2px solid var(--line);
  text-decoration: none;
}

.top-links a:last-child {
  border-right: 0;
}

.top-links a:hover,
.top-links a:focus-visible {
  background: var(--green);
}

.layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 14px;
  padding: 14px;
}

.single-column {
  padding: 14px;
}

.sidebar,
.content {
  min-width: 0;
}

.box,
.panel {
  border: 2px solid var(--line);
  background: #fffdf5;
  box-shadow: 3px 3px 0 #c6c6c6;
}

.box {
  margin-bottom: 14px;
  padding: 10px;
}

.counter-box {
  text-align: center;
}

.counter {
  display: inline-block;
  margin: 2px 0 8px;
  padding: 3px 8px;
  color: #39ff14;
  font-family: "Courier New", monospace;
  font-size: 1.35rem;
  font-weight: bold;
  letter-spacing: 2px;
  background: #080808;
  border: 2px inset #bdbdbd;
}

.menu-list {
  padding-left: 20px;
  margin: 0;
}

.menu-list li + li {
  margin-top: 6px;
}

.mini-banner {
  display: block;
  width: 100%;
  border: 2px inset #e5e7eb;
  image-rendering: auto;
}

.ticker {
  overflow: hidden;
  margin-bottom: 14px;
  padding: 6px 8px;
  color: #fff;
  white-space: nowrap;
  background: #111827;
  border: 2px inset #d1d5db;
}

.ticker span {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.ticker span::before {
  content: "★ ";
  color: var(--yellow);
}

.panel {
  margin-bottom: 14px;
  padding: 12px;
}

.intro {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  align-items: center;
}

.intro img {
  display: block;
  width: 100%;
  border: 2px solid var(--line);
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.log-table th,
.log-table td {
  padding: 7px;
  border: 1px solid #6b7280;
  text-align: left;
  vertical-align: top;
}

.log-table th {
  width: 118px;
  color: #7a1f00;
  background: #fff3b0;
}

.work-list {
  display: grid;
  gap: 10px;
}

.work-card {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: #fff;
  border: 2px inset #d1d5db;
}

.work-card h3,
.work-card p {
  margin: 0;
}

.work-card h3 {
  margin-bottom: 4px;
  color: #0b4f85;
  font-size: 1.15rem;
}

.work-type {
  color: #7a1f00;
  font-family: "Courier New", monospace;
  font-size: .82rem;
  font-weight: bold;
}

.work-card > a {
  display: block;
  padding: 8px 6px;
  color: #111827;
  text-align: center;
  text-decoration: none;
  background: var(--yellow);
  border: 2px outset #fff3a3;
}

.work-card > a:hover,
.work-card > a:focus-visible {
  background: var(--green);
}

.board article {
  padding: 8px;
  background: #f7ffe6;
  border: 1px dashed #6b7280;
}

.board article + article {
  margin-top: 8px;
}

.board p {
  margin: 4px 0 0;
}

.memo-lead p {
  margin: 0;
}

.post-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.post-list li {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 4px 10px;
  padding: 9px;
  background: #fff;
  border: 1px dashed #6b7280;
}

.post-list time {
  color: #7a1f00;
  font-family: "Courier New", monospace;
  font-weight: bold;
}

.post-list span {
  grid-column: 2;
  color: #4b5563;
  font-size: .92rem;
}

.memo-article p,
.memo-article ul {
  margin-top: 0;
}

.memo-article code {
  padding: 1px 4px;
  background: #fff3b0;
  border: 1px solid #d6bd4a;
}

.site-footer {
  padding: 10px;
  text-align: center;
  background: #e5e7eb;
  border-top: 3px solid var(--line);
}

.site-footer p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 16px, 520px);
    box-shadow: 4px 4px 0 var(--shadow);
  }

  .top-links {
    grid-template-columns: repeat(2, 1fr);
  }

  .top-links a:nth-child(2n) {
    border-right: 0;
  }

  .top-links a:not(:last-child) {
    border-bottom: 2px solid var(--line);
  }

  .top-links a:last-child {
    grid-column: 1 / -1;
  }

  .layout,
  .intro {
    grid-template-columns: 1fr;
  }

  .layout {
    padding: 10px;
  }

  .intro img {
    max-height: 180px;
    object-fit: cover;
  }

  .work-card {
    grid-template-columns: 1fr;
  }

  .post-list li {
    grid-template-columns: 1fr;
  }

  .post-list span {
    grid-column: 1;
  }
}

@media (max-width: 430px) {
  body {
    font-size: 15px;
  }

  .log-table th,
  .log-table td {
    display: block;
    width: 100%;
  }
}
