@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=JetBrains+Mono:wght@500&display=swap");

:root {
  --color-bg: #e7e9ec;
  --color-bg-card: #f7f8f9;
  --color-text: #1c1e22;
  --color-text-sub: #565d68;
  --color-accent: #33415c;
  --color-border: #c9cdd2;
  --font-body: "Noto Sans JP", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --about-photo-width: 200px;
  --work-thumb-width: 96px;
  --header-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 14px;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.8;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

section {
  padding: 3.5rem 1.5rem;
  max-width: 800px;
  margin: 0 auto;
  scroll-margin-top: var(--header-height);
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}


/*header
----------------------------------------------------------------------------*/
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 1.5rem;
  z-index: 100;
  background: rgba(220, 223, 227, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
}

.logo {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  padding-right: 2rem;
  border-right: 1px solid var(--color-border);
}


/*ナビゲーション（横並びタブ。幅が足りない時はタブ部分だけ横スクロール）
----------------------------------------------------------------------------*/
#main-nav {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

#main-nav::-webkit-scrollbar {
  display: none;
}

#main-nav ul {
  display: flex;
  gap: 1.4rem;
  width: max-content;
}

#main-nav a {
  flex-shrink: 0;
  display: inline-block;
  white-space: nowrap;
  padding: 0.6rem 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--color-text-sub);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

#main-nav a span {
  display: inline-block;
  transform-origin: left center;
  transition: transform 0.2s;
}

/*選択中（今見ているセクション）：下線で常時表示*/
#main-nav a.active {
  color: var(--color-accent);
  font-weight: 500;
  border-bottom-color: var(--color-accent);
}

/*ホバー：文字だけが少し拡大する演出（下線の位置には影響しない）*/
#main-nav a:hover {
  color: var(--color-accent);
}

#main-nav a:hover span {
  transform: scale(1.12);
}


/*スクロールでふわっと出現
----------------------------------------------------------------------------*/
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.about-grid.reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

.about-grid.reveal > * {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.about-grid.reveal.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.about-grid.reveal .profile-name,
.about-grid.reveal .profile-tagline {
  transition-delay: 0.16s;
}

.about-grid.reveal .about-details {
  transition-delay: 0.3s;
}

.works-grid .work-item:nth-child(2) {
  transition-delay: 0.12s;
}

.works-grid .work-item:nth-child(3) {
  transition-delay: 0.24s;
}

.works-grid .work-item:nth-child(4) {
  transition-delay: 0.36s;
}

.works-grid .work-item:nth-child(5) {
  transition-delay: 0.48s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .about-grid.reveal > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/*About
----------------------------------------------------------------------------*/
section#about {
  padding-top: calc(var(--header-height) + 2rem);
}

.profile-award {
  display: block;
  margin-top: 0.8rem;
  margin-bottom: 0.2rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-accent);
}

.profile-history {
  margin-top: 1rem;
  padding-left: 1.2rem;
  list-style: disc;
  color: var(--color-text-sub);
  font-size: 0.9rem;
  line-height: 1.8;
}

.profile-tech {
  margin-top: 1rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-accent);
}

.profile-tech-label {
  display: block;
  margin-bottom: 0.2rem;
}


/*区切り線の下に来るセクションは上の余白を詰める
----------------------------------------------------------------------------*/
#services,
#flow,
#contact,
#works,
#projects,
#links {
  padding-top: 3rem;
}

#services {
  padding-bottom: 1.75rem;
}

.profile-name {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.5;
}

.profile-tagline {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-accent);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "heading"
    "name"
    "tagline"
    "photo"
    "details";
  justify-items: center;
  row-gap: 0.6rem;
}

.profile-heading {
  grid-area: heading;
  margin-bottom: 0;
}

.profile-name {
  grid-area: name;
}

.profile-tagline {
  grid-area: tagline;
}

