/* ===================================================
   鈴木研究室 HP — Dark Neumorphism Design
   Soka University Human Interaction Lab
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=BIZ+UDPGothic:wght@400;700&display=swap');

/* ========== DESIGN TOKENS ========== */
:root {
  /* Soka University Colors */
  --soka-blue:       #004098;
  --soka-blue-light: #4d90e0;
  --soka-gold:       #d4a843;
  --soka-red:        #e60012;

  /* Dark palette */
  --bg-base:   #0f172a;
  --bg-card:   #162032;
  --bg-nav:    #0a0f1e;
  --bg-footer: #080d1a;

  /* Neumorphism shadows */
  --nm-dark:  rgba(6, 11, 24, 0.85);
  --nm-light: rgba(28, 46, 78, 0.6);
  --nm-shadow:       8px 8px 20px var(--nm-dark), -8px -8px 20px var(--nm-light);
  --nm-shadow-sm:    4px 4px 12px var(--nm-dark), -4px -4px 12px var(--nm-light);
  --nm-shadow-hover: 12px 12px 30px var(--nm-dark), -12px -12px 30px var(--nm-light);

  /* Border radius */
  --radius-card: 20px;
  --radius-btn:  12px;
  --radius-sm:   8px;

  /* Text */
  --text-primary:   #e2e8f4;
  --text-secondary: #94a3b8;
  --text-muted:     #5a7090;
  --text-link:      #60a5fa;
  --text-link-hover:#93c5fd;

  /* ========== 流体タイポグラフィ ==========
     clamp(最小, 画面幅比例, 最大)
     → スマホは画面幅に比例、PC上限で固定
     ---------------------------------------- */
  --font-family: 'BIZ UDPGothic', 'Noto Sans JP', 'Helvetica Neue', Arial,
                 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;

  --fs-xs:   clamp(11px, 2.8vw,  13px);
  --fs-sm:   clamp(13px, 3.4vw,  15px);
  --fs-base: clamp(15px, 4.2vw,  18px);
  --fs-md:   clamp(16px, 4.8vw,  20px);
  --fs-lg:   clamp(18px, 5.2vw,  23px);
  --fs-xl:   clamp(21px, 6.4vw,  28px);
  --fs-2xl:  clamp(24px, 8.5vw,  36px);
  --fs-3xl:  clamp(28px, 10vw,   48px);

  --lh: 1.9;
  --ls: 0.025em;

  /* Spacing */
  --sp-xs: 8px;
  --sp-sm: 16px;
  --sp-md: 28px;
  --sp-lg: 44px;
  --sp-xl: 64px;

  /* Transition */
  --tr: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Nav height */
  --nav-h: 64px;
}

/* ========== GLOBAL RESET ========== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-base);
  line-height: var(--lh);
  letter-spacing: var(--ls);
  color: var(--text-primary);
  /* desktop background image (fallback color kept) */
  background: var(--bg-base) url("images/background.jpg") center/cover no-repeat fixed !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  /* 日本語の禁則処理 */
  line-break: strict;
  overflow-wrap: anywhere;
}

/* ========== TYPOGRAPHY ========== */
h1 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.03em;
  margin: 0 0 var(--sp-sm) 0;
  color: var(--text-primary);
  text-align: center;
  /* 1文字残り防止 */
  text-wrap: balance;
}

h2 {
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 var(--sp-md) 0;
  color: var(--text-primary);
  text-align: center;
  text-wrap: balance;
}

h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  text-align: center;
  margin: var(--sp-md) 0 var(--sp-sm) 0;
  color: var(--soka-blue-light);
  text-wrap: balance;
}

p {
  font-size: var(--fs-base);
  line-height: var(--lh);
  margin: var(--sp-sm) var(--sp-md);
  color: var(--text-primary);
  text-align: center;
  /* 段落末の1文字残り防止 */
  text-wrap: pretty;
}

address {
  font-style: normal;
  text-align: center;
  color: var(--text-secondary);
  padding: var(--sp-sm);
  font-size: var(--fs-base);
  text-wrap: balance;
}

a {
  display: inline;
  color: var(--text-link);
  text-decoration: none;
  transition: var(--tr);
}

