:root {
  --bg: #fbfbfd;
  --bg-section: #f2f1fa;
  --ink: #12131c;
  --ink-soft: #474b5c;
  --muted: #767b93;
  --line: #e6e5f0;
  --line-soft: #edecf6;
  --card: #ffffff;
  --accent: #1f4b4a;
  --accent-2: #c9a15a;
  --accent-soft: rgba(31, 75, 74, 0.08);
  --shadow-sm: 0 1px 2px rgba(18, 19, 28, 0.04), 0 8px 20px -14px rgba(18, 19, 28, 0.12);
  --shadow: 0 4px 10px rgba(31, 75, 74, 0.14), 0 26px 48px -18px rgba(31, 75, 74, 0.38);
  --radius: 14px;
  --radius-sm: 9px;
  --container: 1180px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  font-size: 15.5px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }

.serif { font-family: "Noto Serif", "Noto Serif JP", serif; }

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 clamp(20px, 3.4vw, 40px); }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  padding-top: 16px; padding-bottom: 16px;
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand .name { font-weight: 700; font-size: 17px; letter-spacing: 0.01em; white-space: nowrap; }
.brand .role { font-size: 10.5px; color: var(--muted); letter-spacing: 0.06em; white-space: nowrap; }

.nav { display: flex; gap: 4px 24px; margin-left: auto; font-size: 11px; letter-spacing: 0.1em; font-weight: 500; }
.nav a { color: var(--muted); transition: color .15s; }
.nav a:hover, .nav a.active { color: var(--accent); }

.lang-switch { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-section); }
.lang-switch button {
  min-width: 40px; height: 26px; padding: 0 12px; border: none; border-radius: 999px;
  font-size: 10.5px; letter-spacing: 0.04em; background: transparent; color: var(--muted);
  transition: background .18s, color .18s;
}
.lang-switch button.active { background: var(--ink); color: #fff; }

.nav-toggle { display: none; width: 36px; height: 36px; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--line); border-radius: 8px; }
.nav-toggle span, .nav-toggle::before, .nav-toggle::after { content: ""; display: block; width: 16px; height: 1px; background: var(--ink); position: relative; }
.nav-toggle::before { position: absolute; transform: translateY(-5px); }
.nav-toggle::after { position: absolute; transform: translateY(5px); }

/* sections */
main { padding: 0 clamp(20px, 3.4vw, 40px); max-width: var(--container); margin: 0 auto; }
section { padding: clamp(40px, 6vw, 76px) 0; border-top: 1px solid var(--line); }
#about { border-top: none; padding-top: clamp(36px, 5.5vw, 60px); }

.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: clamp(26px, 3.6vw, 40px); }
.sec-head .no { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 0.08em; }
.sec-head h2 { margin: 0; font-weight: 500; font-size: clamp(26px, 3.2vw, 38px); letter-spacing: -0.01em; }
.sec-head .rule { height: 1px; flex: 1; background: var(--line); }
.sec-head .hint { font-size: 10px; color: var(--muted); letter-spacing: 0.1em; white-space: nowrap; }

/* about / hero */
.kicker-row { display: flex; align-items: center; gap: 10px; margin-bottom: clamp(22px, 3vw, 32px); }
.kicker-row .dot { width: 6px; height: 6px; background: var(--accent); flex: 0 0 auto; border-radius: 50%; }
.kicker-row .txt { font-size: 10.5px; letter-spacing: 0.14em; color: var(--muted); font-weight: 500; }
.kicker-row .rule { height: 1px; flex: 1; background: var(--line); }

.hero { display: flex; flex-wrap: wrap; gap: clamp(28px, 3.6vw, 52px); }
.hero-main { flex: 1.3 1 440px; min-width: 0; }

.role-badge {
  display: inline-flex; align-items: center; height: 30px; padding: 0 14px; margin-bottom: 18px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em;
}

.hero-main h1 {
  margin: 0; font-weight: 400; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.06; letter-spacing: -0.015em; color: var(--ink);
}
.hero-main h1 em { font-style: normal; font-weight: 400; color: var(--ink); }
.kana { display: block; margin-top: 14px; font-size: clamp(17px, 2vw, 21px); letter-spacing: 0.32em; color: var(--ink-soft); font-weight: 500; }
.tagline { max-width: 42em; margin: 22px 0 0; font-size: 15.5px; line-height: 1.9; color: var(--ink-soft); text-wrap: pretty; }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; height: 46px; padding: 0 26px;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.08em; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); transition: border-color .15s, background .15s, color .15s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 10px 24px -12px rgba(31, 75, 74, 0.5); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn:not(.btn-primary):hover { border-color: var(--accent); color: var(--accent); }

