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

/* =========================================================
   Folio. — Portfolio styles
   Design tokens are defined in design.md
   ========================================================= */

:root {
  --paper: #ffffff;        /* 背景（白） */
  --surface: #ffffff;      /* カード・面 */
  --ink: #24262a;          /* 通常の黒文字 */
  --ink-soft: #97979d;     /* グレー文字 */
  --ink-faint: #97979d;    /* 補助の薄い文字（同じグレー） */
  --line: #e8e8ec;         /* 罫線 */
  --accent: #145cfb;       /* メインカラー */
  --accent-press: #0f49d6; /* メインカラーの押下/ホバー */
  --accent-tint: #eaf0ff;  /* メインカラーの淡い背景 */

  --font: "Roboto", "Noto Sans JP", sans-serif;

  --container: 1320px;
  --gutter: clamp(20px, 5vw, 72px);
  --section-y: clamp(4rem, 10vw, 8rem);

  --radius-media: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.accent-text { color: var(--accent); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

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

.wordmark {
  display: inline-flex;
  align-items: center;
}
.wordmark img {
  height: 22px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.75rem);
}
.nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.nav a:hover { color: var(--ink); }

.nav .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  transition: background 0.2s ease;
}
.nav .nav-cta:hover { background: var(--accent); color: #fff; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transform: translateX(-50%);
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}
.nav-toggle span { top: 50%; translate: 0 -50%; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: translateX(-50%) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { top: 0; transform: translateX(-50%) rotate(-45deg); }

/* ---------- hero (TOP) ---------- */
.hero {
  padding-block: clamp(4rem, 9vw, 8rem) clamp(2.5rem, 5vw, 4rem);
}
.hero .eyebrow { margin-bottom: 1.5rem; }
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 5.25rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-lede {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 52ch;
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  color: var(--ink-soft);
}

/* ---------- filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-block: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}
.filter {
  padding: 0.5rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.filter:hover { color: var(--ink); border-color: var(--ink); }
.filter.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

/* ---------- work index ---------- */
.work-section { padding-block: clamp(2.5rem, 5vw, 4rem) var(--section-y); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2.5rem, 5vw, 4.5rem) clamp(1.5rem, 3vw, 3rem);
}

.work-card { display: block; }
.work-card[hidden] { display: none; }

.work-card .media { margin-bottom: 1.25rem; }

.work-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}
.work-no {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.work-client {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}
.work-title {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.01em;
  transition: color 0.25s var(--ease);
}
.work-card:hover .work-title { color: var(--accent); }

/* animated underline used on titles/links */
.link-underline {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  transition: background-size 0.4s var(--ease);
  padding-bottom: 1px;
}
a:hover .link-underline,
.link-underline:hover { background-size: 100% 1.5px; }

/* ---------- media placeholder ----------
   差し替え: <div class="media">…</div> を
   <img class="media" src="..." alt="..."> に置き換え可能 */
.media {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-media);
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 80% 0%, #ffffff 0%, transparent 55%),
    linear-gradient(135deg, #f1f2f5 0%, #e3e4e9 100%);
  display: grid;
  place-items: center;
  transition: transform 0.6s var(--ease);
}
.media.is-wide { aspect-ratio: 16 / 9; }
.media.is-tall { aspect-ratio: 4 / 5; }
.media > * { transition: transform 0.6s var(--ease); }
.media img,
.media picture,
.media video,
.media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
}
/* hover zoom on the inner content (works for both placeholder & <img>) */
.work-card:hover .media > * { transform: scale(1.05); }

/* ---------- CTA band ---------- */
.cta {
  background: var(--ink);
  color: var(--paper);
  border-radius: clamp(18px, 3vw, 28px);
  padding: clamp(2.5rem, 6vw, 5rem);
  display: grid;
  gap: clamp(1.5rem, 3vw, 2rem);
  margin-block: var(--section-y);
}
.cta .eyebrow { color: var(--ink-faint); }
.cta h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 18ch;
}
.cta p { color: #c9c9d0; max-width: 46ch; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.95rem 1.8rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.98rem;
  background: var(--accent);
  color: #fff;
  width: fit-content;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--accent-press); }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn.btn-light { background: var(--surface); color: var(--ink); }
