@charset "UTF-8";

/* ============================================================
   甲斐 優伸 | Yushin Kai — Portfolio
   静かなミニマリズム × 過剰なタイポグラフィ × 予測不能なディテール
   ============================================================ */

:root {
  --color-bg: #eceae6;
  --color-text: #1a1a1a;
  --color-gray: #777572;
  --color-line: #d6d3cd;
  --font-base: "Helvetica Neue", Helvetica, Arial, "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-mono: "Space Mono", monospace;
  --pad-x: clamp(20px, 4vw, 56px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: 14px;
  font-weight: 400;
  line-height: 2;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

::selection {
  background-color: var(--color-text);
  color: var(--color-bg);
}

/* ---------- Grain（砂嵐：ノイズ面を不規則にジャンプさせて静電気のように見せる）
   ::before = モノクロ砂嵐（常時） / ::after = RGBノイズ（ノイズ文字ホバー中）---------- */
.grain {
  position: fixed;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  z-index: 9000;
  pointer-events: none;
  will-change: transform;
  animation: grain-static 0.9s steps(10) infinite;
}

.grain::before,
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  transition: opacity 0.45s ease;
}

.grain::before {
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* RGBノイズ：各チャンネルを0/1に量子化した原色の砂嵐 */
.grain::after {
  opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='discrete' tableValues='0 1'/%3E%3CfeFuncG type='discrete' tableValues='0 1'/%3E%3CfeFuncB type='discrete' tableValues='0 1'/%3E%3CfeFuncA type='discrete' tableValues='1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23r)'/%3E%3C/svg%3E");
}

/* ノイズ文字ホバー中：モノクロ→RGBにクロスフェードし、速くなる */
.grain.is-intense {
  animation-duration: 0.45s;
}

.grain.is-intense::before {
  opacity: 0;
}

.grain.is-intense::after {
  opacity: 0.14;
}

@keyframes grain-static {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  20% { transform: translate(-15%, 5%); }
  30% { transform: translate(7%, -25%); }
  40% { transform: translate(-5%, 25%); }
  50% { transform: translate(-15%, 10%); }
  60% { transform: translate(15%, 0%); }
  70% { transform: translate(0%, 15%); }
  80% { transform: translate(3%, 28%); }
  90% { transform: translate(-10%, 10%); }
}

/* ---------- Cursor ---------- */
.cursor {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9500;
    pointer-events: none;
    mix-blend-mode: difference;
  }

  .cursor__dot {
    position: fixed;
    top: -3px;
    left: -3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #fff;
    will-change: transform;
  }

  .cursor__ring {
    position: fixed;
    top: -16px;
    left: -16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px dashed #fff;
    will-change: transform;
    transition: width 0.35s ease, height 0.35s ease, top 0.35s ease, left 0.35s ease;
  }

  .cursor.is-hover .cursor__ring {
    width: 56px;
    height: 56px;
    top: -28px;
    left: -28px;
  }
}

/* ---------- Ticker ---------- */
.ticker {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 9100;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--color-gray);
}

/* ---------- Fade-in ---------- */
.js-fade {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s ease, transform 1s ease;
}

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

/* ---------- Per-char reveal ---------- */
.js-chars .char {
  opacity: 0;
  transition: opacity 0.9s ease;
}

.js-chars.is-visible .char {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js-fade,
  .js-chars .char {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .grain,
  .cursor,
  .ticker {
    display: none;
  }
}

/* ---------- Header ---------- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 28px var(--pad-x);
}

.header__name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.header__name-en {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--color-gray);
}

.header__nav {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
}

.header__link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: opacity 0.3s ease;
}

.header__link:hover {
  opacity: 0.45;
}

/* ---------- Statement ---------- */
.statement {
  padding: clamp(80px, 13vw, 160px) var(--pad-x) clamp(90px, 13vw, 170px);
}

.statement__text {
  max-width: 30em;
  font-family: var(--font-mincho);
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 400;
  line-height: 2.1;
  letter-spacing: 0.06em;
}

/* 強調語：級数を跳ね上げ、斜体で暴れさせる */
.statement__text .emph {
  font-style: italic;
  font-weight: 500;
  font-size: 1.45em;
  letter-spacing: 0.02em;
  line-height: 1;
}

.statement__text--sub {
  margin-top: 3em;
  max-width: 40em;
  font-family: var(--font-base);
  font-size: 13px;
  line-height: 2.2;
  color: var(--color-gray);
}

.statement__text--sub .emph {
  font-style: normal;
  font-weight: 400;
  font-size: 1em;
}

/* ---------- Section title ---------- */
.section-title {
  display: flex;
  align-items: baseline;
  gap: clamp(12px, 2vw, 28px);
  margin-bottom: clamp(40px, 6vw, 72px);
  font-weight: 400;
}

.section-title__num {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.2vw, 14px);
  letter-spacing: 0.1em;
  color: var(--color-gray);
}

