:root {
  --bg: #f7f5f0;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #fffdfa;
  --text: #3f4448;
  --muted: #7c858b;
  --line: rgba(92, 98, 102, 0.14);
  --accent: #8ea8b7;
  --accent-dark: #6f8998;
  --sage: #b8c9bc;
  --cream: #ebe3d5;
  --shadow: 0 24px 70px rgba(70, 75, 80, 0.11);
  --soft-shadow: 0 14px 34px rgba(70, 75, 80, 0.10);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  line-height: 1.8;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.96) 0 8%, transparent 23%),
    radial-gradient(circle at 82% 9%, rgba(219, 228, 231, 0.72) 0 9%, transparent 28%),
    radial-gradient(circle at 78% 76%, rgba(232, 225, 211, 0.7) 0 10%, transparent 31%),
    linear-gradient(135deg, #f7f5f0 0%, #eef1ef 46%, #f8f7f3 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -2;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(2px);
}

body::before {
  width: 520px;
  height: 520px;
  left: -150px;
  bottom: -180px;
  background: radial-gradient(circle, rgba(255,255,255,.96) 0 30%, rgba(241,237,229,.62) 31% 55%, transparent 56%);
}

body::after {
  width: 640px;
  height: 420px;
  right: -160px;
  top: 90px;
  background: radial-gradient(circle, rgba(255,255,255,.86) 0 26%, rgba(220,229,231,.55) 27% 50%, transparent 51%);
}

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

img {
  max-width: 100%;
}