.about-photo {
  grid-area: photo;
  width: var(--about-photo-width);
  margin: 0.9rem 0;
  border-radius: 8px;
  overflow: hidden;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.about-details {
  grid-area: details;
  min-width: 0;
  justify-self: stretch;
}

.about-details p {
  color: var(--color-text-sub);
  font-size: 0.9rem;
  line-height: 1.75;
}


/*Projects
----------------------------------------------------------------------------*/
.project-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.project-card .placeholder-img,
.project-card .project-img {
  aspect-ratio: 16/9;
}

.project-card .project-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.project-card .card-body {
  padding: 1.5rem;
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.project-card p {
  color: var(--color-text-sub);
  font-size: 0.9rem;
  line-height: 1.7;
}


/*プレースホルダー画像共通
----------------------------------------------------------------------------*/
.placeholder-img {
  width: 100%;
  background: repeating-linear-gradient(
    45deg,
    #cdd1d6,
    #cdd1d6 10px,
    #d7dade 10px,
    #d7dade 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-sub);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
  padding: 1rem;
}


/*Works（ギャラリー）
----------------------------------------------------------------------------*/
.work-group + .work-group {
  margin-top: 2.5rem;
}

.work-group-heading {
  margin-bottom: 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--color-accent);
  font-size: 1rem;
  color: var(--color-accent);
}

.works-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 0.8rem; /* WORKS：カード同士の間隔 */
}

.work-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--color-border);
  padding: 0.6rem;
  background: var(--color-bg-card);
}

.work-item:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.work-media {
  position: relative;
  flex-shrink: 0;
  width: var(--work-thumb-width);
  border-radius: 6px;
  overflow: hidden;
}

.work-item .placeholder-img,
.work-item .work-thumb {
  aspect-ratio: 16/9;
  transition: transform 0.5s, filter 0.5s;
}

.work-item .work-thumb {
  width: 100%;
  object-fit: cover;
}

.work-item:hover .placeholder-img,
.work-item:hover .work-thumb {
  transform: scale(1.06);
  filter: contrast(1.1);
}

.work-item .work-title {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.play-badge {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  background: rgba(28, 30, 34, 0.65);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}


/*モーダル
----------------------------------------------------------------------------*/
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 19, 22, 0.85);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

#modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

#modal-content {
  max-width: 720px;
  max-height: calc(100vh - 3rem);
  width: 100%;
  background: var(--color-bg-card);
  border-radius: 12px;
  overflow: hidden;
  overflow-y: auto;
}

#modal-media {
  width: 100%;
  aspect-ratio: 16/9;
}

#modal-media video,
#modal-media iframe {
  width: 100%;
  height: 100%;
  border: none;
}

#modal-caption {
  padding: 1.2rem 1.5rem;
}

#modal-caption h3 {
  margin-bottom: 0.3rem;
}

#modal-caption p {
  color: var(--color-text-sub);
  font-size: 0.9rem;
}

#modal-caption #modal-category {
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--color-accent);
}

#modal-points {
  margin-top: 1rem;
  padding-left: 1.2rem;
  list-style: disc;
  color: var(--color-text-sub);
  font-size: 0.9rem;
  line-height: 1.7;
}

#modal-tech {
  margin-top: 1rem;
}

#modal-link {
  display: inline-flex;
  margin-top: 1rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--color-accent);
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 500;
}

#modal-caption [hidden] {
  display: none;
}

#modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}


/*Skills
----------------------------------------------------------------------------*/
.skills-list {
  display: grid;
}

.skills-list li {
  position: relative;
  display: grid;
  gap: 0.65rem;
  padding: 1.5rem 0;
}

.skills-list li + li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border);
}

.skills-list .skill-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-accent);
  display: block;
}

.skill-description {
  color: var(--color-text-sub);
  font-size: 0.9rem;
  line-height: 1.75;
}

.nowrap {
  white-space: nowrap;
}


/*Flow
----------------------------------------------------------------------------*/
.flow-lead {
  max-width: 720px;
  margin-bottom: 2rem;
  color: var(--color-text-sub);
  font-size: 0.9rem;
}

.flow-steps {
  position: relative;
  display: grid;
  gap: 0;
  margin-bottom: 2rem;
  list-style: none;
}

.flow-step {
  position: relative;
  min-width: 0;
  padding: 0 0 1.8rem 3.2rem;
}

.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 2.1rem;
  bottom: 0;
  left: 1.05rem;
  width: 1px;
  background: var(--color-border);
}

