:root {
  color-scheme: light;
  --ink: #51463f;
  --muted: #71665d;
  --line: #e8dfd2;
  --background: #fcf8f0;
  --accent: #626d50;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: "Kiwi Maru", "Hiragino Maru Gothic ProN", "Yu Gothic", serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 2;
}

a {
  color: var(--accent);
  text-underline-offset: 4px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible, video:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1, h2, h3, .brand {
  font-family: "Yusei Magic", "Hiragino Maru Gothic ProN", sans-serif;
}

h1 {
  margin-bottom: 20px;
  font-size: 1.4rem;
  line-height: 1.5;
  font-weight: 400;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.35rem;
  font-weight: 400;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.25rem;
  line-height: 1.6;
  font-weight: 400;
}

.site-header, .section-frame, .site-footer {
  width: min(680px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
}

.site-nav a {
  color: var(--muted);
}

.section-frame {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}

.hero {
  padding: 36px 0;
}

.hero-lead {
  color: var(--muted);
  margin-bottom: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.button-primary {
  justify-content: center;
  min-height: 48px;
  padding: 10px 28px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
}

.button-primary:hover {
  background: #4e583e;
}

.section-heading {
  margin-bottom: 30px;
}

.section-heading > p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0;
}

.work-grid {
  display: grid;
  gap: 40px;
}

.work-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
  padding-bottom: 36px;
  border-bottom: 1px dashed var(--line);
}

.work-card:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.work-card-top {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 12px;
}

.work-kind {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 12px;
  background: #efe9dd;
}

.work-demo {
  margin: 20px 0 0;
  min-width: 0;
  width: min(100%, 560px);
}

.work-demo video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #292723;
  border-radius: 10px;
}

.work-demo figcaption {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 6px;
}

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

.work-content > p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
}

.about-grid {
  max-width: 680px;
}

.contact-copy {
  max-width: 680px;
  color: var(--muted);
}

.contact-email {
  margin: 18px 0 0;
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 0 36px;
  font-size: 0.75rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.privacy-page {
  max-width: 680px;
}

.privacy-page h1 {
  font-size: clamp(1.6rem, 5vw, 2rem);
  overflow-wrap: anywhere;
}

.privacy-page h2 {
  font-size: 1.15rem;
}

.privacy-page section {
  margin: 32px 0;
}

.privacy-page p {
  color: var(--muted);
}

.privacy-page a {
  overflow-wrap: anywhere;
}

.privacy-date {
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .site-header, .section-frame, .site-footer {
    width: calc(100% - 36px);
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    padding: 20px 0;
  }

  .site-nav {
    gap: 20px;
  }

  .hero {
    padding: 30px 0;
  }

  .section-frame {
    padding-top: 36px;
    padding-bottom: 36px;
  }

}

.work-content > p:last-of-type {
  margin-bottom: 22px;
}

/* The home page is an overview; detail pages keep a readable text width. */
.home-page .site-header,
.home-page .section-frame,
.home-page .site-footer {
  width: min(1040px, calc(100% - 48px));
}

.home-page .hero {
  padding: 28px 0;
}

.home-page .hero h1 {
  margin-bottom: 12px;
}

.home-page .hero-copy {
  margin-bottom: 28px;
}

.work-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.work-card,
.work-card:last-child {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  align-content: start;
  color: var(--ink);
  text-decoration: none;
}

.work-card:hover {
  border-color: var(--accent);
  background: #f7f3e9;
}

.work-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.work-thumbnail {
  display: block;
  border-radius: 11px 11px 0 0;
}

.work-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #292723;
  border-radius: inherit;
}

.work-card .work-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.work-card .work-card-label {
  font-size: 0.7rem;
  margin-bottom: 8px;
}

.work-card h2 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.detail-heading h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  overflow-wrap: anywhere;
}

.detail-heading .work-kind {
  font-size: 0.75rem;
  margin-bottom: 12px;
}

.detail-lead,
.detail-section > p {
  color: var(--muted);
}

.detail-section {
  margin-top: 36px;
}

.detail-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}

.detail-subsection {
  margin-top: 24px;
}

.detail-section h3 {
  font-size: 1.05rem;
}

.detail-subsection p,
.detail-section li {
  color: var(--muted);
}

.detail-section ul {
  padding-left: 1.5em;
}

.detail-section li + li {
  margin-top: 8px;
}

.detail-section a {
  overflow-wrap: anywhere;
}

.detail-source {
  font-size: 0.8rem;
  margin-top: 24px;
}

.detail-table {
  max-width: 100%;
  overflow-x: auto;
  margin: 20px 0;
}

.detail-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.detail-table th,
.detail-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  min-width: 120px;
}

.detail-table th {
  background: #efe9dd;
  font-weight: 500;
}

.detail-section pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 16px;
  background: #efe9dd;
  border-radius: 8px;
  font-size: 0.85rem;
}

.detail-section p code,
.detail-section li code {
  overflow-wrap: anywhere;
}

.work-detail .work-demo {
  width: 100%;
  margin-top: 16px;
}

.related-works {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.related-works ul {
  padding-left: 1.25em;
  margin-bottom: 24px;
}

@media (max-width: 800px) {
  .work-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .work-card .work-content {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .home-page .site-header,
  .home-page .section-frame,
  .home-page .site-footer {
    width: calc(100% - 36px);
  }
}