.container {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  padding: 24px 0 10px;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 16px 26px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.logo {
  display: grid;
  gap: 1px;
  letter-spacing: .24em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  color: #59626a;
  white-space: nowrap;
}

.logo span {
  font-family: "Noto Sans JP", system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: Georgia, "Times New Roman", serif;
  color: #5f666b;
}

.nav-links a {
  padding: 8px 18px;
  border-radius: 999px;
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.nav-links a:hover,
.nav-links a.is-current {
  background: rgba(255,255,255,.82);
  box-shadow: 0 10px 26px rgba(78, 86, 92, .10);
  transform: translateY(-1px);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: #64717a;
  box-shadow: 0 9px 22px rgba(70, 75, 80, 0.10);
  font-size: 13px;
}

.hero {
  position: relative;
  min-height: 430px;
  display: grid;
  grid-template-columns: 1fr .9fr;
  gap: 40px;
  align-items: center;
  padding: 68px 0 52px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero h1 {
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-weight: 400;
  font-size: clamp(38px, 5vw, 66px);
  line-height: 1.35;
  letter-spacing: .09em;
}

.lead {
  margin: 0 0 28px;
  color: #657078;
  font-size: 15px;
}

.featured-works {
  margin-bottom: 34px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}

.section-kicker {
  margin: 0;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

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

.featured-card {
  display: flex;
  min-height: 218px;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .84);
  border-radius: 22px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 18px 46px rgba(96, 100, 94, .12);
  color: inherit;
  text-decoration: none;
  transition: transform .24s ease, box-shadow .24s ease;
}

.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 56px rgba(96, 100, 94, .16);
}

.featured-number {
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.featured-card h3 {
  margin: 0;
  color: #2f3638;
  font-size: 20px;
}

.featured-card p {
  margin: 0;
  color: #59626a;
  font-size: 14px;
  line-height: 1.75;
}

.featured-result {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(91, 107, 94, .18);
  color: #44504a;
  font-size: 13px;
  line-height: 1.7;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 172px;
  padding: 13px 24px;
  border: none;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 16px 26px rgba(91, 118, 134, .25);
  font-weight: 700;
  letter-spacing: .04em;
}

.button.secondary {
  min-width: auto;
  padding: 10px 18px;
  color: #5f6d74;
  background: rgba(255,255,255,.82);
  box-shadow: 0 10px 24px rgba(60, 65, 69, .09);
}

.tech-visual {
  position: relative;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-window {
  width: 380px;
  height: 240px;
  background: #282c34;
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.1);
  overflow: hidden;
  position: relative;
  z-index: 2;
  transform: perspective(800px) rotateY(-8deg) rotateX(4deg);
  transition: transform 0.4s ease;
}

.editor-window:hover {
  transform: perspective(800px) rotateY(0deg) rotateX(0deg);
}

.editor-header {
  height: 30px;
  background: #1e2227;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
}

.editor-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.editor-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.code-line {
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
}

.code-line.w-long { width: 80%; background: #c678dd; }
.code-line.w-med { width: 60%; background: #98c379; }
.code-line.w-short { width: 40%; background: #e5c07b; }
.code-line.indent { margin-left: 20px; }

.floating-element {
  position: absolute;
  font-family: monospace;
  font-weight: bold;
  color: var(--accent);
  opacity: 0.8;
  z-index: 1;
  text-shadow: 0 10px 20px rgba(0,0,0,0.05);
  animation: float 6s ease-in-out infinite;
}

.floating-element.gear {
  top: 40px;
  right: 60px;
  font-size: 64px;
  animation-delay: -2s;
}

.floating-element.brackets {
  bottom: 60px;
  left: 40px;
  color: var(--accent-dark);
  font-size: 72px;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.panel {
  position: relative;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.split-panel {
  display: grid;
  grid-template-columns: .92fr 1.6fr;
  gap: 34px;
  padding: 30px 32px;
}

.section-title {
  margin: 0 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: .03em;
}

.section-title::after {
  content: "";
  display: block;
  width: 30px;
  height: 1px;
  margin-top: 7px;
  background: #59636a;
  box-shadow: 14px 0 0 -4px #59636a;
}

.body-text {
  margin: 0 0 24px;
  font-size: 13px;
  color: #626b71;
}

.works-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 12px;
}

.text-link {
  color: #697c88;
  font-size: 13px;
  white-space: nowrap;
}

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

.work-card {
  display: block;
  min-height: 248px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 22px;
  background: rgba(255,255,255,.74);
  box-shadow: 0 10px 26px rgba(78, 86, 92, .09);
  transition: transform .2s ease, box-shadow .2s ease;
}

.work-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(78, 86, 92, .13);
}

.thumb {
  height: 112px;
  border-radius: 16px;
  margin-bottom: 13px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.95) 0 12%, transparent 13%),
    radial-gradient(circle at 78% 74%, rgba(198,212,203,.55) 0 14%, transparent 15%),
    linear-gradient(135deg, #f6f2eb, #e8e7e2);
}

.thumb.experimental {
  background:
    radial-gradient(circle at 30% 36%, rgba(255,255,255,.95) 0 13%, transparent 14%),
    linear-gradient(135deg, #eef3f0, #dce9e0 48%, #f7f4ec);
}

.thumb.tools {
  background:
    linear-gradient(90deg, rgba(255,255,255,.72) 0 12%, transparent 12% 20%),
    radial-gradient(circle at 70% 30%, rgba(142,168,183,.38) 0 12%, transparent 13%),
    linear-gradient(135deg, #f7f7f3, #e4eaec);
}

.thumb.logic {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.88) 0 18%, transparent 19%),
    linear-gradient(45deg, rgba(139,159,148,.28) 0 25%, transparent 26% 50%, rgba(139,159,148,.24) 51% 75%, transparent 76%),
    #f2f0ea;
  background-size: auto, 32px 32px, auto;
}

.thumb.graphics {
  background:
    radial-gradient(circle at 22% 30%, rgba(142,168,183,.42) 0 11%, transparent 12%),
    radial-gradient(circle at 76% 67%, rgba(184,201,188,.5) 0 13%, transparent 14%),
    conic-gradient(from 40deg, #f9f7f2, #e9eee9, #f2ece1, #f9f7f2);
}

.work-card h3 {
  margin: 0 0 3px;
  font-size: 14px;
  line-height: 1.45;
}

.work-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #6d7b83;
  background: rgba(225,233,235,.7);
  font-size: 11px;
  font-weight: 700;
}

.lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mini-panel {
  padding: 28px 32px;
  min-height: 210px;
}

/* Updated Skill List Styles */
.skill-list.full-width {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skill-tier-list {
  display: grid;
  gap: 14px;
}

.skill-tier {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  background: rgba(255, 255, 255, .54);
}

.skill-tier.primary {
  border-color: rgba(91, 107, 94, .28);
  background: rgba(245, 248, 244, .82);
}

.skill-tier h3 {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 14px;
}

.skill-tier p {
  margin: 0;
  color: #485057;
  font-size: 14px;
  line-height: 1.8;
}

.skill-group h3 {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.skill-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.skill-item {
  position: relative;
  display: inline-flex;
  cursor: help;
}

.skill-item img {
  height: 48px;
  transition: transform 0.2s ease;
}

/* Custom Tooltip */
.skill-item::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 8px 12px;
  background: rgba(63, 68, 72, 0.9);
  color: white;
  font-size: 10px;
  white-space: nowrap;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.skill-item:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Small arrow for tooltip */
.skill-item::before {
  content: "";
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(63, 68, 72, 0.9);
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 100;
}

.skill-item:hover::before {
  opacity: 1;
}

.skill-item:hover img {
  transform: translateY(-4px) scale(1.05);
}

.skill-badge-custom {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255,255,255,.7);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.contact-panel {
  overflow: hidden;
}

.contact-inner {
  position: relative;
  max-width: 58%;
  z-index: 2;
}

.contact-email {
  margin: -8px 0 18px;
  color: #5f6d74;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}

.contact-email a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.contact-actions .button {
  min-width: 144px;
  padding-inline: 18px;
}

.contact-art {
  position: absolute;
  right: 0;
  top: 0;
  width: 42%;
  height: 100%;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 74% 70%, #d8d0c3 0 13%, transparent 14%),
    linear-gradient(135deg, transparent 0 52%, rgba(235,227,213,.68) 53%),
    repeating-linear-gradient(18deg, rgba(255,255,255,.38) 0 8px, rgba(205,196,180,.12) 9px 14px),
    #f2eee7;
  opacity: .86;
}

.site-footer {
  margin: 10px auto 34px;
  padding: 16px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  color: #7a8288;
  font-size: 12px;
  box-shadow: var(--soft-shadow);
}

.footer-logo {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: .22em;
  color: #68737a;
  font-size: 15px;
}

.socials {
  display: flex;
  gap: 18px;
  color: #7d868d;
}

.subpage-main {
  padding: 58px 0 42px;
}

.page-hero {
  min-height: 330px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 64px 32px;
}

.page-kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 12px;
}

.page-title {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-weight: 400;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.25;
}

.page-description {
  max-width: 620px;
  margin: 0 auto;
  color: #667078;
  font-size: 14px;
}

.empty-section {
  margin-top: 18px;
  padding: 48px 34px;
}

.empty-box {
  min-height: 360px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(96, 105, 111, .22);
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.9) 0 12%, transparent 13%),
    radial-gradient(circle at 82% 80%, rgba(222,230,226,.52) 0 13%, transparent 14%),
    rgba(255,255,255,.42);
  color: #8a9399;
  text-align: center;
}

.empty-box strong {
  display: block;
  color: #5f686e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 8px;
}

.project-detail {
  margin-bottom: 60px;
  padding: 48px;
  background: var(--panel-solid);
  border-radius: var(--radius-lg);
  box-shadow: var(--soft-shadow);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.project-detail::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--sage));
  border-radius: 6px 0 0 6px;
}

.project-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 12px;
}

.project-title-row h2 {
  margin: 0;
  font-size: 32px;
  font-family: Georgia, serif;
  letter-spacing: 0.02em;
  color: #313538;
}

.project-overview {
  margin: 0 0 28px;
  padding: 20px 24px;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: rgba(255, 255, 255, 0.58);
  color: #3f474d;
  font-size: 15px;
  line-height: 1.9;
}

.project-outcome {
  margin: -10px 0 32px;
  padding: 14px 18px;
  border: 1px solid rgba(91, 107, 94, .2);
  border-radius: var(--radius-sm);
  background: rgba(247, 249, 246, .72);
  color: #404a44;
  font-size: 14px;
  line-height: 1.8;
}

.project-outcome strong {
  color: var(--accent-dark);
}

.repo-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 20px;
}

.metric-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(142, 168, 183, 0.1);
  color: #5c6b73;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(142, 168, 183, 0.2);
}