.flow-number {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.flow-step h3,
.service-flow h3,
.contact-card h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.flow-step p,
.service-flow p,
.contact-card p {
  color: var(--color-text-sub);
  font-size: 0.9rem;
  line-height: 1.7;
}

.flow-step:nth-child(2) {
  transition-delay: 0.12s;
}

.flow-step:nth-child(3) {
  transition-delay: 0.24s;
}

.flow-step:nth-child(4) {
  transition-delay: 0.36s;
}

.flow-step:nth-child(5) {
  transition-delay: 0.48s;
}

.service-flow-grid {
  display: grid;
  gap: 1rem;
}

.service-flow {
  padding: 1.2rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}


/*Links
----------------------------------------------------------------------------*/
.contact-card {
  display: grid;
  gap: 1.2rem;
  padding: 1.2rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.contact-button:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.contact-button-primary {
  color: #fff;
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.contact-button-primary:hover {
  color: #fff;
  background: var(--color-text);
  border-color: var(--color-text);
}

.icon-row {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.icon-row a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.icon-row a:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.link-list a {
  display: inline-block;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
  width: 100%;
}


/*footer
----------------------------------------------------------------------------*/
footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  color: var(--color-text-sub);
  font-size: 0.8rem;
}


/*画面幅599px以下のヘッダー
----------------------------------------------------------------------------*/
@media screen and (max-width: 599px) {

  :root {
    --header-height: 88px;
  }

  header {
    grid-template-rows: 30px 42px;
    display: grid;
    align-content: center;
    align-items: center;
    gap: 0;
    padding: 0.4rem 1.25rem;
  }

  .logo {
    width: max-content;
    padding-right: 0;
    border-right: none;
    font-size: 0.8rem;
  }

  #main-nav {
    width: 100%;
  }

  #main-nav ul {
    width: 100%;
    min-width: max-content;
    justify-content: space-between;
    gap: 0.45rem;
  }

  #main-nav a {
    padding: 0.45rem 0;
    font-size: 0.68rem;
  }

}


/*画面幅600px以上の追加指定
----------------------------------------------------------------------------*/
@media screen and (min-width: 600px) {

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

  .contact-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

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

  .work-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }

  .work-media {
    width: 100%;
    border-radius: 0;
  }

  .work-item .work-title {
    display: flex;
    align-items: center;
    min-height: 4rem;
    padding: 0.8rem 1rem;
  }

}


/*画面幅900px以上の追加指定
----------------------------------------------------------------------------*/
@media screen and (min-width: 900px) {

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

}


/*画面幅830px以上の追加指定
----------------------------------------------------------------------------*/
@media screen and (min-width: 830px) {

  html {
    font-size: 16px;
  }

  section {
    width: 800px;
  }

  .about-grid {
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-areas:
      "heading name"
      "photo tagline"
      "photo details";
    justify-items: stretch;
    align-items: start;
    column-gap: 1.2rem;
    row-gap: 0.45rem;
  }

  .profile-heading {
    align-self: center;
    font-size: 1rem;
    font-weight: 500;
  }

  .profile-name {
    align-self: center;
  }

  .profile-tagline {
    margin-bottom: 0.45rem;
  }

  .about-photo {
    --about-photo-width: 240px;
    margin: 0;
  }

  .skills-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    padding-top: 0.3rem;
  }

  .skills-list li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0;
    text-align: center;
  }

  .skills-list li + li::before {
    display: none;
  }

  .flow-steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .flow-steps::before {
    content: "";
    position: absolute;
    top: 1.1rem;
    left: 10%;
    right: 10%;
    height: 1px;
    background: var(--color-border);
  }

  .flow-step {
    padding: 0;
    text-align: center;
  }

  .flow-step:not(:last-child)::after {
    display: none;
  }

  .flow-number {
    position: relative;
    margin: 0 auto 0.8rem;
  }

  #main-nav ul {
    gap: 2rem;
  }

  #main-nav a {
    font-size: 0.8rem;
  }

}


/*セクション区切り線
----------------------------------------------------------------------------*/
main > section + section {
  position: relative;
}

main > section + section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
  height: 1px;
  background: var(--color-border);
}
