/* ==========================================================================
   テクノ手芸部 Techno-Shugei Club — archival documentation site
   静かで機能的な報告書のようなトーン。装飾は最小限に。
   ========================================================================== */

:root {
  --bg-1: #faf7f2;
  --bg-2: #ffffff;
  --bg-3: #f5f0e8;
  --paper: #fffdfa;
  --ink: #262220;
  --ink-dim: #6b6259;
  --ink-faint: #a89e92;
  --coral: #d8492f;
  --coral-soft: #fbe4e0;
  --leaf: #4c8c4a;
  --leaf-soft: #e3efdc;
  --sky: #3d7ea6;
  --sky-soft: #dfeaf1;
  --line: rgba(38, 34, 32, 0.11);
  --line-strong: rgba(38, 34, 32, 0.2);
  --radius: 10px;
  --max-width: 880px;
  --font: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(150deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-size: 16px;
}

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

a {
  color: var(--coral);
  text-decoration: underline;
  text-decoration-color: rgba(216, 73, 47, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--coral);
}

nav a,
.no-underline {
  text-decoration: none;
}

ul {
  list-style: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- language toggle ---------- */

[data-ja] {
  display: inline;
}

[data-en] {
  display: none;
}

.lang-en [data-ja] {
  display: none;
}

.lang-en [data-en] {
  display: inline;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.lang-toggle button,
.lang-toggle a {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font: inherit;
  font-weight: 700;
  padding: 4px 2px;
  text-decoration: none;
}

.lang-toggle button.is-active,
.lang-toggle a.is-active,
.lang-toggle span.is-active {
  color: var(--coral);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px 2px;
  font-weight: 700;
}

.lang-toggle .sep {
  color: var(--line-strong);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 45% 55%;
}

.logo-text {
  display: flex;
  flex-direction: column;
  width: max-content;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.logo-img {
  display: block;
  width: 100%;
  height: auto;
}

.logo-text .en {
  display: block;
  width: 100%;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-align: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-dim);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--coral);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--ink);
}

/* ---------- page framing ---------- */

.page-head {
  padding: 56px 0 40px;
}

.page-head .eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--coral);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.page-head h1 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* For pages whose Japanese h1 was just a translation of the English
   eyebrow label (Works/Book/Media): drop the small eyebrow and promote
   the English word itself to the h1, at full title size and weight. */
.page-head h1.en-title {
  color: var(--coral);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-head p.lede {
  color: var(--ink-dim);
  margin-top: 14px;
  max-width: 620px;
}

main {
  display: block;
  padding-bottom: 68px;
}

section {
  padding: 0 0 64px;
}

section + section {
  padding-top: 0;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}

hr.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 56px 0;
}

/* ---------- home ---------- */

.home-intro {
  padding: 64px 0 8px;
}

.home-intro p {
  color: var(--ink-dim);
  max-width: 620px;
  font-size: 1.02rem;
}

.home-intro h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.home-photo {
  margin: 40px 0 8px;
  text-align: center;
}

.home-photo img {
  position: relative;
  z-index: 501;
  display: inline-block;
  width: 100%;
  max-width: 640px;
  height: auto;
}

.home-photo-caption {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.index-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.index-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 20px 2px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.index-list a:hover .idx-title {
  color: var(--coral);
}

.idx-title {
  font-weight: 700;
  font-size: 1.02rem;
  margin-right: 14px;
}

.idx-desc {
  color: var(--ink-dim);
  font-size: 0.88rem;
  margin-top: 4px;
  font-weight: 400;
}

.idx-arrow {
  color: var(--ink-faint);
  font-size: 0.9rem;
  flex-shrink: 0;
}

dl.fact-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 24px;
  font-size: 0.92rem;
}

dl.fact-list dt {
  color: var(--ink-faint);
}

dl.fact-list dd {
  color: var(--ink);
}

/* ---------- about ---------- */

.about-photo {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  max-width: 320px;
  margin-bottom: 28px;
}

.credit-row {
  display: flex;
  gap: 8px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.credit-pill {
  font-size: 0.78rem;
  color: var(--ink-dim);
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 5px 13px;
  border-radius: 999px;
}

.prose p {
  color: var(--ink-dim);
  margin-bottom: 16px;
}

.prose p:last-child {
  margin-bottom: 0;
}

.milestone-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.milestone-list li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.milestone-list .y {
  color: var(--ink-faint);
  font-weight: 700;
}

.member-list li {
  grid-template-columns: 1fr;
  gap: 4px;
}

.member-list .y {
  white-space: nowrap;
  font-size: 0.98rem;
}

.pub-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

.pub-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--ink-dim);
}

.pub-list .venue {
  color: var(--ink-faint);
  font-size: 0.82rem;
}

.milestone-list .grp-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--coral);
  margin-top: 28px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- tags ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
}

.tag-coral {
  color: var(--coral);
  background: var(--coral-soft);
  border-color: rgba(216, 73, 47, 0.25);
}

.tag-leaf {
  color: var(--leaf);
  background: var(--leaf-soft);
  border-color: rgba(76, 140, 74, 0.25);
}

.tag-sky {
  color: var(--sky);
  background: var(--sky-soft);
  border-color: rgba(61, 126, 166, 0.25);
}

/* ---------- works grid ---------- */

.works-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 18px;
  row-gap: 40px;
}