.metric-tag i {
  margin-right: 6px;
  font-style: normal;
}

.github-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: #24292e;
  color: white;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(36, 41, 46, 0.2);
}

.github-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(36, 41, 46, 0.3);
}

.tech-stack {
  font-size: 14px;
  color: var(--accent-dark);
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(142, 168, 183, 0.3);
}

.project-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.project-desc h3 {
  font-size: 20px;
  margin-bottom: 16px;
  color: #2c3135;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  line-height: 1.2;
}

.project-desc p {
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.9;
  color: #4a5156;
}

.tech-highlights {
  list-style: none;
  padding: 0;
  margin: 0 0 30px 0;
}

.tech-highlights li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.8;
  color: #4a5156;
}

.tech-highlights li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 2px;
  color: var(--sage);
  font-weight: bold;
  font-size: 16px;
}

.tech-highlights strong {
  color: #2c3135;
  font-weight: 700;
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.architecture-box {
  background: rgba(247, 245, 240, 0.8);
  border: 1px dashed rgba(184, 201, 188, 0.8);
  padding: 24px 30px;
  border-radius: var(--radius-md);
  margin-bottom: 30px;
}

.architecture-box h4 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.architecture-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
}

.project-insight {
  background: linear-gradient(135deg, rgba(142, 168, 183, 0.08), rgba(184, 201, 188, 0.15));
  padding: 30px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--sage);
  position: relative;
}

