:root {
  --bg: #f5f2ee;
  --paper: #ffffff;
  --ink: #1d1b1f;
  --ink-2: #5d5862;
  --line: #e2ddd6;
  --accent: #e2366f;
  --accent-soft: #fde4ec;
  --radius: 14px;
  --gutter: 16px;
  --font: "Zen Kaku Gothic New", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --font-en: "Outfit", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
body.locked { overflow: hidden; }

/* ヘッダー */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.bar.scrolled { border-bottom-color: var(--line); }
.logo { font-family: var(--font-en); font-weight: 800; font-size: 18px; letter-spacing: -.02em; text-decoration: none; }
.logo span { font-weight: 400; color: var(--accent); }
.nav { display: flex; gap: 18px; }
.nav a { font-family: var(--font-en); font-weight: 600; font-size: 14px; text-decoration: none; }

/* ヒーロー */
.hero { padding: 40px var(--gutter) 48px; max-width: 1120px; margin: 0 auto; }
.hero-kicker { margin: 0 0 12px; font-family: var(--font-en); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.hero-title {
  margin: 0; font-family: var(--font-en); font-weight: 800;
  font-size: clamp(44px, 13vw, 120px); line-height: .95; letter-spacing: -.04em;
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-catch { margin: 20px 0 0; font-size: 17px; font-weight: 700; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 32px 0 0; }
.hero-stats div { background: var(--paper); border-radius: var(--radius); padding: 12px; }
.hero-stats dt { font-family: var(--font-en); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.hero-stats dd { margin: 2px 0 0; font-family: var(--font-en); font-weight: 600; font-size: 14px; line-height: 1.3; }

/* セクション見出し */
.sec-title { margin: 0; font-family: var(--font-en); font-weight: 800; font-size: 36px; letter-spacing: -.03em; line-height: 1.1; }
.sec-title span { font-family: var(--font); font-size: 14px; font-weight: 700; letter-spacing: 0; color: var(--ink-2); margin-left: 6px; }
.sec-note { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }

/* 作品 */
.works { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter) 64px; }
.filters {
  position: sticky; top: 52px; z-index: 10;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 20px calc(var(--gutter) * -1) 8px; padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--paper);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.timeline { position: relative; }
.era { position: relative; padding: 24px 0 8px 22px; }
.era::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.era::after {
  content: ""; position: absolute; left: 0; top: 33px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg);
}
.era[hidden] { display: none; }
.era-years { display: block; font-family: var(--font-en); font-weight: 800; font-size: 28px; letter-spacing: -.02em; line-height: 1.2; }
.era-name { margin: 2px 0 0; font-size: 18px; font-weight: 700; line-height: 1.4; }
.era-years { font-size: 22px; }
.era-role { margin: 2px 0 0; font-size: 13px; font-weight: 500; color: var(--accent); line-height: 1.5; }
.era-points { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.era-points li { position: relative; padding-left: 12px; margin-top: 3px; }
.era-points li::before { content: ""; position: absolute; left: 0; top: .7em; width: 5px; height: 1px; background: currentColor; }
.era-link { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--accent); }
.era-text .era-years { color: var(--ink-2); }
.era-text::after { background: var(--paper); box-shadow: 0 0 0 2px var(--line), 0 0 0 5px var(--bg); }

.grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid li[hidden] { display: none; }
.card {
  display: block; height: 100%; text-decoration: none; background: var(--paper);
  border-radius: var(--radius); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease;
}
a.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(40, 20, 30, .08); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.card-meta { padding: 8px 12px 12px; border-top: 1px solid #f0ece7; }
.card-year { font-family: var(--font-en); font-size: 12px; font-weight: 600; color: var(--accent); }
.card-title { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.45; }
.card-tags { margin: 4px 0 0; font-family: var(--font-en); font-size: 10.5px; letter-spacing: .03em; color: var(--ink-2); line-height: 1.5; }

/* About */
.about { max-width: 1120px; margin: 0 auto; padding: 48px var(--gutter) 64px; border-top: 1px solid var(--line); }
.about-body { display: grid; gap: 24px; margin-top: 20px; }
.about-name { margin: 0; font-size: 22px; font-weight: 700; }
.about-name small { font-size: 13px; font-weight: 400; color: var(--ink-2); margin-left: 8px; }
.about-role { margin: 0; font-family: var(--font-en); font-weight: 600; color: var(--ink-2); }
.about-catch { margin: 16px 0 0; font-size: 18px; font-weight: 700; }
.about-text p { margin: 12px 0 0; }
.about-h { margin: 28px 0 8px; font-family: var(--font-en); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.strengths { margin: 0; display: grid; gap: 8px; }
.strengths div { background: var(--paper); border-radius: var(--radius); padding: 12px 14px; }
.strengths dt { font-weight: 700; }
.strengths dd { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.tools { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.tools li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 10px 14px; background: var(--paper); }
.tools span { font-family: var(--font-en); font-weight: 600; }
.tools b { font-weight: 700; color: var(--accent); }
.tools small { grid-column: 1 / -1; font-size: 12px; color: var(--ink-2); }
.license { margin: 16px 0 0; font-size: 14px; }

.foot { display: flex; justify-content: space-between; padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom)); font-family: var(--font-en); font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); }
.foot p { margin: 0; }
.foot a { text-decoration: none; }

/* 作品詳細（全画面シート） */
.detail {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0; border: 0;
  background: var(--bg); color: var(--ink); overflow-y: auto; overscroll-behavior: contain;
}
.detail::backdrop { background: rgba(20, 15, 20, .5); }
.detail[open] { animation: rise .28s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.d-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px;
  padding: 10px var(--gutter); background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.d-close { border: 0; background: var(--ink); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; cursor: pointer; flex: none; }
.d-crumb { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-body:focus { outline: none; }
.d-body { max-width: 860px; margin: 0 auto; padding: 24px var(--gutter) 8px; }
.d-years { font-family: var(--font-en); font-weight: 800; font-size: 15px; color: var(--accent); }
.d-title { margin: 2px 0 0; font-size: 26px; line-height: 1.35; font-weight: 700; }
.d-client { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 12px 0 0; }
.d-tags li { font-family: var(--font-en); font-size: 11px; font-weight: 600; letter-spacing: .03em; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.d-lead { margin: 20px 0 0; padding: 16px; background: var(--paper); border-radius: var(--radius); font-size: 14.5px; }
.d-lead p, .d-sec p { margin: 0 0 .8em; }
.d-lead p:last-child, .d-sec p:last-child { margin-bottom: 0; }
.d-sec { margin: 32px 0 0; }
.d-sec figure { margin: 0; background: var(--paper); border-radius: var(--radius); overflow: hidden; }
.d-sec figure img { width: 100%; }
.d-sec h3 { margin: 14px 0 6px; font-size: 17px; line-height: 1.5; }
.d-sec h3::before { content: ""; display: inline-block; width: 10px; height: 2px; background: var(--accent); vertical-align: middle; margin-right: 8px; }
.d-sec figure + p { margin-top: 12px; }
.gal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.gal a { display: block; background: var(--paper); border-radius: 10px; overflow: hidden; }
.gal img { width: 100%; aspect-ratio: var(--ratio); object-fit: contain; }
.gal-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-2); }
@media (min-width: 640px) { .gal { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
.d-empty { margin: 24px 0 0; color: var(--ink-2); font-size: 14px; }
.d-pager { max-width: 860px; margin: 0 auto; padding: 32px var(--gutter) calc(32px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d-pager a { display: block; padding: 12px; background: var(--paper); border-radius: var(--radius); text-decoration: none; font-size: 13px; line-height: 1.5; }
.d-pager a small { display: block; font-family: var(--font-en); font-size: 11px; color: var(--ink-2); }
.d-pager .next { text-align: right; grid-column: 2; }

@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .about-body { max-width: 720px; }
}
@media (min-width: 960px) {
  .hero { padding-top: 72px; padding-bottom: 80px; }
  .hero-stats { max-width: 560px; }
  .era { display: grid; grid-template-columns: 240px 1fr; gap: 32px; padding-left: 28px; padding-top: 40px; }
  .era::after { top: 50px; }
  .era-head { position: sticky; top: 120px; align-self: start; }
  .era-years { font-size: 34px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
  .detail { width: min(920px, 100% - 64px); height: calc(100% - 48px); margin: 24px auto; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .detail[open] { animation: none; }
  .card { transition: none; }
}
