:root {
  --bg: #f6f5f1;
  --fg: #141414;
  --muted: #77746c;
  --line: #d9d6cd;
  --accent: #c8102e;
  --gutter: clamp(20px, 5vw, 72px);
  --font: "Helvetica Neue", Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

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

/* header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--gutter);
  mix-blend-mode: difference;
  color: #fff;
}
.logo { font-weight: 700; letter-spacing: 0.18em; font-size: 15px; }
.nav { display: flex; gap: clamp(14px, 3vw, 36px); font-size: 13px; letter-spacing: 0.12em; }
.nav a { position: relative; }
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .4s ease;
}
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* hero */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--gutter) 80px;
  position: relative;
}
.hero-kicker { margin: 0 0 24px; font-size: 13px; letter-spacing: 0.3em; color: var(--muted); text-transform: uppercase; }
.hero-title {
  margin: 0;
  font-size: clamp(56px, 15vw, 240px);
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: -0.03em;
  user-select: none;
}
.hero-title .line { display: block; white-space: nowrap; }
.hero-title .line + .line { padding-left: 0.9em; }
.char { display: inline-block; will-change: transform; cursor: pointer; }
.char-in {
  display: inline-block;
  transform-origin: 50% 70%;
  transition: color .25s ease, -webkit-text-stroke-color .25s ease;
}
.char:hover .char-in { color: var(--accent); }
.char-in.is-outline { color: transparent; -webkit-text-stroke: 2px var(--fg); }
.char-in.is-accent { color: var(--accent); }
.char-in.is-glitch { font-family: "Courier New", monospace; font-weight: 700; }

/* 登場 */
.char-in.intro { animation: m-intro 1.1s cubic-bezier(.2, .9, .25, 1.15) both; animation-delay: var(--d); }
@keyframes m-intro {
  0% { opacity: 0; transform: translateY(80%) rotate(var(--r)) scale(.6); filter: blur(8px); }
  100% { opacity: 1; transform: none; filter: none; }
}

/* ひと文字ずつの動き */
.char-in.m-flip   { animation: m-flip .9s cubic-bezier(.6, 0, .3, 1); }
.char-in.m-spin   { animation: m-spin 1s cubic-bezier(.6, 0, .3, 1); }
.char-in.m-jump   { animation: m-jump .8s cubic-bezier(.3, 0, .3, 1); }
.char-in.m-squash { animation: m-squash .8s ease; }
.char-in.m-tilt   { animation: m-tilt 1s ease; }
.char-in.m-wave   { animation: m-wave .7s ease both; animation-delay: var(--wd); }
@keyframes m-flip   { 0% { transform: none; } 100% { transform: rotateX(360deg); } }
@keyframes m-spin   { 0% { transform: none; } 100% { transform: rotate(360deg); } }
@keyframes m-jump   {
  0%, 100% { transform: none; }
  30% { transform: translateY(-38%) scaleY(1.08); }
  60% { transform: translateY(0) scale(1.12, .86); }
  80% { transform: translateY(-6%); }
}
@keyframes m-squash {
  0%, 100% { transform: none; }
  30% { transform: scale(1.35, .6); }
  60% { transform: scale(.85, 1.2); }
}
@keyframes m-tilt {
  0%, 100% { transform: none; }
  25% { transform: skewX(-18deg); }
  55% { transform: skewX(12deg); }
  80% { transform: skewX(-4deg); }
}
@keyframes m-wave {
  0%, 100% { transform: none; }
  40% { transform: translateY(-22%); color: var(--accent); }
}

.char-in.is-pick { color: var(--accent); }
.hero-word {
  margin: 28px 0 0;
  min-height: 1.4em;
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: 0.4em;
  color: var(--accent);
  opacity: 0;
  transition: opacity .4s ease;
}
.hero-word.is-on { opacity: 1; }
.hero-hint { margin: 12px 0 0; font-size: 12px; letter-spacing: 0.2em; color: var(--muted); }
.hero-lead { margin: 24px 0 0; max-width: 34em; color: var(--muted); font-size: 15px; }
.hero-scroll {
  position: absolute; left: var(--gutter); bottom: 32px;
  font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase;
  padding-left: 56px;
}
.hero-scroll::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 40px; height: 1px; background: var(--fg);
}

/* sections */
.section { padding: clamp(80px, 12vw, 160px) var(--gutter); border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: clamp(40px, 6vw, 80px); flex-wrap: wrap; }
.section-title { margin: 0; font-size: clamp(36px, 6vw, 80px); line-height: 1; font-weight: 700; letter-spacing: -0.01em; }
.section-note { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: 0.1em; }

