:root {
  --bg: #0f1014;
  --bg-soft: #14161c;
  --panel: #101218;
  --text: #e8eaef;
  --muted: #8b909a;
  --line: rgb(255 255 255 / 7%);
  --line-strong: rgb(255 255 255 / 11%);
  --accent: #4346f5;
  --accent-soft: rgb(107 110 240 / 22%);
  --accent-2: #828afa;
  --max: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background-color: #0a0b0e;
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgb(60 64 120 / 12%), transparent 55%),
    linear-gradient(180deg, #08090c 0%, var(--bg) 38%, #12141c 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.7;
}

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

.container {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
}

.section {
  padding: 5rem 0;
  scroll-margin-top: 72px;
}

/* スクロール連動: フェードを長め・はっきり（透明度の変化が主役） */
.reveal-section {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 1.05s ease-out,
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-section {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }
}

h1,
h2,
h3 {
  line-height: 1.3;
  margin: 0 0 1rem;
}

h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgb(240 242 247 / 96%);
}

.card-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

h2 {
  font-size: clamp(1.6rem, 2vw + 1rem, 2.3rem);
  margin-bottom: 1.4rem;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text);
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px) saturate(1.1);
  background: rgb(8 9 12 / 78%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.logo {
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.nav a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--accent-2);
}

.hero {
  padding-top: 6rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: start;
}

.eyebrow {
  color: var(--accent-2);
  font-weight: 700;
  letter-spacing: 0.09em;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(2rem, 3.5vw + 1rem, 3.4rem);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: #f4f5f8;
}

.hero-copy {
  max-width: 62ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(165deg, #7b82f5 0%, #5558d6 100%);
  color: #fafbff;
  box-shadow: 0 4px 20px var(--accent-soft), 0 0 0 1px rgb(255 255 255 / 6%) inset;
}

.btn.primary:hover {
  box-shadow: 0 6px 28px rgb(107 110 240 / 32%), 0 0 0 1px rgb(255 255 255 / 10%) inset;
}

.btn.ghost {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgb(255 255 255 / 3%);
}

.btn.ghost:hover {
  border-color: rgb(255 255 255 / 16%);
  background: rgb(255 255 255 / 5%);
}

.hero-card,
.panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(165deg, rgb(255 255 255 / 5%) 0%, rgb(255 255 255 / 0%) 42%),
    linear-gradient(180deg, #15171e 0%, var(--panel) 100%);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 5%) inset,
    0 20px 48px rgb(0 0 0 / 42%),
    0 8px 16px rgb(0 0 0 / 28%);
}

.hero-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hero-card li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.62rem 0;
  border-bottom: 1px dashed rgb(255 255 255 / 8%);
  gap: 0.8rem;
}

.hero-card li:last-child {
  border-bottom: 0;
}

.hero-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-card strong {
  font-size: 0.96rem;
}

.about-grid,
.skills-grid,
.contact-grid {
  display: grid;
  gap: 1rem;
}

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

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

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

.lead {
  margin-bottom: 1.25rem;
  max-width: 70ch;
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tag-list li {
  font-size: 0.88rem;
  padding: 0.35rem 0.6rem;
  background: rgb(255 255 255 / 4%);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: rgb(232 234 239 / 92%);
}

.timeline {
  display: grid;
  gap: 1rem;
}

/* Experience: 縦軸＝時間・ノード＋矢印で本文へ */
.experience-timeline {
  --tl-col-time: 7.5rem;
  --tl-col-node: 3.25rem;
  --tl-gutter: 0.65rem;
  margin-top: 0.35rem;
  position: relative;
}

.experience-timeline__hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: -0.35rem 0 1rem;
}

.experience-timeline__list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0.25rem;
  position: relative;
}

.experience-timeline__list::before {
  content: "";
  position: absolute;
  left: calc(var(--tl-col-time) + var(--tl-gutter) + var(--tl-col-node) / 2 - 1px);
  top: 0.85rem;
  bottom: 1rem;
  width: 2px;
  background: linear-gradient(180deg, rgb(255 255 255 / 16%), rgb(255 255 255 / 6%));
  border-radius: 1px;
}

.experience-timeline__item {
  display: grid;
  grid-template-columns: var(--tl-col-time) var(--tl-col-node) minmax(0, 1fr);
  column-gap: var(--tl-gutter);
  align-items: start;
  padding-bottom: 1.65rem;
  position: relative;
}

.experience-timeline__item:last-child {
  padding-bottom: 0;
}

.experience-timeline__time {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent-2);
  line-height: 1.4;
  padding-top: 0.2rem;
  letter-spacing: 0.02em;
}

.experience-timeline__node {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  min-height: 1.5rem;
  padding-top: 0.12rem;
}

.experience-timeline__dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 0 3px rgb(15 16 20 / 90%),
    0 0 12px rgb(88 101 242 / 35%);
  margin-left: calc(var(--tl-col-node) / 2 - 5px);
}

