/* ─────────────────────────────────────────────
   Design Tokens
───────────────────────────────────────────── */
:root {
  /* Paper / Background */
  --paper:       #F4EFE5;
  --paper-deep:  #EBE3D2;
  --card-bg:     rgba(255, 252, 246, 0.5);

  /* Ink / Text */
  --ink:         #2A323C;
  --ink-mid:     #5A6370;
  --ink-soft:    #8A8F98;

  /* Rule / Border */
  --rule:        #D4C5B0;

  /* Accent */
  --accent-warm: #B8A081;

  /* Category Dots */
  --cat-ext:     #2A323C;
  --cat-sys:     #5A6370;
  --cat-con:     #B8A081;
  --cat-wri:     #8A8F98;

  /* Typography */
  --font-serif:  'Shippori Mincho', 'Hiragino Mincho ProN', serif;
  --font-sans:   'Noto Sans JP', 'Hiragino Sans', sans-serif;
  --font-mono:   'JetBrains Mono', ui-monospace, monospace;
}

/* ─────────────────────────────────────────────
   Reset & Base
───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--paper-deep);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.7;
  min-height: 100vh;
}

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

img {
  display: block;
  max-width: 100%;
}

/* ─────────────────────────────────────────────
   Page Layout
───────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  background-color: var(--paper);
  min-height: 100vh;
  overflow: hidden;
}

/* Stamp decorations (behind content) */
.stamp-seal,
.stamp-rect {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.stamp-seal {
  top: 26px;
  right: 32px;
  width: 92px;
  height: 92px;
  opacity: 0.55;
  transform: rotate(-9deg);
}

.stamp-rect {
  bottom: 64px;
  left: 24px;
  width: 150px;
  height: 56px;
  opacity: 0.42;
  transform: rotate(-2.5deg);
}

/* Content layer above stamps */
.page-content {
  position: relative;
  z-index: 1;
  padding: 36px 48px 48px;
}

/* ─────────────────────────────────────────────
   Header
───────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  flex-shrink: 0;
  border-radius: 50%;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.tagline {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 300;
  color: var(--ink-mid);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.meta-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 4px;
}

.doc-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink);
  letter-spacing: 0.15em;
  border: 1px solid var(--ink);
  padding: 3px 7px;
  text-transform: uppercase;
}

.doc-rev {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-soft);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────
   NOW Row
───────────────────────────────────────────── */
.now-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.now-stamp {
  flex-shrink: 0;
  border: 1.5px solid var(--ink);
  padding: 7px 12px;
  transform: rotate(-3deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.now-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--accent-warm);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.now-date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink);
  letter-spacing: 0.1em;
}

.now-status {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-mid);
  line-height: 1.6;
}

/* ─────────────────────────────────────────────
   Section Common
───────────────────────────────────────────── */
.section {
  margin-bottom: 36px;
}

.sec-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.sec-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.2em;
}

.sec-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}

.sec-en {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.22em;
}

/* ─────────────────────────────────────────────
   § 00 Latest Card
───────────────────────────────────────────── */
.latest-card {
  position: relative;
  border: 1px solid var(--ink);
  padding: 20px 22px;
  background-color: var(--card-bg);
}

.latest-badge {
  position: absolute;
  top: -10px;
  left: 18px;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  padding: 2px 8px;
  text-transform: uppercase;
}

.latest-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.18em;
  margin-bottom: 10px;
}

.latest-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 10px;
}

.latest-desc {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-mid);
  line-height: 1.75;
  margin-bottom: 16px;
}

.latest-links {
  display: flex;
  gap: 20px;
}

.latest-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  letter-spacing: 0.05em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.latest-links a:hover {
  color: var(--ink-mid);
}

/* ─────────────────────────────────────────────
   § 01 Works List
───────────────────────────────────────────── */
.works-list {
  display: flex;
  flex-direction: column;
}

.work-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--rule);
  transition: background-color 0.15s ease;
  text-decoration: none;
}

.work-row:first-child {
  border-top: none;
}

.work-row:hover {
  background-color: rgba(42, 50, 60, 0.04);
}

.cat-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-soft);
  letter-spacing: 0.18em;
  white-space: nowrap;
  flex-shrink: 0;
}

.cat-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.work-info {
  min-width: 0;
}

.work-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-desc {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--ink-mid);
  line-height: 1.5;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   § 02 Elsewhere Grid
───────────────────────────────────────────── */
.elsewhere-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.link-card {
  display: block;
  border: 1px solid var(--rule);
  padding: 12px 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  text-decoration: none;
}

.link-card:hover {
  border-color: var(--ink-mid);
  background-color: rgba(42, 50, 60, 0.03);
}

.link-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-soft);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.link-url {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.3;
}

/* ─────────────────────────────────────────────
   Footer
───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-top: 36px;
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-soft);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.footer-motto {
  font-family: var(--font-serif);
  font-size: 13.5px;
  color: var(--ink-mid);
  text-align: center;
  margin-top: 14px;
  letter-spacing: 0.03em;
}

/* ─────────────────────────────────────────────
   Print
───────────────────────────────────────────── */
@media print {
  .stamp-seal,
  .stamp-rect {
    display: none;
  }

  .page-wrapper {
    max-width: 100%;
    box-shadow: none;
  }

  .page-content {
    padding: 24px;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10px;
    color: var(--ink-soft);
  }

  .work-row:hover,
  .link-card:hover {
    background-color: transparent;
  }
}

/* ─────────────────────────────────────────────
   Responsive — Mobile (≤640px)
───────────────────────────────────────────── */
@media (max-width: 640px) {
  .page-content {
    padding: 24px 20px 40px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .wordmark {
    font-size: 24px;
  }

  .meta-block {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .stamp-seal {
    width: 60px;
    height: 60px;
    top: 16px;
    right: 16px;
  }

  .stamp-rect {
    display: none;
  }

  .now-row {
    flex-wrap: wrap;
    gap: 12px;
  }

  .work-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 4px;
  }

  .work-title,
  .work-desc {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .work-date {
    font-size: 9px;
    opacity: 0.7;
  }

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

  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .latest-links {
    flex-direction: column;
    gap: 8px;
  }
}
