@charset "UTF-8";

/* ---------------------------------
   スクロール挙動 & アンカー余白
---------------------------------- */
html { scroll-behavior: smooth; }
#top { scroll-margin-top: 0 !important; }     /* topはオフセットなし */
#about, #works, #contact { scroll-margin-top: var(--headerH); }

/* ---------------------------------
   ルート変数（色・寸法・共通幅）
---------------------------------- */
:root{
  --headerH: 64px;

  /* 背景色 */
  --bgHero: #e0e0e0;
  --bgNav:  #111;

  /* 文字色 */
  --textDark:  #111;
  --textSoft:  #555;
  --textOnNav: #fff;

  /* ドットパネル色 */
  --dotGreen: #2f8c60;
  --dotRed:   #e25750;
  --dotWhite: #ffffff;

  /* ドット設定 */
  --dot:    12px;
  --gap:    32px;
  --panelW: 480px;
  --speed:  5s;

  /* レイアウト */
  --container-max: 1200px;
  --container-pad: 24px;

  /* テキスト幅など */
  --about-max-w: 72ch;
}

/* ---------------------------------
   ベース
---------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body{
  background: #fff;
  color: var(--textDark);
  font-family: "Kosugi Maru", system-ui, sans-serif;
  line-height: 1.7;
}
.container{
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* 見出しフォント統一 */
.siteTitle,
.intro h2,
.about h2,
.works h2,
.contact h2,
.workCard h3,
section h2{
  font-family: "Raleway","Poppins",system-ui,sans-serif;
}