a:hover {
  color: var(--text-link-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

iframe {
  max-width: 100%;
  width: 100%;
  border-radius: var(--radius-sm);
}

/* ========== LAYOUT ========== */
.wrapper {
  padding-top: calc(var(--nav-h) + 16px);
  min-height: 100vh;
  position: relative;
  padding-bottom: 100px;
  box-sizing: border-box;
}

.description {
  width: min(92%, 1000px);
  margin: 0 auto;
  padding-top: var(--sp-sm);
  padding-bottom: var(--sp-sm);
}

/* ========== NAVIGATION ========== */
.fixed-nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  height: var(--nav-h);
  background: var(--bg-nav);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(77, 144, 224, 0.15);
  border-bottom: 1px solid rgba(77, 144, 224, 0.12);
}

.fixed-nav-bar li,
.fixed-nav-bar a {
  height: var(--nav-h);
  line-height: var(--nav-h);
}

.menu {
  width: min(92%, 1200px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  position: relative;
}

.sitename {
  display: inline-flex;
  align-items: center;
  height: var(--nav-h);
  line-height: var(--nav-h);
  margin-right: auto;
  font-size: clamp(12px, 2.8vw, 15px);
  font-weight: 700;
  color: var(--text-primary) !important;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sitename:hover {
  color: var(--soka-blue-light) !important;
}

.menu-items {
  display: inline-flex;
  gap: clamp(4px, 1.5vw, 16px);
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-items li {
  display: inline-block;
  margin: 0;
}

.menu a,
.menu a:visited {
  display: inline-block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: clamp(12px, 2.8vw, 15px);
  font-weight: 500;
  padding: 0 clamp(6px, 1.5vw, 14px);
  height: var(--nav-h);
  line-height: var(--nav-h);
  position: relative;
  transition: color 0.25s ease;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.menu a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--soka-blue-light), var(--soka-gold));
  transition: width 0.3s ease;
  border-radius: 2px;
}

.menu a:hover,
.menu a:focus {
  color: var(--text-primary);
  text-decoration: none;
}

.menu a:hover::after,
.menu a:focus::after {
  width: 70%;
}

.menu .sitename::after {
  display: none;
}

.show,
.hide {
  display: none;
  background-image: none;
  background-color: transparent;
  /* 元のリンクテキスト "Menu" を非表示 */
  font-size: 0;
  color: transparent;
  line-height: var(--nav-h);
  padding: 0;
}

.show::before,
.hide::before {
  font-size: 26px;
  color: var(--text-secondary);
  display: inline-block;
  line-height: var(--nav-h);
}

/* ========== NEUMORPHIC CARDS ========== */
.container {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--nm-shadow);
  margin: var(--sp-lg) 0;
  padding: var(--sp-lg) var(--sp-xl);
  border: 1px solid rgba(77, 144, 224, 0.08);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--soka-blue) 0%,
    var(--soka-blue-light) 40%,
    var(--soka-gold) 70%,
    var(--soka-blue-light) 100%
  );
  opacity: 0.7;
}

.container:hover {
  box-shadow: var(--nm-shadow-hover);
  transform: translateY(-3px);
}

