/* ======================================
   mt-tk.com — Bento Grid hub
   ====================================== */

:root {
  --c-main: #04384C;
  --c-dark: #032A39;
  --c-base: #FFFFFF;
  --c-sub-bg: #F5F5F5;
  --c-text: #333333;
  --c-text-mute: #888888;
  --c-accent: #4A90D9;
  --c-border: #E5E5E5;

  --font-jp: "Shippori Mincho B1", serif;
  --font-en: "Cormorant Garamond", "Times New Roman", serif;
  --font-sys: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", sans-serif;

  --gap: 16px;
  --radius: 8px;
}

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

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

body {
  margin: 0;
  background: var(--c-base);
  color: var(--c-text);
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; height: auto; }

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

/* ======================================
   Layout: Hub
   ====================================== */

.l-hub {
  max-width: 720px;
  margin: 0 auto;
  padding: 120px 24px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

/* ---- Header / Profile ---- */

.l-hub__header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
  animation-delay: 0ms;
}

.l-hub__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 8px;
}

@media (min-width: 768px) {
  .l-hub__avatar {
    width: 120px;
    height: 120px;
  }
}

.l-hub__name {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
  letter-spacing: 0.04em;
  color: var(--c-main);
}

.l-hub__name-en {
  font-family: var(--font-en);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--c-text-mute);
  margin: 0;
  letter-spacing: 0.04em;
}

.l-hub__role {
  font-size: 0.9375rem;
  color: var(--c-text);
  margin: 8px 0 0;
  letter-spacing: 0.04em;
}


/* ---- Bento Grid ---- */

.l-hub__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "main-1 main-1 main-2 main-2"
    "sub    sub    sns-1  sns-2"
    "sub    sub    sns-3  sns-3";
  gap: var(--gap);
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
  animation-delay: 300ms;
}

/* ---- Card: common ---- */

.c-card {
  grid-area: var(--card-area);
  border-radius: var(--radius);
  transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* ---- Card: main (Portfolio / Blog) ---- */

.c-card--main {
  background: linear-gradient(180deg, #0A4A62 0%, #04384C 100%);
  color: #FFFFFF;
  padding: 32px;
  min-height: 180px;
  justify-content: space-between;
  gap: 24px;
}

.c-card--main .c-card__title {
  font-family: var(--font-jp);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: 0.04em;
}

.c-card--main .c-card__desc {
  font-family: var(--font-sys);
  font-size: 0.8125rem;
  font-weight: 400;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.c-card--main .c-card__cta {
  font-family: var(--font-en);
  font-style: normal;
  font-weight: 500;
  font-size: 1.0625rem;
  color: rgba(255, 255, 255, 0.9);
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.06em;
}

.c-card--main .c-card__arrow {
  display: inline-block;
  color: var(--c-accent);
  transition: transform 0.3s ease;
}

.c-card--main:hover {
  background: linear-gradient(180deg, #04384C 0%, #032A39 100%);
  transform: translateY(-3px);
}

.c-card--main:hover .c-card__arrow {
  transform: translateX(4px);
}

/* ---- Card: sub (Frontend) ---- */

.c-card--sub {
  background: var(--c-sub-bg);
  color: var(--c-main);
  border: 1px solid var(--c-border);
  padding: 24px;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  cursor: default;
}

.c-card--sub .c-card__motif {
  font-size: 1.75rem;
  color: var(--c-main);
  margin-bottom: 6px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.3s ease;
}

.c-card--sub .c-card__title {
  font-family: var(--font-jp);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--c-main);
}

.c-card--sub .c-card__desc {
  font-family: var(--font-sys);
  font-size: 0.75rem;
  margin: 0;
  color: var(--c-text-mute);
  letter-spacing: 0.04em;
}

.c-card--sub:hover {
  background: #FAFAFA;
}

.c-card--sub:hover .c-card__motif {
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---- Card: SNS icon ---- */

.c-card--icon {
  background: var(--c-base);
  border: 1px solid var(--c-border);
  min-height: 110px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
}

/* SNS各社のブランドガイドライン準拠カラー */
.c-card--icon-x      { color: #000000; }
.c-card--icon-zenn   { color: #3EA8FF; }
.c-card--icon-github { color: #181717; }

.c-card--icon .c-card__icon {
  width: 24px;
  height: 24px;
}

.c-card--icon .c-card__label {
  font-family: var(--font-sys);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--c-text-mute);
  letter-spacing: 0.05em;
}

/* hover はカードの動きと border のみで反応を表現
   （アイコン色は規約準拠のため変えない） */
.c-card--icon:hover {
  border-color: var(--c-main);
  transform: translateY(-2px);
}

/* ---- Footer ---- */

.l-hub__footer {
  text-align: center;
  color: var(--c-text-mute);
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
  animation-delay: 500ms;
}

.l-hub__footer small {
  font-family: var(--font-sys);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

/* ======================================
   Animations
   ====================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ======================================
   Dark Mode (OS preference)
   ====================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --c-main: #7AB8D9;
    --c-dark: #5A98C0;
    --c-base: #0D1117;
    --c-sub-bg: #161B22;
    --c-text: #E6EDF3;
    --c-text-mute: #8B949E;
    --c-accent: #6BB4F0;
    --c-border: #30363D;
  }

  /* Main card: brighten gradient so it stays visible on dark bg */
  .c-card--main {
    background: linear-gradient(180deg, #155A7A 0%, #0A4A62 100%);
  }

  .c-card--main:hover {
    background: linear-gradient(180deg, #1B6E94 0%, #155A7A 100%);
  }

  /* SNS icon brand-compliant alternates for dark backgrounds
     X: official guideline allows white on dark
     GitHub: official guideline recommends white on dark
     Zenn: brand color (#3EA8FF) stays */
  .c-card--icon-x      { color: #FFFFFF; }
  .c-card--icon-github { color: #FFFFFF; }

  /* Avatar: illustration has black linework + light skin tones,
     so it disappears into dark backgrounds. Add a white circle backdrop. */
  .l-hub__avatar {
    background: #FFFFFF;
  }
}

/* ======================================
   Responsive: Mobile (<= 767px)
   ====================================== */

@media (max-width: 767px) {
  .l-hub {
    padding: 80px 20px;
    gap: 60px;
  }

  .l-hub__name { font-size: 2rem; }
  .l-hub__name-en { font-size: 1rem; }
  .l-hub__role { font-size: 0.875rem; }

  .l-hub__grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "main-1 main-1 main-1"
      "main-2 main-2 main-2"
      "sub    sub    sub"
      "sns-1  sns-2  sns-3";
    gap: 12px;
  }

  .c-card--main {
    padding: 24px;
    min-height: 140px;
  }

  .c-card--main .c-card__title { font-size: 1rem; }
  .c-card--main .c-card__desc { font-size: 0.75rem; }
  .c-card--main .c-card__cta { font-size: 0.9375rem; }

  .c-card--sub { padding: 20px; min-height: 120px; }
  .c-card--icon { padding: 16px; }
  .c-card--icon .c-card__icon { width: 22px; height: 22px; }
}