/* works */
.works { list-style: none; margin: 0; padding: 0; }
.work {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  transition: padding .4s ease;
}
.work:first-child { border-top: 1px solid var(--line); }
.work:hover { padding-left: 16px; }
.work-no { font-size: 13px; color: var(--muted); letter-spacing: 0.1em; padding-top: 10px; }
.work-title { margin: 0 0 12px; font-size: clamp(22px, 3vw, 36px); line-height: 1.3; font-weight: 700; transition: color .3s ease; }
.work:hover .work-title { color: var(--accent); }
.work-ext { font-size: 0.6em; color: var(--muted); vertical-align: 0.2em; }
.work-desc { margin: 0 0 12px; max-width: 42em; }
.work-tags { margin: 0; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }

/* about */
.about { max-width: 44em; }
.about-lead { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.7; font-weight: 700; margin: 0 0 32px; }
.about p { margin: 0 0 20px; }
.likes { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; }
.likes dt { font-weight: 700; letter-spacing: 0.1em; }
.likes dd { margin: 0; color: var(--muted); }

/* skills */
.skills { margin: 0; }
.skill-row {
  display: grid; grid-template-columns: 120px 1fr; gap: 24px;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.skill-row:first-child { border-top: 1px solid var(--line); }
.skill-row dt { font-weight: 700; letter-spacing: 0.1em; }
.skill-row dd { margin: 0; color: var(--muted); }

/* links */
.links { list-style: none; margin: 0; padding: 0; }
.link-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding: 24px 0; border-bottom: 1px solid var(--line);
  transition: color .3s ease, padding .4s ease;
}
.links li:first-child .link-item { border-top: 1px solid var(--line); }
.link-item:hover { color: var(--accent); padding-left: 16px; }
.link-name { font-weight: 700; font-size: clamp(18px, 2vw, 24px); }
.link-url { color: var(--muted); font-size: 13px; letter-spacing: 0.06em; }

/* contact */
.contact { background: var(--fg); color: var(--bg); border-top: 0; }
.contact .section-title { margin-bottom: 32px; }
.contact-lead { margin: 0 0 40px; color: #aaa69c; }
.contact-link {
  display: inline-flex; gap: 16px; align-items: center;
  font-size: clamp(22px, 3.4vw, 44px); font-weight: 700;
  border-bottom: 2px solid currentColor; padding-bottom: 6px;
  transition: color .3s ease, gap .3s ease;
}
.contact-link:hover { color: var(--accent); gap: 28px; }

/* footer */
.site-footer { padding: 32px var(--gutter); background: var(--fg); color: #77746c; font-size: 12px; letter-spacing: 0.1em; }
.site-footer p { margin: 0; }

/* reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* hamburger（スマホだけ） */
.menu-btn {
  display: none;
  position: relative; z-index: 2;
  width: 36px; height: 36px; padding: 0;
  background: none; border: 0; color: inherit; cursor: pointer;
}
.menu-btn span {
  position: absolute; left: 6px; right: 6px; height: 2px; background: currentColor;
  transition: transform .35s ease, top .35s ease;
}
.menu-btn span:nth-child(1) { top: 13px; }
.menu-btn span:nth-child(2) { top: 21px; }
.site-header.is-open .menu-btn span:nth-child(1) { top: 17px; transform: rotate(45deg); }
.site-header.is-open .menu-btn span:nth-child(2) { top: 17px; transform: rotate(-45deg); }

@media (max-width: 640px) {
  .menu-btn { display: block; }
  .site-header.is-open { mix-blend-mode: normal; color: var(--bg); }
  .nav {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; justify-content: center; align-items: center; gap: 28px;
    background: var(--fg); color: var(--bg);
    font-size: 26px; font-weight: 700; letter-spacing: 0.14em;
    opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s;
  }
  .site-header.is-open .nav { opacity: 1; visibility: visible; }
  .nav a { opacity: 0; transform: translateY(12px); transition: opacity .4s ease, transform .4s ease; }
  .site-header.is-open .nav a { opacity: 1; transform: none; }
  .site-header.is-open .nav a:nth-child(2) { transition-delay: .05s; }
  .site-header.is-open .nav a:nth-child(3) { transition-delay: .1s; }
  .site-header.is-open .nav a:nth-child(4) { transition-delay: .15s; }
  .site-header.is-open .nav a:nth-child(5) { transition-delay: .2s; }
  .work { grid-template-columns: 1fr; gap: 4px; }
  .work-no { padding-top: 0; }
  .skill-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .work, .work-title, .contact-link, .nav a::after { transition: none; }
}