.hero-side { flex: 1 1 420px; min-width: min(100%, 360px); }
.info-card {
  display: flex; flex-direction: column; gap: 20px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 24px; height: 100%;
}
.info-top { display: flex; gap: 22px; align-items: flex-start; }

.contact-block { padding-top: 18px; border-top: 1px solid var(--line-soft); }
.contact-block .label { font-size: 9px; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 10px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; }
.contact-links a, .contact-links span { color: var(--ink-soft); }
.contact-links a:hover { color: var(--accent); }
.portrait-box {
  flex: 0 0 144px; width: 144px; aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm); border: 1px solid var(--line); overflow: hidden;
  background: var(--bg-section);
}
.portrait-box img { width: 100%; height: 100%; object-fit: cover; }

.facts { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 18px; align-content: center; }
.fact-row { display: flex; flex-direction: column; gap: 6px; }
.fact-row .k { font-size: 9px; letter-spacing: 0.1em; color: var(--muted); }
.fact-row .v { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); text-wrap: pretty; }

/* career timeline */
.timeline-item { display: flex; gap: 4px clamp(20px, 3vw, 36px); padding: 22px 0; }
.timeline-item:first-child { padding-top: 4px; }
.timeline-marker { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; align-self: stretch; width: 12px; }
.timeline-marker .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline-marker::after { content: ""; flex: 1; width: 1px; background: var(--line); margin-top: 8px; }
.timeline-item:last-child .timeline-marker::after { display: none; }
.timeline-meta { flex: 0 0 auto; min-width: 128px; display: flex; flex-direction: column; gap: 4px; padding-top: 1px; }
.timeline-meta .period { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }
.timeline-meta .place { font-size: 9.5px; color: var(--muted); letter-spacing: 0.1em; }
.timeline-body { flex: 1 1 320px; min-width: 0; padding-bottom: 4px; }
.timeline-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.timeline-title .org { font-family: "Noto Serif", "Noto Serif JP", serif; font-size: 21px; font-weight: 500; letter-spacing: -0.008em; }
.timeline-title .role { font-size: 12px; color: var(--accent); font-weight: 500; }
.timeline-note { margin: 9px 0 0; font-size: 13.5px; line-height: 1.85; color: var(--ink-soft); max-width: 60em; text-wrap: pretty; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: 10px; letter-spacing: 0.04em; color: var(--ink-soft); background: var(--bg-section); padding: 5px 10px; border-radius: 999px; }

/* projects */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px;
}
.project-card {
  display: flex; flex-direction: column; text-align: left; padding: 0;
  background: var(--card); border: 1px solid transparent; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
/* 特异度需高于 .reveal，否则整条 transition 会被它覆盖 */
.project-grid .project-card {
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease, opacity .6s ease;
}
.project-grid .project-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); border-color: var(--accent); }
.shot-box {
  aspect-ratio: 16/10; border-radius: 0; position: relative;
  background: radial-gradient(130% 160% at 85% 0%, var(--accent-soft), transparent 60%),
              radial-gradient(120% 140% at 5% 100%, rgba(201, 161, 90, 0.14), transparent 55%),
              var(--bg-section);
  display: flex; flex-direction: column; justify-content: space-between; padding: 14px;
}
.shot-box .row-top { display: flex; justify-content: space-between; gap: 10px; font-size: 9.5px; letter-spacing: 0.1em; color: var(--muted); font-weight: 500; }
.shot-label { font-size: 9.5px; letter-spacing: 0.06em; color: var(--muted); white-space: pre-line; line-height: 1.6; }
.card-content { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.project-org { font-size: 10.5px; color: var(--accent); letter-spacing: 0.04em; font-weight: 600; margin-bottom: 2px; }
.project-title { font-family: "Noto Serif", "Noto Serif JP", serif; font-size: 21px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; text-wrap: pretty; }
.project-sub { margin: 8px 0 0; font-size: 13px; line-height: 1.75; color: var(--ink-soft); text-wrap: pretty; }
.stack-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.stack-chip { font-size: 10px; color: var(--ink-soft); background: var(--bg-section); padding: 5px 10px; border-radius: 999px; }
.card-more { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--ink); font-weight: 500; letter-spacing: 0.06em; margin-top: 16px; }
.card-more .arrow { color: var(--accent); transition: transform .3s ease; }
.project-card:hover .card-more .arrow { transform: translateX(3px); }