.project-insight::before {
  content: '"';
  position: absolute;
  top: 10px;
  right: 24px;
  font-size: 60px;
  font-family: Georgia, serif;
  color: rgba(142, 168, 183, 0.15);
  line-height: 1;
}

.project-insight h4 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.project-insight p {
  font-size: 14px;
  font-style: normal;
  line-height: 1.8;
  color: #434a4e;
  margin: 0;
}

@media (max-width: 850px) {
  .project-detail {
    padding: 30px 24px;
  }
}


.annotation-box {
  padding: 24px 32px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
}

.annotation-text {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}

.annotation-text strong {
  color: #5f686e;
  font-size: 12px;
}

@media (max-width: 980px) {
  .navbar {
    align-items: flex-start;
    border-radius: 28px;
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 44px;
  }

  .fluffy-visual {
    min-height: 260px;
  }

  .split-panel,
  .lower-grid {
    grid-template-columns: 1fr;
  }

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

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

  .contact-inner {
    max-width: 100%;
  }

  .contact-art {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 28px, var(--max));
  }

  .site-header {
    padding-top: 14px;
  }

  .navbar {
    padding: 18px;
  }

  .header-cta {
    width: 100%;
    justify-content: center;
  }

  .hero h1 {
    letter-spacing: .04em;
  }

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

  .section-heading {
    display: block;
  }

  .featured-card {
    min-height: auto;
  }

  .split-panel,
  .mini-panel,
  .empty-section {
    padding: 24px 20px;
  }

  .site-footer {
    border-radius: 26px;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   詳細ページ専用スタイル（リデザイン版）
   ============================================ */

/* ---- パンくずリスト ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.breadcrumb a {
  color: var(--accent-dark);
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb-sep {
  opacity: 0.45;
  font-size: 10px;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

/* ---- ヒーロー（詳細ページ用・2カラム） ---- */
.detail-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  min-height: 260px;
  padding: 48px 52px;
}

.detail-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-hero-visual {
  position: relative;
  height: 220px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 30%, rgba(255,255,255,.9) 0 14%, transparent 15%),
    linear-gradient(135deg, #edf1ef, #e8e3d8);
  box-shadow: 0 16px 40px rgba(70,75,80,.12);
}

