/* uchi.co.jp/site.css */

:root {
  --bg: #f7f2e8;
  --paper: #fbf8f1;
  --paper-2: #f1eadc;
  --ink: #1f1b17;
  --muted: #6d6458;
  --line: rgba(31, 27, 23, 0.14);
  --line-strong: rgba(31, 27, 23, 0.3);
  --accent: #6f3f2b;
  --accent-2: #9c6b43;
  --wood: #5a3e2a;
  --gold: #b08a3f;
  --shadow: 0 18px 50px rgba(20, 16, 12, 0.08);
  --shadow-soft: 0 10px 28px rgba(20, 16, 12, 0.05);
  --radius: 18px;
  --radius-sm: 10px;
  --max: 1200px;
  --reading: 760px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(176, 138, 63, 0.06), transparent 28%),
    linear-gradient(to bottom, #faf7f0, var(--bg));
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(176, 138, 63, 0.22);
  color: var(--ink);
}

.page-width,
.container,
.shell {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.reading-width,
.prose,
.article-width {
  width: min(calc(100% - 2rem), var(--reading));
  margin-inline: auto;
}

.section {
  padding: 4.5rem 0;
}

.section.compact {
  padding: 2.5rem 0;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 248, 241, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.85rem;
  color: var(--ink);
  text-decoration: none;
}

.site-brand-mark {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-brand-sub {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

.site-nav a {
  color: var(--ink);
  font-size: 0.96rem;
  padding: 0.55rem 0.2rem;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active {
  border-bottom-color: var(--accent);
}

.hero {
  position: relative;
  padding: 6rem 0 5rem;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(31, 27, 23, 0.2), transparent);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: end;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.hero h1,
.page-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.hero .subtitle,
.page-subtitle {
  margin-top: 1rem;
  max-width: 52ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.22rem);
}

.hero-card {
  background: linear-gradient(to bottom, rgba(255,255,255,0.72), rgba(255,255,255,0.45));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow-soft);
}

.hero-card img {
  border-radius: calc(var(--radius) - 8px);
}

.hero-note {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.chapter-nav {
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
  box-shadow: var(--shadow-soft);
}

.chapter-nav h3 {
  margin: 0 0 0.8rem;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.chapter-nav ol,
.chapter-nav ul {
  margin: 0;
  padding-left: 1rem;
}

.chapter-nav li + li {
  margin-top: 0.4rem;
}

.chapter-nav a {
  color: var(--ink);
  text-decoration: none;
}

.chapter-nav a:hover,
.chapter-nav a:focus-visible,
.chapter-nav a.is-active {
  color: var(--accent);
  text-decoration: underline;
}

.prose {
  font-size: 1.06rem;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--serif);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.prose h2 {
  margin: 3rem 0 1rem;
  font-size: clamp(1.7rem, 2.4vw, 2.35rem);
}

.prose h3 {
  margin: 2rem 0 0.8rem;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.prose p {
  margin: 1.05rem 0;
}

.prose .lead,
.prose > p:first-of-type {
  font-size: 1.18rem;
  color: #302821;
}

.prose blockquote {
  margin: 2rem 0;
  padding: 1rem 1.15rem 1rem 1.2rem;
  border-left: 3px solid var(--gold);
  background: rgba(176, 138, 63, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: #352d25;
}

.prose hr {
  border: 0;
  height: 1px;
  margin: 2.5rem 0;
  background: linear-gradient(to right, transparent, var(--line-strong), transparent);
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.45rem;
}

.caption,
figure figcaption {
  color: var(--muted);
  font-size: 0.93rem;
  margin-top: 0.7rem;
}

.dropcap:first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 4rem;
  line-height: 0.82;
  padding-right: 0.45rem;
  padding-top: 0.15rem;
  color: var(--accent);
}

figure {
  margin: 2rem 0;
}

.figure-card {
  background: rgba(255,255,255,0.52);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem;
  box-shadow: var(--shadow-soft);
}

.figure-card img,
figure img {
  width: 100%;
  border-radius: calc(var(--radius) - 8px);
}

.image-grid {
  display: grid;
  gap: 1rem;
}

.image-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.82rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button.ghost {
  background: rgba(255,255,255,0.5);
  color: var(--ink);
  border-color: var(--line);
}

.button:hover,
button:hover {
  filter: brightness(0.96);
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  padding: 2.5rem 0 3rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

.site-footer h3 {
  margin: 0 0 0.65rem;
  color: var(--ink);
  font-size: 1rem;
}

.muted { color: var(--muted); }
.center { text-align: center; }
.right { text-align: right; }
.serif { font-family: var(--serif); }
.hidden { display: none !important; }
.space-top { margin-top: 2rem; }
.space-bottom { margin-bottom: 2rem; }
.no-top { margin-top: 0 !important; }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(15, 12, 10, 0.88);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-figure {
  margin: 0;
  max-width: min(1100px, 96vw);
  max-height: 92vh;
}

.lightbox-image {
  max-height: 80vh;
  width: auto;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 20px 70px rgba(0,0,0,0.35);
}

.lightbox-caption {
  margin-top: 0.8rem;
  text-align: center;
  color: #e9e1d3;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
}

@media (max-width: 820px) {
  .hero-grid,
  .site-footer-grid,
  .image-grid.two {
    grid-template-columns: 1fr;
  }

  .site-header-inner {
    min-height: auto;
    padding: 0.8rem 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    display: none;
    width: 100%;
  }

  .site-nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding-top: 4.5rem;
  }

  .section {
    padding: 3.6rem 0;
  }
}

@media (max-width: 560px) {
  body {
    line-height: 1.66;
  }

  .prose {
    font-size: 1rem;
  }

  .chapter-nav {
    padding: 1rem;
  }

  .button,
  button,
  input[type="submit"] {
    width: 100%;
  }
}