/* index.html — 最初のカードをヒーロー調に */
.description .container:first-child {
  background: linear-gradient(145deg, #0d1e40 0%, #162032 100%);
  padding: var(--sp-xl) var(--sp-xl);
}

.description .container:first-child h1 {
  font-size: clamp(22px, 6vw, 42px);
  background: linear-gradient(135deg, #e2e8f4 30%, var(--soka-blue-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== SECTION HEADING ========== */
.under {
  border-bottom: 3px solid var(--soka-gold);
  padding: 0 0.5rem 0.6rem;
  color: var(--text-primary);
}

.center {
  text-align: center;
  margin-bottom: var(--sp-md);
}

/* ========== ITEM / LISTS ========== */
.item {
  padding: var(--sp-sm) var(--sp-md);
}

.item ul {
  text-align: left;
  margin: var(--sp-sm) 0;
  padding-left: var(--sp-lg);
  color: var(--text-primary);
  list-style: disc;
}

.item ul li {
  margin-bottom: var(--sp-xs);
  font-size: var(--fs-base);
  line-height: var(--lh);
  color: var(--text-primary);
  text-wrap: pretty;
}

/* ========== INLINE LINKS ========== */
.item a,
.description p a,
address a {
  display: inline;
  color: var(--text-link);
  text-decoration: none;
  border-bottom: 1px solid rgba(96, 165, 250, 0.35);
  transition: var(--tr);
}

.item a:hover,
.description p a:hover,
address a:hover {
  color: var(--text-link-hover);
  border-bottom-color: var(--text-link-hover);
  text-decoration: none;
}

/* ========== HOME MENU BUTTONS ========== */
.item > p > a {
  display: inline-block;
  background: var(--bg-card);
  color: var(--text-link) !important;
  padding: 14px 44px;
  border-radius: var(--radius-btn);
  box-shadow: var(--nm-shadow-sm);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid rgba(77, 144, 224, 0.15);
  transition: var(--tr);
  margin: var(--sp-xs);
  text-decoration: none;
  white-space: nowrap;
}

.item > p > a:hover {
  box-shadow: var(--nm-shadow-hover);
  color: var(--text-primary) !important;
  transform: translateY(-3px);
  background: linear-gradient(135deg, var(--bg-card), #1a2d50);
  text-decoration: none;
}

/* ========== SCROLL ANIMATION ========== */
.effect-fade {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.effect-fade.effect-scroll {
  opacity: 1;
  transform: translateY(0);
}

/* ========== IFRAME / MEDIA ========== */
.iframe-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: var(--sp-md) auto;
  overflow: hidden;
  border-radius: var(--radius-sm);
  box-shadow: var(--nm-shadow-sm);
}

.iframe-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.iframe-wrap {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  box-shadow: var(--nm-shadow-sm);
}

.iframe-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ========== LOGO ROW ========== */
.logo-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-md);
  margin: var(--sp-md) auto;
  text-align: center;
}

.logo-row a {
  display: block;
  width: auto;
  max-width: 200px;
  border-bottom: none !important;
  transition: transform 0.3s ease;
}

.logo-row a:hover {
  transform: scale(1.06);
  border-bottom: none !important;
}

.tool-logo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  filter: brightness(0.88) contrast(1.05);
}

/* ========== FOOTER ========== */
footer {
  width: 100%;
  background: var(--bg-footer);
  border-top: 1px solid rgba(77, 144, 224, 0.12);
  color: var(--text-muted);
  text-align: center;
  padding: var(--sp-md) 0;
  position: absolute;
  bottom: 0;
}

.copyright {
  text-align: center;
  padding: var(--sp-xs) 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.copyright a {
  display: inline;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: none;
}

.copyright a:hover {
  color: var(--text-secondary);
}

/* ========== 取材申し込みボタン ========== */
.interview-link-wrap {
  text-align: center;
  margin: var(--sp-md) 0 var(--sp-sm);
}

.interview-link {
  display: inline-block;
  background: linear-gradient(135deg, #0a2d70, var(--soka-blue));
  color: #fff !important;
  padding: 14px 44px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: 0.05em;
  box-shadow: var(--nm-shadow-sm);
  border: 1px solid rgba(77, 144, 224, 0.25);
  transition: var(--tr);
  text-decoration: none;
  white-space: nowrap;
}

.interview-link:hover {
  background: linear-gradient(135deg, var(--soka-blue), #1a4aa0);
  box-shadow: var(--nm-shadow-hover);
  transform: translateY(-3px);
  color: #fff !important;
  text-decoration: none;
}

/* ========== CARD UTILITY ========== */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--nm-shadow-hover);
}

/* =============================
   PC / WIDE SCREEN (900px+)
   ============================= */
@media only screen and (min-width: 900px) {
  :root {
    --nav-h: 68px;
  }

  .fixed-nav-bar li,
  .fixed-nav-bar a {
    height: var(--nav-h);
    line-height: var(--nav-h);
  }

  .container {
    padding: var(--sp-xl) calc(var(--sp-xl) * 1.3);
    margin: var(--sp-xl) 0;
  }

  .description .container:first-child {
    padding: calc(var(--sp-xl) * 1.4) calc(var(--sp-xl) * 1.3);
  }

  p {
    margin: var(--sp-sm) var(--sp-xl);
  }

  .item {
    padding: var(--sp-sm) var(--sp-xl);
  }

  /* PC: リスト横並びレイアウト */
  .item ul {
    padding-left: calc(var(--sp-xl) + 8px);
  }
}

/* =============================
   MOBILE (767px 以下)
   ============================= */
@media only screen and (max-width: 767px) {
  :root {
    /* clamp() がすでに画面幅基準なので
       モバイルで追加の上書きは不要。
       カード・間隔のみ縮小する。 */
    --nm-shadow:       5px 5px 14px var(--nm-dark), -5px -5px 14px var(--nm-light);
    --nm-shadow-sm:    3px 3px 8px  var(--nm-dark), -3px -3px 8px  var(--nm-light);
    --nm-shadow-hover: 7px 7px 18px var(--nm-dark), -7px -7px 18px var(--nm-light);
    --radius-card: 14px;
    --sp-lg: 20px;
    --sp-xl: 20px;
    --nav-h: 56px;
  }

  /* Mobile: use smaller background image optimized for phones */
  body {
    background-image: url("images/backgroundsp.jpg") !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
  }

  .fixed-nav-bar {
    height: var(--nav-h);
  }

  .fixed-nav-bar li,
  .fixed-nav-bar a {
    height: var(--nav-h);
    line-height: var(--nav-h);
  }

  .menu {
    position: relative;
    width: 100%;
    max-width: none;
    padding: 0 var(--sp-sm);
  }

  .sitename {
    position: absolute;
    top: 0;
    left: 15px;
    margin-right: 0;
    /* clamp で自動スケール済 */
  }

  .menu-items {
    display: none;
    position: fixed;
    top: var(--nav-h);
    right: 0;
    left: auto;
    width: min(200px, 60vw);
    flex-direction: column;
    gap: 0;
    background: rgba(10, 15, 30, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid rgba(77, 144, 224, 0.2);
    border-bottom: 1px solid rgba(77, 144, 224, 0.2);
    border-bottom-left-radius: 12px;
    box-shadow: -4px 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    padding: 0;
    list-style: none;
  }

  .menu-items li {
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(77, 144, 224, 0.1);
    margin: 0;
  }

  .menu-items a,
  .menu-items a:visited {
    display: block;
    width: 100%;
    padding: 14px 20px;
    height: auto;
    line-height: 1.5;
    text-align: center;
    letter-spacing: 0.06em;
    font-weight: 500;
    color: var(--text-primary);
  }

  .menu-items a:hover {
    background: rgba(77, 144, 224, 0.1);
    color: var(--soka-blue-light);
  }

  .menu-items a::after {
    display: none;
  }

  .menu > .show,
  .menu > .hide {
    position: absolute;
    top: 0;
    right: 15px;
    display: inline-block;
    font-size: 0;
    color: transparent;
    padding-left: 0;
    background-image: none;
    height: var(--nav-h);
    line-height: var(--nav-h);
  }

  .menu > .show::before {
    content: '☰';
    font-size: 26px;
    color: var(--text-secondary);
    line-height: var(--nav-h);
    display: inline-block;
  }

  .menu > .hide::before {
    content: '✕';
    font-size: 26px;
    color: var(--text-secondary);
    line-height: var(--nav-h);
    display: inline-block;
  }

  /* control visibility with greater specificity */
  .menu:not(:target) > .hide { display: none !important; }
  .menu:target > .show { display: none !important; }
  .menu:target > .menu-items { display: flex; }

  .wrapper {
    padding-bottom: 90px;
  }

  .description {
    width: 96%;
  }

  .container {
    margin: var(--sp-md) 0;
    padding: var(--sp-md) var(--sp-sm);
  }

  /* ヒーローカードもモバイル向け縮小 */
  .description .container:first-child {
    padding: var(--sp-lg) var(--sp-sm);
  }

  p {
    margin: var(--sp-xs) var(--sp-sm);
  }

  .item {
    padding: var(--sp-xs) var(--sp-sm);
  }

  .item ul {
    margin: var(--sp-sm) 0;
    padding-left: var(--sp-md);
  }

  .under {
    padding: 0 0.2rem 0.4rem;
    border-bottom-width: 2px;
  }

  .center {
    margin-bottom: var(--sp-sm);
  }

  .item > p > a {
    padding: 11px 28px;
  }

  .logo-row {
    flex-direction: column;
    gap: var(--sp-sm);
  }

  .logo-row a {
    max-width: 140px;
  }

  .interview-link {
    padding: 12px 28px;
  }
}

/* 極小画面 (380px 以下) */
@media only screen and (max-width: 380px) {
  .sitename {
    /* clamp 最小値で十分だが念のため */
    max-width: calc(100% - 60px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