.work-card {
  text-decoration: none;
  color: var(--ink);
}

.work-thumb {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-3);
}

.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-top: 10px;
}

.work-meta {
  font-size: 0.76rem;
  color: var(--ink-faint);
  margin-top: 5px;
  line-height: 1.5;
}

.work-card:hover h3 {
  color: var(--coral);
}

/* ---------- book ---------- */

.book-row {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.book-row:first-child {
  padding-top: 0;
}

.book-cover {
  width: 96px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.book-info h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.book-info p {
  color: var(--ink-dim);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.book-meta {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

/* ---------- media list ---------- */

.media-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.media-row {
  display: grid;
  grid-template-columns: 110px 1fr max-content;
  gap: 18px;
  align-items: baseline;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.media-row:hover h3 {
  color: var(--coral);
}

.media-date {
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.media-row h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.media-row .outlet {
  font-size: 0.82rem;
  color: var(--ink-dim);
  margin-top: 2px;
}

/* ---------- media detail ---------- */

.media-detail dl.fact-list {
  margin: 20px 0 28px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---------- archive index ---------- */

.archive-note {
  font-size: 0.85rem;
  color: var(--ink-faint);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 40px;
}

.archive-year {
  margin-bottom: 44px;
}

.archive-year h2 {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

.archive-list {
  border-top: 1px solid var(--line);
}

.archive-row {
  display: grid;
  grid-template-columns: 92px 1fr max-content;
  gap: 16px;
  align-items: baseline;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.archive-row:hover .archive-title {
  color: var(--coral);
}

.archive-date {
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.archive-title {
  font-size: 0.92rem;
}

.archive-row .tags {
  display: flex;
  gap: 6px;
}

/* ---------- archive post detail ---------- */

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.post-date {
  font-size: 0.85rem;
  color: var(--ink-faint);
}

article.post-body h1 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
  margin: 10px 0 28px;
  line-height: 1.5;
}

.entry-content {
  font-size: 0.98rem;
  color: var(--ink-dim);
}

.entry-content p {
  margin-bottom: 18px;
}

.entry-content img {
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: 6px 0;
  max-width: 100%;
  height: auto;
}

.entry-content.has-zoom img {
  cursor: zoom-in;
}

/* Photo grid roles for work detail pages. Each role is a fixed module --
   a set width AND a set aspect ratio, cropped with object-fit so every
   tile in the same role is identically shaped, not just capped in width.
   lg = main/hero subject, md = standard supporting photo,
   sm = detail/closeup, used standalone or in a .photo-row grid. */
.entry-content .photo-lg {
  max-width: 640px;
}

.entry-content .photo-md {
  max-width: 440px;
}

.entry-content .photo-sm {
  max-width: 320px;
}

.entry-content .photo-lg img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.entry-content .photo-md img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.entry-content .photo-sm img,
.photo-row img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.entry-content figure.no-crop img {
  aspect-ratio: auto;
  object-fit: contain;
}

.entry-content figure {
  margin: 6px 0 18px;
}

.entry-content figure img {
  width: 100%;
  margin: 0 0 8px;
  display: block;
}

.entry-content figcaption {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 6px 0 18px;
}

.photo-row figure {
  flex: 1 1 180px;
  max-width: 260px;
  margin: 0;
}

.photo-row img {
  width: 100%;
}

.video-embed {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  margin: 6px 0 18px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 14, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 1000;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lightbox-overlay.is-open {
  opacity: 1;
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  transform: scale(0.85);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-overlay.is-open img {
  transform: scale(1);
}

.shock-flash {
  position: fixed;
  inset: 0;
  background: #fbe200;
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  animation: shock-flash-twice 0.45s ease-out;
}

@keyframes shock-flash-twice {
  0% { opacity: 1; }
  35% { opacity: 0; }
  45% { opacity: 1; }
  100% { opacity: 0; }
}

.tekuneko-drop {
  position: fixed;
  top: -60px;
  z-index: 500;
  pointer-events: none;
  animation-name: tekuneko-fall;
  animation-timing-function: linear;
  animation-fill-mode: both;
}

@keyframes tekuneko-fall {
  0% {
    transform: translate(0, 0) rotate(var(--rot-start)) scaleX(var(--flip, 1));
    opacity: 0;
  }
  2% { opacity: 1; }
  80% { opacity: 1; }
  100% {
    transform: translate(var(--drift), var(--fall-y)) rotate(var(--rot-end)) scaleX(var(--flip, 1));
    opacity: 0;
  }
}

.entry-content a {
  color: var(--coral);
}

.entry-content div {
  margin-bottom: 4px;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.post-nav a {
  max-width: 45%;
}

.post-nav .to-index {
  text-align: center;
  flex: 1;
}

/* ---------- footer ---------- */

.site-footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

.site-footer .container-wide {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer p {
  color: var(--ink-faint);
  font-size: 0.8rem;
}

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

.footer-links a {
  color: var(--ink-faint);
  font-size: 0.8rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--coral);
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-1);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 16px;
    transform: translateY(-130%);
    transition: transform 0.25s ease;
    z-index: 90;
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-toggle {
    display: flex;
  }

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

  .book-row {
    flex-direction: column;
  }

  .book-cover {
    width: 110px;
  }

  .media-row,
  .archive-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .milestone-list li {
    grid-template-columns: 70px 1fr;
  }

  .member-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