.experience-timeline__arm {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 1px;
  background: linear-gradient(90deg, rgb(255 255 255 / 22%), rgb(255 255 255 / 10%));
  margin-left: 0;
}

.experience-timeline__arrow {
  flex: 0 0 auto;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--accent-2);
  margin-left: 0.12rem;
  font-weight: 500;
  opacity: 0.92;
}

.experience-timeline__body {
  min-width: 0;
  padding-top: 0;
}

.experience-timeline__title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.experience-timeline__body p:last-child {
  margin-bottom: 0;
}

@media (max-width: 700px) {
  .experience-timeline {
    --tl-col-time: 5.65rem;
    --tl-col-node: 2.85rem;
    --tl-gutter: 0.45rem;
  }

  .experience-timeline__list::before {
    left: calc(var(--tl-col-time) + var(--tl-gutter) + var(--tl-col-node) / 2 - 1px);
    top: 0.65rem;
    bottom: 0.85rem;
  }

  .experience-timeline__item {
    grid-template-columns: var(--tl-col-time) var(--tl-col-node) minmax(0, 1fr);
    padding-bottom: 1.35rem;
  }

  .experience-timeline__time {
    font-size: 0.74rem;
  }

  .experience-timeline__arm {
    width: 0.55rem;
  }
}

@media (max-width: 520px) {
  .experience-timeline__hint {
    margin-bottom: 0.85rem;
  }

  .experience-timeline__list::before {
    display: none;
  }

  .experience-timeline__item {
    grid-template-columns: 1fr;
    padding-bottom: 1.5rem;
    padding-left: 0.15rem;
    border-left: 2px solid rgb(255 255 255 / 10%);
    margin-left: 0.35rem;
    padding-left: 1rem;
  }

  .experience-timeline__time {
    text-align: left;
    margin-bottom: 0.4rem;
    padding-top: 0;
  }

  .experience-timeline__node {
    margin-bottom: 0.35rem;
    padding-top: 0;
    justify-content: flex-start;
  }

  .experience-timeline__dot {
    margin-left: 0;
  }

  .experience-timeline__item:last-child {
    border-left-color: rgb(255 255 255 / 14%);
  }
}

/* Works カルーセル */
.works-carousel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: stretch;
  margin-top: 0.25rem;
}

.works-carousel.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.works-carousel.is-single .works-nav {
  display: none;
}

.works-viewport {
  overflow: hidden;
  min-width: 0;
  border-radius: 14px;
}

.works-track {
  display: flex;
  gap: 1rem;
  will-change: transform;
  transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .works-track {
    transition-duration: 0.01ms;
  }
}

.works-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 120px;
  align-self: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, rgb(255 255 255 / 6%) 0%, rgb(255 255 255 / 2%) 100%);
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;
}

.works-nav:hover:not(:disabled) {
  border-color: rgb(158 164 255 / 35%);
  color: var(--accent-2);
}

.works-nav:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.works-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1rem;
}

.works-dots:empty,
.works-carousel.is-single + .works-dots {
  display: none;
}

.works-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgb(255 255 255 / 18%);
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.works-dot:hover {
  background: rgb(255 255 255 / 35%);
}

.works-dot.is-active {
  background: var(--accent);
  transform: scale(1.15);
}

.work-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.work-image {
  min-height: 110px;
  border-radius: 10px;
  margin-bottom: 0.8rem;
  border: 1px solid rgb(255 255 255 / 8%);
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    radial-gradient(circle at 18% 12%, rgb(90 98 180 / 35%), transparent 52%),
    radial-gradient(circle at 88% 88%, rgb(50 55 95 / 45%), transparent 45%),
    linear-gradient(160deg, #0c0d12 0%, #14161f 100%);
  font-size: 0.88rem;
}

.work-links {
  margin-top: auto;
  display: flex;
  gap: 1rem;
}

.work-links a {
  color: var(--accent-2);
  font-weight: 600;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.work-links a:hover {
  color: #c8ccff;
}

.contact-item {
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.contact-item:hover {
  border-color: rgb(158 164 255 / 35%);
  box-shadow: 0 12px 36px rgb(0 0 0 / 35%);
  transform: translateY(-2px);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 0;
  color: rgb(139 144 154 / 85%);
  font-size: 0.9rem;
}

@media (max-width: 960px) {
  .hero-grid,
  .skills-grid,
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 680px) {
  .section {
    padding: 3.4rem 0;
  }

  .header-inner {
    min-height: 56px;
  }

  .nav {
    gap: 0.75rem;
    font-size: 0.84rem;
    overflow-x: auto;
    white-space: nowrap;
    max-width: 58vw;
  }

  .hero {
    padding-top: 4.2rem;
  }

  .hero-grid,
  .skills-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .works-nav {
    width: 40px;
    min-height: 100px;
  }
}
