:root {
  --bg:        #F7F6F3;
  --surface:   #FFFFFF;
  --border:    rgba(0,0,0,0.10);
  --border-md: rgba(0,0,0,0.18);
  --text:      #1A1A18;
  --muted:     #6B6B67;
  --hint:      #A8A8A4;
  --accent:    #1A1A18;
  --tag-bg:    #EDEDEA;
  --radius:    10px;
  --radius-lg: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ─── layout ─── */
.wrapper { max-width: 860px; margin: 0 auto; padding: 0 1.5rem; }

/* ─── nav ─── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247,246,243,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--border);
}
.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}
.nav-logo {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
}
.nav-links { display: flex; gap: 1.75rem; }
.nav-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

/* ─── hero ─── */
#hero {
  padding: 5rem 0 4rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: flex-start;
}
.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--hint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero-name {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(38px, 6vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}
.hero-name-ja {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 1.25rem;
  letter-spacing: 0.06em;
}
.hero-bio {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.75;
  max-width: 420px;
  margin-bottom: 1.75rem;
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── buttons ─── */
.btn {
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 0.5px solid var(--border-md);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: inline-block;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.02em;
}
.btn:hover { background: var(--tag-bg); }
.btn-solid {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-solid:hover { background: #333; border-color: #333; }

/* ─── avatar ─── */
.hero-avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--surface);
  border: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-size: 30px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ─── section commons ─── */
section { padding: 3rem 0; border-top: 0.5px solid var(--border); }
.sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
}
.sec-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--hint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sec-line { flex: 1; height: 0.5px; background: var(--border); }

/* ─── works ─── */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.work-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.work-card:hover { border-color: var(--border-md); transform: translateY(-2px); }
.work-thumb {
  height: 120px;
  background: var(--tag-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--hint);
  letter-spacing: 0.08em;
}
.work-body { padding: 14px 16px; }
.work-title { font-size: 14px; font-weight: 500; margin-bottom: 5px; }
.work-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; min-height: 2.4em; }
.work-footer { display: flex; flex-wrap: wrap; gap: 5px; }
.work-tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--muted);
}

/* add-card */
.work-card-add {
  background: transparent;
  border: 0.5px dashed var(--border-md);
  border-radius: var(--radius-lg);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--hint);
}
.work-card-add .plus { font-size: 22px; line-height: 1; }
.work-card-add .add-label { font-size: 12px; font-family: 'DM Mono', monospace; letter-spacing: 0.06em; }

/* ─── skills ─── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.skill-group {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.skill-group-label {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  color: var(--hint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.skill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-pill {
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--text);
}

/* ─── awards ─── */
.award-list { display: flex; flex-direction: column; gap: 10px; }
.award-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
}
.award-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tag-bg);
  border: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.award-name { font-size: 14px; font-weight: 500; }
.award-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ─── contact ─── */
.contact-box {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
}
.contact-title { font-family: 'DM Serif Display', serif; font-size: 26px; margin-bottom: 0.5rem; }
.contact-sub { font-size: 14px; color: var(--muted); margin-bottom: 1.5rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; }

/* ─── footer ─── */
footer {
  border-top: 0.5px solid var(--border);
  padding: 1.75rem 0;
  margin-top: 4rem;
}
.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-copy {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--hint);
}
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { font-size: 12px; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ─── modal ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.2s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
#modalThumb {
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
}
.modal-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.modal-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--hint);
}
.modal-body { padding: 1.5rem 1.75rem 1.75rem; }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.modal-title { font-size: 18px; font-weight: 500; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--hint);
  line-height: 1;
  padding: 2px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }
.modal-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1.5rem; }
.modal-period {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--hint);
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
.modal-footer { display: flex; gap: 10px; flex-wrap: wrap; }

/* workカードをクリック可能に */
.work-card { cursor: pointer; }

/* ─── career timeline ─── */
.timeline {
  position: relative;
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 0.5px;
  background: var(--border-md);
}
.tl-item {
  position: relative;
  padding-bottom: 2rem;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -25px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border-md);
  transition: border-color 0.2s;
}
.tl-item:hover .tl-dot { border-color: var(--text); }
/* 強調アイテム（コンテスト本選など） */
.tl-item.highlight .tl-dot {
  background: var(--text);
  border-color: var(--text);
}
.tl-year {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--hint);
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}
.tl-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}
.tl-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.tl-badge {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--muted);
  margin-top: 5px;
}

/* ─── page top button ─── */
.page-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 0.5px solid var(--border-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.15s, border-color 0.15s;
  z-index: 150;
  padding: 0;
}
.page-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.page-top:hover {
  background: var(--tag-bg);
  border-color: var(--border-md);
}
.page-top-triangle {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 9px solid var(--muted);
  transition: border-bottom-color 0.15s;
}
.page-top:hover .page-top-triangle { border-bottom-color: var(--text); }
.page-top-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.15s;
}
.page-top:hover .page-top-dot { background: var(--text); }

@media (max-width: 480px) {
  .page-top { bottom: 1.25rem; right: 1.25rem; }
}

/* ─── scroll reveal ─── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ─── ハンバーガーメニュー ─── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ─── タブレット (max-width: 768px) ─── */
@media (max-width: 768px) {
  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-overlay { padding: 1rem; }
  .modal-body { padding: 1.25rem 1.25rem 1.5rem; }
  #modalThumb { height: 150px; }

  .footer-inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

/* ─── スマホ (max-width: 480px) ─── */
@media (max-width: 480px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: rgba(247,246,243,0.97);
    backdrop-filter: blur(12px);
    border-bottom: 0.5px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 0.75rem 1.5rem;
    font-size: 14px;
  }

  #hero {
    grid-template-columns: 1fr;
    padding: 3rem 0 2.5rem;
    gap: 1.5rem;
  }
  .hero-avatar {
    width: 72px;
    height: 72px;
    font-size: 22px;
    order: -1;
  }
  .hero-name { font-size: clamp(30px, 8vw, 38px); }
  .hero-bio { max-width: 100%; font-size: 14px; }

  section { padding: 2.25rem 0; }

  .works-grid {
    grid-template-columns: 1fr;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .contact-box { padding: 1.5rem; }
  .contact-title { font-size: 22px; }

  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: modal-in-sp 0.25s ease;
  }
  @keyframes modal-in-sp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  #modalThumb {
    height: 130px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .modal-body { padding: 1rem 1.25rem 1.5rem; }
}