.detail-hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-hero-visual .visual-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 13px;
  color: #9aa3a8;
  letter-spacing: 0.08em;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 18px,
      rgba(142,168,183,.08) 18px,
      rgba(142,168,183,.08) 19px
    ),
    linear-gradient(135deg, #f0ede8, #e8edf0);
}

/* ---- スタッツカード行 ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0 0 32px;
}

.stat-card {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 6px 18px rgba(70,75,80,.07);
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(70,75,80,.12);
}

.stat-card-value {
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--accent-dark);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ---- プロジェクト画像ギャラリー ---- */
.project-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 28px 0;
}

.project-gallery.single {
  grid-template-columns: 1fr;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, #edf1ef, #e8e3d8);
  aspect-ratio: 16 / 9;
  box-shadow: 0 8px 24px rgba(70,75,80,.10);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform .4s cubic-bezier(.25,.46,.45,.94),
              filter .4s ease;
}

.gallery-item:hover img {
  transform: scale(1.06);
  filter: brightness(1.04);
}

/* ホバー時のズームアイコンオーバーレイ */
.gallery-item::after {
  content: '⤢';
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.82);
  color: #3a4550;
  font-size: 15px;
  font-style: normal;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  opacity: 0;
  transform: scale(.7) translateY(-4px);
  transition: opacity .25s ease, transform .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
  z-index: 2;
}

.gallery-item:hover::after {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ============================================
   ライトボックス（画像拡大モーダル）
   ============================================ */

#lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10, 12, 16, 0);
  backdrop-filter: blur(0px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  transition: background .3s ease, backdrop-filter .3s ease;
}

#lb-overlay.lb-active {
  display: flex;
  background: rgba(10, 12, 16, .88);
  backdrop-filter: blur(12px);
  animation: lb-fade-in .25s ease both;
}

@keyframes lb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#lb-img {
  display: block;
  max-width: min(92vw, 1300px);
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 32px 80px rgba(0,0,0,.55);
  object-fit: contain;
  animation: lb-scale-in .3s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes lb-scale-in {
  from { transform: scale(.88); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

#lb-caption {
  margin: 0;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-align: center;
  max-width: 80vw;
}

#lb-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: rgba(255,255,255,.9);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, transform .2s ease;
  backdrop-filter: blur(8px);
  z-index: 9001;
}

#lb-close:hover {
  background: rgba(255,255,255,.26);
  transform: scale(1.1);
}

.gallery-item .gallery-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #9aa3a8;
  letter-spacing: 0.06em;
  font-family: Georgia, serif;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 16px,
      rgba(142,168,183,.07) 16px,
      rgba(142,168,183,.07) 17px
    ),
    linear-gradient(135deg, #f0ede8, #e8edf0);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  font-size: 11px;
  color: rgba(255,255,255,.9);
  background: linear-gradient(to top, rgba(40,44,48,.55), transparent);
  letter-spacing: 0.04em;
}

/* ---- ハイライトカード（feature cards） ---- */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 0 0 30px;
}

.feature-card {
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: 0 6px 18px rgba(70,75,80,.07);
  transition: transform .2s ease, box-shadow .2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(70,75,80,.11);
}

.feature-card-icon {
  font-size: 22px;
  margin-bottom: 10px;
  line-height: 1;
}

.feature-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #2c3135;
  margin-bottom: 6px;
  line-height: 1.3;
}

.feature-card-body {
  font-size: 13px;
  color: #4a5156;
  line-height: 1.75;
  margin: 0;
}

/* ---- プロジェクト詳細セクション（新レイアウト） ---- */
.project-section-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---- 区切り線 ---- */
.project-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 48px 0;
}

/* ---- プロジェクト番号バッジ ---- */
.project-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--sage));
  color: white;
  font-size: 12px;
  font-weight: 700;
  font-family: Georgia, serif;
  flex-shrink: 0;
}