/* skills */
.skill-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px;
}
.skill-group { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px 22px; }
.skill-grid .skill-group { transition: box-shadow .25s ease, transform .25s ease, opacity .6s ease; }
.skill-grid .skill-group:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.skill-group .title { font-size: 10px; letter-spacing: 0.14em; color: var(--accent); font-weight: 700; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.skill-group .items { display: flex; flex-direction: column; gap: 7px; padding-top: 13px; }
.skill-group .item { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); }

/* blog */
.blog-section { background: var(--bg-section); }
.blog-post {
  display: flex; flex-wrap: wrap; gap: 6px clamp(18px, 3vw, 44px); width: 100%; text-align: left;
  padding: 18px 20px; border-radius: var(--radius-sm); border: none; background: transparent;
  color: var(--ink); font-size: 15.5px; line-height: 1.8;
  box-shadow: 0 1px 2px rgba(18, 19, 28, 0), 0 8px 20px -14px rgba(18, 19, 28, 0);
}
.blog-section .blog-post { transition: background .25s ease, transform .25s ease, box-shadow .25s ease, opacity .6s ease; }
.blog-section .blog-post:hover { background: var(--card); box-shadow: var(--shadow-sm); transform: translateY(-1px); color: var(--ink); }

.article-body { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 54em; }
.article-p { font-size: 15px; line-height: 1.95; color: var(--ink-soft); margin: 0 0 18px; text-wrap: pretty; }
.article-p:last-child { margin-bottom: 0; }
.blog-meta { flex: 0 0 auto; min-width: 130px; display: flex; gap: 10px; align-items: baseline; }
.blog-meta .date { font-size: 12px; color: var(--muted); }
.blog-meta .cat { font-size: 9.5px; letter-spacing: 0.1em; color: var(--accent); font-weight: 600; }
.blog-body { flex: 1 1 320px; min-width: 0; }
.blog-title { font-family: "Noto Serif", "Noto Serif JP", serif; font-size: 18px; font-weight: 500; line-height: 1.4; letter-spacing: -0.008em; text-wrap: pretty; }
.blog-excerpt { margin: 5px 0 0; font-size: 13px; line-height: 1.75; color: var(--ink-soft); max-width: 60em; text-wrap: pretty; }
.blog-read { flex: 0 0 auto; font-size: 10.5px; color: var(--muted); align-self: baseline; }

