/* ==========================================
   技術スタック（/stack/）
   使える技術は紙の切手、このサイトの作りは夜の上に点線でつないだ流れ
   ========================================== */

.stack-page {
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding-top: 32px;
  padding-bottom: 96px;
}

.stack-head { display: flex; flex-direction: column; gap: 18px; }
.stack-title {
  margin: 0;
  font-weight: 400;
  font-size: 40px;
  letter-spacing: 0.1em;
}
.stack-lead {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 17px;
  line-height: 2;
  color: var(--paper-soft);
}
.stack-toc { display: flex; flex-wrap: wrap; gap: 10px; }
.stack-toc a {
  padding: 8px 18px;
  border: 1px solid var(--mist);
  font-size: 14px;
}
.stack-toc a:hover { border-color: var(--paper); text-decoration: none; }

.stack-section { display: flex; flex-direction: column; gap: 24px; scroll-margin-top: 110px; }
.stack-section-title {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.08em;
}
.stack-section-en {
  order: 2;
  font-family: var(--font-hand);
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--mist);
}

/* ---------- 使える技術（切手） ---------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.skill-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px 24px;
  background: var(--paper);
  color: var(--night);
  outline: 2px dashed var(--lamp);
  outline-offset: -10px;
}
.skill-card:nth-child(odd) { transform: rotate(-0.6deg); }
.skill-card:nth-child(even) { transform: rotate(0.5deg); }
/* コードは項目が多いので横いっぱいに使い、中を2列にする */
.skill-card-wide { grid-column: 1 / -1; transform: rotate(-0.3deg) !important; }
.skill-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 28px;
}
.skill-note {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--sea);
}
.skill-note a { color: var(--night); text-decoration: underline; text-underline-offset: 4px; }
.skill-card-title {
  margin: 0;
  padding-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px dotted var(--mist);
  font-weight: 400;
  font-size: 21px;
}
.skill-card-en {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--mist);
}
.skill-group-title {
  margin: 0 0 8px;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--sea);
}

/* 使っているツール：枠付きの札 */
.skill-tools {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-tools li {
  padding: 4px 12px 5px;
  border: 1px solid var(--mist);
  font-size: 14px;
}

/* できること：ワインの点付きのリスト */
.skill-dos {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.skill-dos li {
  position: relative;
  padding-left: 14px;
  font-family: var(--font-hand);
  font-size: 15px;
  line-height: 1.8;
}
.skill-dos li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lamp);
}

/* ---------- このサイトの作り ---------- */
.site-map {
  padding: 28px 28px 32px;
  background: var(--sea);
}
.site-map-caption {
  margin: 0 0 14px;
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--paper-soft);
}
.site-map-caption:not(:first-child) { margin-top: 30px; }

/* 左から右へ、点線でつないだ流れ。スマホでは上から下 */
.site-flow {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}
.site-node {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 16px;
  border: 1px solid var(--paper-soft);
  background: var(--night);
}
.site-node + .site-node::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -29px;
  width: 28px;
  border-top: 2px dotted var(--paper);
}
.site-node-main { border-color: var(--lamp); box-shadow: inset 0 0 0 1px var(--lamp); }
.site-node-name { font-size: 15px; }
.site-node-note { font-size: 13px; line-height: 1.7; color: var(--paper-soft); }

.site-side {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.site-side li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px dashed var(--mist);
}

.site-notes {
  padding: 26px 28px 28px;
  background: var(--paper);
  color: var(--night);
}
.site-notes-title { margin: 0 0 12px; font-weight: 400; font-size: 19px; }
.site-notes-list {
  margin: 0;
  padding-left: 1.2em;
  font-size: 15px;
  line-height: 2;
}
.site-notes-list strong { color: var(--lamp); font-weight: 400; }

.stack-contact {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 16px;
  text-align: center;
}
.stack-contact a {
  margin-left: 8px;
  padding: 8px 18px;
  display: inline-block;
  background: var(--lamp);
  font-family: var(--font-main);
}
.stack-contact a:hover { text-decoration: none; filter: brightness(1.1); }

@media (max-width: 768px) {
  .stack-page { gap: 44px; }
  .stack-title { font-size: 30px; }
  .stack-section-title { font-size: 23px; }

  .skill-grid { grid-template-columns: 1fr; gap: 18px; }
  .skill-card { padding: 20px 20px 22px; }
  .skill-groups { grid-template-columns: 1fr; }

  .site-map { padding: 22px 18px 24px; }
  .site-flow { grid-template-columns: 1fr; gap: 22px; }
  .site-node + .site-node::before {
    top: -23px;
    left: 50%;
    width: 0;
    height: 22px;
    border-top: 0;
    border-left: 2px dotted var(--paper);
  }
  .site-side { grid-template-columns: 1fr; }
  .site-notes { padding: 22px 20px 24px; }

  .stack-contact a { display: block; margin: 12px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skill-card:nth-child(odd),
  .skill-card:nth-child(even),
  .skill-card-wide { transform: none !important; }
}