/* ---- tech-stack バッジ化 ---- */
.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(142, 168, 183, 0.2);
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(142, 168, 183, 0.12);
  border: 1px solid rgba(142, 168, 183, 0.28);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-dark);
  letter-spacing: 0.03em;
}

/* ---- Works詳細ページの読書導線 ---- */
.work-reading-nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 12px 32px rgba(70,75,80,.10);
  backdrop-filter: blur(18px);
}

.work-reading-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 999px;
  color: #59646b;
  background: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: inset 0 0 0 1px rgba(142,168,183,.14);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.work-reading-nav a:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 24px rgba(78,86,92,.12);
}

.work-reading-nav span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--sage));
  font-family: Georgia, serif;
  font-size: 11px;
}

.work-after-nav {
  display: block;
  margin-top: 56px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 10% 12%, rgba(255,255,255,.86) 0 14%, transparent 15%),
    linear-gradient(135deg, rgba(238,243,240,.88), rgba(255,253,250,.9));
  border: 1px solid rgba(142,168,183,.18);
  box-shadow: 0 16px 40px rgba(70,75,80,.09);
}

.work-after-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.after-card {
  position: relative;
  display: flex;
  min-height: 86px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  color: #3f484d;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.86);
  box-shadow: 0 8px 22px rgba(70,75,80,.08);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.after-card::after {
  content: "→";
  position: absolute;
  right: 18px;
  top: 18px;
  color: var(--accent-dark);
  font-size: 16px;
}

.after-card span {
  color: var(--accent-dark);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.after-card:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,.94);
  box-shadow: 0 14px 30px rgba(70,75,80,.13);
}

.after-card.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: rgba(255,255,255,.34);
  box-shadow: 0 16px 30px rgba(91,118,134,.22);
}

.after-card.primary span,
.after-card.primary::after {
  color: rgba(255,255,255,.86);
}

/* ---- レスポンシブ対応 ---- */
@media (max-width: 768px) {
  .detail-hero {
    grid-template-columns: 1fr;
    padding: 32px 28px;
    gap: 24px;
  }

  .detail-hero-visual {
    height: 180px;
  }

  .project-gallery {
    grid-template-columns: 1fr;
  }

  .feature-cards {
    grid-template-columns: 1fr;
  }

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

  .project-section {
    padding: 28px 18px !important;
  }

  .project-detail {
    padding: 26px 18px;
  }

  .project-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-title-row h2 {
    font-size: clamp(24px, 8vw, 30px);
    line-height: 1.25;
  }

  .work-reading-nav {
    position: static;
    border-radius: var(--radius-md);
  }

  .work-reading-nav a {
    flex: 1 1 100%;
  }

  .work-after-nav {
    padding: 24px 20px;
  }

  .work-after-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   ダイアグラム画像専用スタイル
   （Mermaid生成PNGなど縦横比が固定でない図）
   ============================================ */

.gallery-item.diagram {
  aspect-ratio: auto;
  height: 320px;            /* 固定高さ — 2列並び時の縦ずれ防止 */
  background: #fff;
  overflow: hidden;         /* 固定高さに収める */
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(70,75,80,.10);
}

.gallery-item.diagram img {
  object-fit: contain;      /* クロップしない — 全体を表示 */
  width: 100%;
  flex: 1;                  /* キャプション以外の高さをすべて使う */
  min-height: 0;            /* flex子要素のオーバーフロー防止 */
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: zoom-in;
  transition: transform .4s cubic-bezier(.25,.46,.45,.94),
              filter .4s ease;
}

.gallery-item.diagram:hover img {
  transform: scale(1.02);
  filter: brightness(1.02);
}

/* ダイアグラム用キャプション：画像下に通常フロー配置 */
.gallery-item.diagram .gallery-caption {
  position: static;         /* absoluteを解除 */
  background: linear-gradient(to right, rgba(40,44,48,.06), transparent);
  color: #5a6470;
  padding: 7px 12px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  border-top: 1px solid rgba(142,168,183,.18);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ダイアグラム用ズームアイコン：imgの右上に重ねる */
.gallery-item.diagram::after {
  top: 10px;
  right: 12px;
}