.btn.btn-light:hover { background: var(--paper); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2.5rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand .wordmark { margin-bottom: 0.75rem; }
.footer-brand .wordmark img { height: 24px; }
.footer-brand p { color: var(--ink-soft); max-width: 34ch; font-size: 0.92rem; }
.footer-cols { display: flex; gap: clamp(2.5rem, 6vw, 5rem); flex-wrap: wrap; }
.footer-col h3 {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.footer-col a { font-size: 0.92rem; color: var(--ink-soft); }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* =========================================================
   Detail page
   ========================================================= */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { color: var(--line); }

.project-head { padding-bottom: clamp(2rem, 4vw, 3rem); }
.project-head .eyebrow { margin-bottom: 1.25rem; }
.project-title {
  font-size: clamp(1.9rem, 4.4vw, 3.6rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

.meta-table {
  margin-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.meta-cell {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  padding-right: 1.5rem;
}
.meta-cell dt {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.meta-cell dd { margin: 0; font-size: 0.96rem; color: var(--ink); }

.project-hero { margin-block: clamp(2.5rem, 5vw, 4rem); }
.project-hero .media { border-radius: clamp(14px, 2vw, 20px); }

/* project gallery（article下：画像を並べる。simple構成で使用。article内figureと同じ幅） */
.project-gallery {
  max-width: 900px;
  margin-inline: auto;
  margin-top: clamp(2rem, 4vw, 3rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3rem);
}
.project-gallery .media { border-radius: var(--radius-media); }
.project-gallery-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--accent);
  font-weight: 500;
  transition: color 0.2s ease;
}
.project-gallery-link a:hover { color: var(--accent-press); }

/* project overview（hero直下：説明文＋表） */
.project-overview {
  max-width: 900px;
  margin-inline: auto;
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.overview-desc {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.9;
  color: var(--ink);
}
.overview-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: clamp(2rem, 4vw, 2.5rem) 0;
}
.overview-heading {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}
.overview-table {
  width: 100%;
  border-collapse: collapse;
}
.overview-table th,
.overview-table td {
  text-align: left;
  padding: 1rem 0.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.7;
  vertical-align: top;
}
.overview-table thead th {
  color: #24262a;
  font-weight: 700;
  padding-top: 0;
}
.overview-table tbody th {
  width: 8em;
  color: var(--ink);
  font-weight: 400;
  white-space: nowrap;
}
.overview-table td { color: var(--ink); }

/* article body */
.article {
  max-width: 900px;
  margin-inline: auto;
  padding-bottom: var(--section-y);
}
.article > * + * { margin-top: 1.6rem; }
.article h2 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--line);
}

.article h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2em 0 0.6em;
}

.article .article-list {
  margin: 1.4em 0;
  padding-left: 1.4em;
}
.article .article-list li {
  margin: 0.9em 0;        /* ← 項目どうしの間隔。数値を上げるとさらに開く */
  line-height: 1.9;
  font-weight: 500;       /* ← 文字の太さ。600 にするともっと太く */
}

.article h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.article p { color: var(--ink); }
.article p.muted { color: var(--ink-soft); }
.article figure { margin: clamp(2rem, 4vw, 3rem) 0 0; }
.article figure .media { border-radius: var(--radius-media); }
.article figcaption {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
  text-align: center;
}

.pullquote {
  margin: clamp(2.5rem, 5vw, 3.5rem) 0;
  padding: 0.4rem 0 0.4rem 1.6rem;
  border-left: 3px solid var(--accent);
}
.pullquote p {
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  line-height: 1.7;
  font-weight: 500;
}
.pullquote cite {
  display: block;
  margin-top: 0.9rem;
  font-style: normal;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.credit {
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(1.75rem, 3vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-media);
}
.credit h2 {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 1rem;
  border: 0;
  padding: 0;
}
.credit dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 1.5rem;
  margin: 0;
  font-size: 0.92rem;
}
.credit dt { color: var(--ink-soft); }
.credit dd { margin: 0; }

/* next project */
.next-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.next-project .eyebrow { margin-bottom: 0.5rem; }
.next-project .np-title {
  font-size: clamp(1.4rem, 3vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.next-project .np-arrow {
  flex: none;
  font-size: clamp(1.5rem, 3vw, 2rem);
  transition: transform 0.3s var(--ease);
}
.next-project:hover .np-arrow { transform: translateX(8px); }

/* =========================================================
   Reveal on scroll
   ========================================================= */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 760px) {
  .work-grid { grid-template-columns: 1fr; }
  .meta-table { grid-template-columns: 1fr; }
  .meta-cell { padding-right: 0; }

  .nav { gap: 1.25rem; }
  .nav a:not(.nav-cta) { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  /* mobile menu panel */
  .nav.is-open {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1.5rem;
  }
  .nav.is-open a:not(.nav-cta) {
    display: block;
    padding: 0.9rem 0;
    font-size: 1.05rem;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  .nav.is-open .nav-cta { margin-top: 1rem; justify-content: center; }
  .nav.is-open .nav-toggle { display: none; }

  .next-project { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .footer-top { flex-direction: column; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