/* ---------------------------------
   ナビゲーション
---------------------------------- */
.nav{
  position: sticky;
  top: 0;
  width: 100%;
  background: var(--bgNav); color: var(--textOnNav);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  z-index: 1000;
}
.navInner{
  height: var(--headerH);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand{
  font-family:"Raleway","Poppins",system-ui,sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: .05em;
  color: var(--textOnNav);
  text-decoration: none;
  line-height: 1;
  transition: color .3s, text-shadow .25s ease, transform .15s ease;
}
.brand:hover{
  color: var(--textOnNav);
  text-shadow:
    0 0 6px rgba(255,255,255,.9),
    0 0 14px rgba(255,255,255,.7),
    0 0 22px rgba(47,140,96,.55),
    0 0 34px rgba(226,87,80,.45);
  transform: translateY(-1px) scale(1.04);
}
.spacer{ flex: 1 1 auto; }
.links{ display: flex; gap: 28px; }
.links a{
  position: relative;
  font-family:"Raleway","Poppins",system-ui,sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #ddd;
  text-decoration: none;
  letter-spacing: .02em;
  padding: 1px 1px 1px;
  transition: color .25s ease, transform .2s ease;
}
.links a::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: -0em;
  width: 0%;
  height: 2px;
  background: #fff;
  transition: width .25s ease;
}
.links a:hover{ color: #fff; transform: translateY(-2px); }
.links a:hover::after{ width: 100%; }

/* ---------------------------------
   ヒーロー
---------------------------------- */
.hero{
  position: relative;
  overflow: hidden;
  background: var(--bgHero);
  color: var(--textDark);
  height: 100dvh;
}
.heroInner{
  height: 100%;
  display: grid;
  place-items: center start;
  padding-left: clamp(24px, 8vw, 120px);
  text-align: left;
}
.siteTitle{
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: .05em;
  margin: 0 0 4px;
  color: var(--textDark);
}

/* ドット装飾（右固定） */
.dotsPanel{
  position: absolute;
  top: 0;
  right: 15px;
  bottom: 0;
  width: var(--panelW);
  height: 100%;
  background:
    repeating-linear-gradient(
      to right,
      var(--dotGreen) 0 calc(var(--gap)),
      var(--dotWhite) calc(var(--gap)) calc(var(--gap)*2),
      var(--dotRed)   calc(var(--gap)*2) calc(var(--gap)*3)
    );
  -webkit-mask:
    radial-gradient(circle at center, #000 0 calc(var(--dot)/2),
      transparent calc(var(--dot)/2 + 1px))
    0 0 / var(--gap) var(--gap) repeat;
  mask:
    radial-gradient(circle at center, #000 0 calc(var(--dot)/2),
      transparent calc(var(--dot)/2 + 1px))
    0 0 / var(--gap) var(--gap) repeat;
  animation: dotsFlow var(--speed) linear infinite;
  opacity: .92;
}
@keyframes dotsFlow{
  0%   { -webkit-mask-position: 0 0;          mask-position: 0 0; }
  100% { -webkit-mask-position: 0 var(--gap); mask-position: 0 var(--gap); }
}

/* ---------------------------------
   Introduction（2カラム）
---------------------------------- */
.intro { background: #fff; color: var(--textDark); }
.intro .intro-inner{
  min-height: calc(100dvh - var(--headerH));
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: center; gap: 32px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: clamp(48px, 8vh, 120px) var(--container-pad);
}
/* 左：円形写真 */
.intro-left {
  display: flex;
  justify-content: center;
  align-items: center;
 }
.intro-photo{
  width: clamp(180px, 28vw, 280px);
  height: clamp(180px, 28vw, 280px);
  border-radius: 50%;
  object-fit: cover; display: block;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
/* 右：テキスト */
.intro-right h2{
  margin: 0 0 12px;
  font-weight: 800;
  font-size: clamp(28px, 5.5vw, 56px);
  color: #555;
}
.intro-right p{ margin: 0; line-height: 1.9; }

/* ---------------------------------
   About（1カラム + 粒子BG）
---------------------------------- */
#about{
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #fff; color: var(--textDark);
}
#aboutParticles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
.aboutInner{
  height: calc(100dvh - var(--headerH));
  display: grid;
  align-content: center;
  justify-items: center;
  row-gap: 24px;
  position: relative;
  z-index: 0;
  padding: clamp(28px, 6vh, 56px) 16px;
}
.aboutTitle{
  text-align: center; font-weight: 800;
  font-size: clamp(28px, 5.5vw, 56px);
  color: #555; margin: 0;
}
.aboutBody{
  width: min(100%, var(--about-max-w));
  background: rgba(255,255,255,.94);
  border-radius: 16px;
  padding: clamp(20px, 3vw, 32px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  margin-inline: auto;
}
.aboutytStylogica{
  line-height: 1.9;
  text-align: justify;
  margin: 0;
}

/* ---------------------------------
   Works（カード）
---------------------------------- */
#works{ scroll-margin-top: calc(var(--headerH) + 12px); }
.works{
  background: #fff;
  color: var(--textDark);
  text-align: center;
  padding: clamp(48px, 8vh, 96px) 0;
}
.worksTitle{
  font-weight: 800;
  font-size: clamp(28px, 5.5vw, 56px);
  margin: 0 0 8px;
  color:#555; 
}
.worksLead{ color: var(--textSoft); margin: 0 auto 32px; max-width: 60ch; line-height: 1.7; }
.worksGrid{ display: grid; gap: 32px; }

.workCard{
  background: #fafafa;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: default;
}
.workCard[data-modal]{ cursor: pointer; }
.workCard:hover{ transform: translateY(-4px); box-shadow: 0 8px 18px rgba(0,0,0,.14); }

.workCard h3{
  font-weight: 600; letter-spacing: .02em; margin: 0;
}

/* サムネ枠（常に“全体表示”） */
.workCard .thumb{
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed rgba(0,0,0,.12);
}
.workCard .thumb.hasImg{ border: none; }
.workCard .thumb.hasImg img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center;   /* ←全部入る */
  display: block;
  transform: translateZ(0);
}
.workCard:hover .thumb.hasImg img{ transform: scale(1.03); transition: transform .35s ease; }

/* キーボードフォーカス */
.workCard[data-modal]:focus-visible{
  outline: 3px solid #2f8c60;
   outline-offset: 4px;
}

/* ---------------------------------
   Modal（共通）
---------------------------------- */
body.noScroll { overflow: hidden; }

.workModal{
  position: fixed; inset: 0; display: none; z-index: 2000;
}
.workModal[aria-hidden="false"]{ display: block; }

.workModal__backdrop{
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.workModal__panel{
  position: relative;
  width: min(1100px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  margin: 5vh auto 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  overflow: hidden;
}
.workModal__close{
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 32px;
  line-height: 1;
  color: #666;
  cursor: pointer;
}

/* 2カラム */
.workModal__grid{
  display: grid; grid-template-columns: 360px 1fr;
  gap: 24px;
  padding: 24px; 
  align-items: start;
}
.workModal__left{ text-align: left; min-width: 0; }
.workModal__title{ font-weight: 800; font-size: 28px; margin: 0 0 12px; }
.workModal__desc{ color: #555; line-height: 1.8; margin: 0 0 16px; }
.workModal__links{ display: flex; gap: 10px; margin: 14px 0 18px; }
.workModal__btn{
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid rgba(0,0,0,.12);
  font-weight: 600;
}
.workModal__btn--site{ background: #eef8ff; color: #135; }
.workModal__btn--github{ background: #f6f6f6; color: #222; }
.workModal__subhead{ font-weight: 700; margin: 16px 0 8px; }
.workModal__tech{ padding-left: 18px; color: #444; line-height: 1.8; }

/* 右側：サムネ列 + 大プレビュー */
.workModal__right{ min-width: 0; }
.workModal__thumbRow{
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 6px 10px;
  overflow-x: auto;
}
.workModal__thumbRow img{
  width: 120px;
  height: 70px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,.08);
  flex: 0 0 auto;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.workModal__thumbRow img:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
}
.workModal__thumbRow img.is-active{
  border-color:#ff7a4d;
  box-shadow: 0 0 0 2px rgba(255,122,77,.35);
}

/* 大プレビュー（必ず“全体表示”に統一） */
.workModal__screenFrame{
  padding: 2px;
  border-radius: 14px;
  background: linear-gradient(135deg,#ffb24d,#ff7a4d);
}
.workModal__screenInner{
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  /* height: clamp(360px, 70vh, 880px); */
  height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.workModal__screenInner > img{
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  background: #fff;
}

/* PCはサムネ5枚をグリッドで収める */
@media (min-width: 960px){
  .workModal__thumbRow{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 6px 6px 12px;
    overflow: visible;
  }
  .workModal__thumbRow img{ width: 100%; height: 84px; }
}

/* ---------------------------------
   Contact
---------------------------------- */
#contact{ scroll-margin-top: calc(var(--headerH) + 12px); }
.contact{ position: relative; isolation: isolate; overflow: hidden; background: #fff; color: var(--textDark); }
.contactInner{ padding: clamp(48px, 8vh, 96px) 0; }
.contactTitle{
  text-align: center;
  font-weight: 800;
  font-size: clamp(28px,5.5vw,56px);
  color: #555;
  margin: 0 0 8px;
}
.contactLead{ text-align: center; color: var(--textSoft); margin: 0 0 18px; }
.contactMail{ text-align: center; margin: 0 0 16px; }
.mailLink{
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.14);
  background: #fafafa;
  color: var(--textDark);
  text-decoration: none;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.mailLink:hover{ transform: translateY(-2px); background: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.12); }

.contactForm{
  width: min(100%, 720px);
  margin: 24px auto 0;
  display: grid;
  gap: 16px;
  text-align: left;
}
.formRow{ display: grid; gap: 6px; }
.formRow label{ font-size: .95rem; color: #333; }
.formRow input, .formRow textarea{
  width: 100%;
  font: inherit;
  line-height: 1.6;
  padding: 12px 14px;
  border: 1.5px solid rgba(0,0,0,.18);
  border-radius: 12px;
  background: #fff;
  transition: border .12s, box-shadow .12s, background .12s;
}
.formRow textarea{ resize: vertical; min-height: 180px; }
.formRow input:focus-visible, .formRow textarea:focus-visible{
  border: 2px solid #2f8c60; box-shadow: 0 0 0 4px rgba(47,140,96,.12);
}
.formRow input:user-invalid, .formRow textarea:user-invalid{
  border-color: #e25750; box-shadow: 0 0 0 3px rgba(226,87,80,.12);
}
.formActions{ display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.formNote{ color: var(--textSoft); font-size: .9rem; margin: 0; }
.sendBtn{
  padding: 12px 22px;
  border: none;
  border-radius: 999px; cursor: pointer;
  background: #111;
  color: #fff;
  font-weight: 700;
  letter-spacing: .02em;
  transition: transform .12s, box-shadow .2s, background .2s;
}
.sendBtn:hover{ transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,.2); }

/* オーロラ背景 */
.contactBg{
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
}
.contactBg--aurora{
  background:
    radial-gradient(60% 50% at 20% 30%, rgba(47,140,96,.16),  transparent 70%),
    radial-gradient(50% 60% at 78% 25%, rgba(226,87,80,.14),  transparent 70%),
    radial-gradient(40% 50% at 30% 78%, rgba(16,138,120,.14), transparent 70%),
    radial-gradient(45% 45% at 75% 75%, rgba(255,255,255,.18), transparent 70%);
  animation: contactAurora 60s ease-in-out infinite;
  filter: saturate(115%) blur(10px);
  opacity: .9;
}
@keyframes contactAurora{
  0%{   background-position: 20% 30%, 78% 25%, 30% 78%, 75% 75%; }
  50%{  background-position: 26% 36%, 68% 30%, 36% 70%, 78% 72%; }
  100%{ background-position: 20% 30%, 78% 25%, 30% 78%, 75% 75%; }
}

/* ---------------------------------
   Ending / Footer
---------------------------------- */
.ending{
  background: linear-gradient(to bottom, #222, #444);
  color: #fff; text-align: center; padding: 100px 20px;
}
.ending-title{ font-size: clamp(28px, 6vw, 52px); font-weight: 700; margin: 0; }
footer {
  background: #111;
  color: #fff;
  padding: 20px 0;
  text-align: center;
  font-size: 14px;
}

/* ---------------------------------
   TOPへ戻るボタン（右下固定）
---------------------------------- */
.backToTopArrow{
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #777;
  border: 2px solid #2f8c60; color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: background .3s, opacity .3s, transform .3s, box-shadow .3s;
}
.backToTopArrow:hover{ background: #999; transform: translateY(-3px); }
.backToTopArrow::before{
  content: "";
  position: absolute;
  left: 50%; top: 36%;
  width: 24px;
  height: 24px;
  transform: translateX(-50%) rotate(45deg);
  border-left: 4px solid #fff;
  border-top: 4px solid #fff;
}
.backToTopArrow.show{ opacity: 1; pointer-events: auto; transform: translateY(0); }
.backToTopArrow:hover{ box-shadow: 0 12px 28px rgba(0,0,0,.36); transform: translateY(0) scale(1.06); }

/* ---------------------------------
   メディアクエリ
---------------------------------- */
/* PCワイド：Works 3列 */
@media (min-width: 1024px){
  .worksGrid{ grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; }
}

/* ～900px：ヒーロー右パネル幅 */
@media (max-width: 900px){
  .dotsPanel{ width: min(52vw, 360px); right: 8px; }
}

/* ～768px：ナビ縮小 / Intro縦並び */
@media (max-width: 768px){
  :root{ --headerH: 56px; }
  .navInner{ height: var(--headerH); }
  .brand{ font-size: 1.35rem; letter-spacing: .04em; }
  .links{ gap: 18px; }
  .links a{ font-size: .95rem; }
  .heroInner{ padding-left: 24px; place-items: center; text-align: center; }
  .intro .intro-inner{ grid-template-columns: 1fr; row-gap: 20px; }
  .contactInner{ padding: clamp(40px, 6vh, 72px) 0; }
  .formActions{ flex-direction: column; align-items: flex-start; }
}

/* ～600px：ドットパネル控えめ */
@media (max-width: 600px){
  .dotsPanel{ opacity: .65; width: 78vw; right: -20px; }
}

/* アニメ軽減ポリシー */
@media (prefers-reduced-motion: reduce){
  .brand, .links a{ transition: none; }
  .dotsPanel{ animation: none; }
  #aboutParticles{ display: none; }
  .contactBg{ display: none; }
}

/* モーダル：SPは1カラム */
@media (max-width: 959px){
  .workModal__grid{ grid-template-columns: 1fr; gap: 18px; padding: 18px; }
  .workModal__screenInner{ height: 52vh; }
}