/* footer */
footer { background: var(--bg); color: var(--muted); padding: 0 0 clamp(30px, 4vw, 46px); }
footer .inner { padding: clamp(26px, 3.4vw, 38px) clamp(20px, 3.4vw, 40px) 0; border-top: 1px solid var(--line); max-width: var(--container); margin: 0 auto; }
footer .row { display: flex; flex-wrap: wrap; gap: 8px clamp(20px, 3vw, 40px); align-items: baseline; justify-content: space-between; font-size: 10.5px; letter-spacing: 0.06em; }
footer .row .left { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: baseline; }
footer .row .left .brand-name { color: var(--ink); font-weight: 600; }
footer .row a { color: var(--ink-soft); }
footer .row a:hover { color: var(--accent); }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 14, 26, 0.55);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vh, 48px) 16px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal-panel {
  width: 100%; max-width: 940px; max-height: 100%; background: var(--card);
  border-radius: 20px; overflow: hidden; position: relative;
  display: flex; flex-direction: column;
  transform: translateY(18px) scale(.98); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 30px 70px -20px rgba(15, 14, 26, 0.45);
}
.modal-backdrop.open .modal-panel { transform: translateY(0) scale(1); }
.modal-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.modal-head {
  position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 14px clamp(20px, 3vw, 32px); background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); z-index: 2;
}
.modal-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64px; border-radius: 0 0 20px 20px;
  background: linear-gradient(to bottom, transparent, var(--card) 78%);
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.modal-fade.visible { opacity: 1; }
.modal-head .meta { font-size: 10.5px; letter-spacing: 0.1em; color: var(--muted); font-weight: 500; }
.modal-close {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; color: var(--ink);
}
.modal-close:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.modal-body { padding: clamp(24px, 3.4vw, 38px) clamp(20px, 3.2vw, 32px) clamp(34px, 5vw, 54px); }
.modal-org { font-size: 10.5px; color: var(--accent); letter-spacing: 0.06em; font-weight: 700; }
.modal-title { margin: 10px 0 0; font-weight: 400; font-size: clamp(28px, 3.6vw, 42px); line-height: 1.15; letter-spacing: -0.015em; text-wrap: pretty; }
.modal-sub { margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.modal-summary { margin: 18px 0 0; font-size: 15px; line-height: 1.9; color: var(--ink-soft); max-width: 54em; text-wrap: pretty; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 22px; }
.metric-grid .cell { background: var(--bg-section); border-radius: var(--radius-sm); padding: 16px; }
.metric-grid .num { font-family: "Noto Serif", "Noto Serif JP", serif; font-weight: 500; font-size: clamp(24px, 2.9vw, 32px); line-height: 1; letter-spacing: -0.015em; color: var(--accent); }
.metric-grid .lbl { font-size: 11.5px; line-height: 1.5; color: var(--ink-soft); margin-top: 9px; }

.image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 22px; }
.image-cell {
  aspect-ratio: 16/10; border-radius: var(--radius-sm);
  background: radial-gradient(120% 140% at 20% 0%, var(--accent-soft), transparent 65%), var(--bg-section);
  display: flex; align-items: flex-end; padding: 12px;
}
.image-cell span { font-size: 9.5px; line-height: 1.5; letter-spacing: 0.04em; color: var(--muted); }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 26px clamp(24px, 3vw, 42px); margin-top: 28px; }
.detail-col .head { font-size: 9.5px; letter-spacing: 0.14em; color: var(--accent); font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.bullet-list { display: flex; flex-direction: column; gap: 10px; padding-top: 13px; }
.bullet-list .b { display: flex; gap: 10px; align-items: flex-start; }
.bullet-list .dot { flex: 0 0 auto; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin-top: 9px; }
.bullet-list .txt { font-size: 13.5px; line-height: 1.8; color: var(--ink-soft); text-wrap: pretty; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 13px; align-content: flex-start; }
.chip { font-size: 10.5px; color: var(--ink-soft); background: var(--bg-section); padding: 6px 12px; border-radius: 999px; }

/* reveal animation */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* floating scroll controls */
.scroll-nav {
  position: fixed; right: clamp(10px, 2.4vw, 30px); top: 50%; transform: translateY(-50%) translateX(6px);
  z-index: 70; display: flex; flex-direction: column; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.scroll-nav.visible { opacity: 1; pointer-events: auto; transform: translateY(-50%) translateX(0); }
.scroll-nav a {
  position: relative; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
}
.scroll-nav a::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--line); border: 1px solid transparent; transition: background .2s, transform .2s;
}
.scroll-nav a:hover::before, .scroll-nav a:active::before { transform: scale(1.3); background: var(--accent-soft); border-color: var(--accent); }
.scroll-nav a.active::before { background: var(--accent); transform: scale(1.3); }
.scroll-nav a .tip {
  position: absolute; right: 30px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-size: 10px; letter-spacing: 0.08em; font-weight: 500;
  color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; box-shadow: var(--shadow-sm); opacity: 0; pointer-events: none; transition: opacity .15s;
}
.scroll-nav a:hover .tip { opacity: 1; }

.back-to-top {
  position: fixed; right: clamp(14px, 2.4vw, 30px); bottom: 24px; z-index: 70;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 16px; box-shadow: var(--shadow-sm);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, background .2s, color .2s, border-color .2s;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

@media (max-width: 720px) {
  .scroll-nav { right: 6px; }
  .scroll-nav a .tip { display: none; }
  .back-to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }
}

/* responsive */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none; flex-direction: column; align-items: flex-start; gap: 14px;
    position: fixed; top: 65px; left: 0; right: 0; z-index: 55;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 18px clamp(20px, 3.4vw, 40px) 24px; margin: 0;
  }
  .nav.open { display: flex; }
  .nav a { font-size: 14px; }
  .lang-switch { margin-left: auto; }
}

@media (max-width: 480px) {
  .hero-side { flex-basis: 100%; }
  .facts { grid-template-columns: 1fr; }
  .info-card { padding: 20px; }
  .info-top { flex-direction: column; align-items: center; gap: 16px; }
  .portrait-box { width: 160px; flex: 0 0 160px; }
}