.section-title__en {
  font-family: var(--font-display);
  font-size: clamp(56px, 11vw, 150px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.section-title__jp {
  font-size: clamp(11px, 1.2vw, 13px);
  letter-spacing: 0.2em;
  color: var(--color-gray);
  writing-mode: vertical-rl;
  align-self: flex-end;
  padding-bottom: 0.4em;
}

/* ---------- Projects ---------- */
.projects {
  padding: 0 var(--pad-x) clamp(80px, 12vw, 160px);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: clamp(20px, 3vw, 48px);
  row-gap: clamp(56px, 7vw, 96px);
  will-change: transform;
}

.projects__link {
  display: block;
}

.projects__thumb {
  aspect-ratio: 4 / 3;
  margin-bottom: 16px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.4s ease;
  will-change: transform;
}

.projects__link:hover .projects__thumb {
  opacity: 0.7;
}

/* サムネイル：実サイトのスクリーンショット（images/ 内のローカル画像） */
.projects__thumb--01 { background-color: #c9c5bd; background-image: url("images/reform-okamoto.png"); }
.projects__thumb--02 { background-color: #b9b3a8; background-image: url("images/cutinn-ide-homme.png"); }

.projects__num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--color-gray);
  line-height: 1.4;
}

.projects__title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 2px;
}

.projects__meta {
  font-size: 11px;
  color: var(--color-gray);
  line-height: 1.9;
  margin-top: 6px;
}

/* ---------- Info ---------- */
.info {
  padding: 0 var(--pad-x) clamp(80px, 12vw, 160px);
}

.info__body {
  max-width: 44em;
}

.info__name {
  font-family: var(--font-mincho);
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.4;
  margin-bottom: 0.9em;
}

.info__name-en {
  display: inline-block;
  margin-left: 1em;
  font-family: var(--font-display);
  font-size: 0.45em;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-gray);
}

.info__text {
  font-size: 13px;
}

.info__text p + p {
  margin-top: 1.5em;
}

.info__detail {
  margin-top: 3em;
  border-top: 1px solid var(--color-line);
}

.info__row {
  display: flex;
  align-items: baseline;
  gap: 2em;
  padding: 1.1em 0;
  border-bottom: 1px solid var(--color-line);
}

.info__dt {
  width: 7em;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gray);
}

.info__dd {
  font-size: 13px;
}

/* ---------- Contact ---------- */
.contact {
  padding: 0 var(--pad-x) clamp(96px, 14vw, 180px);
}

.contact__text {
  font-size: 13px;
  margin-bottom: 2.5em;
}

.contact__mail {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(24px, 5vw, 58px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  border-bottom: 2px solid var(--color-text);
  padding-bottom: 4px;
  transition: opacity 0.3s ease;
  overflow-wrap: anywhere;
}

.contact__mail:hover {
  opacity: 0.45;
}

/* ---------- Footer ---------- */
.footer {
  padding: clamp(48px, 7vw, 96px) var(--pad-x) 36px;
  border-top: 1px solid var(--color-line);
}

.footer__mark {
  font-family: var(--font-display);
  font-size: clamp(60px, 14vw, 210px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.05em;
  margin-bottom: clamp(40px, 6vw, 80px);
}

.footer__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.footer__nav {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
}

.footer__link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  transition: opacity 0.3s ease;
}

.footer__link:hover {
  opacity: 0.45;
}

.footer__copy {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--color-gray);
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .header {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .header__name-en {
    display: none;
  }

  .section-title__jp {
    display: none;
  }

  .projects__grid {
    grid-template-columns: 1fr;
    row-gap: 48px;
  }

  .info__row {
    flex-direction: column;
    gap: 0.2em;
  }

  .footer__row {
    flex-direction: column;
    gap: 1.5em;
  }

  .ticker {
    display: none;
  }
}
