:root {
  color-scheme: light;
  --ink: #20234a;
  --navy: #10164d;
  --blue: #3056a4;
  --aqua: #50d5d0;
  --purple: #8a68c6;
  --paper: #fbfbff;
  --line: #b6b9dc;
  --terminal-bar: #26364a;
  --terminal-body: #07111f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background-color: #15184d;
  background-image:
    radial-gradient(circle at 14px 14px, rgba(130, 238, 239, 0.28) 0 1px, transparent 1.5px),
    linear-gradient(135deg, rgba(68, 47, 130, 0.7), rgba(12, 28, 80, 0.84));
  background-size: 28px 28px, 100% 100%;
  font-family: Verdana, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a {
  color: #3153a5;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #ffca3a;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 8px 14px;
  color: #fff;
  background: #11182d;
  border: 2px solid #fff;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(1180px, calc(100% - 34px));
  margin: 26px auto;
  overflow: hidden;
  background: #eff0fa;
  border: 1px solid #fff;
  box-shadow:
    0 0 0 4px rgba(130, 147, 213, 0.68),
    0 0 0 7px rgba(255, 255, 255, 0.32),
    0 22px 70px rgba(2, 4, 25, 0.58);
}

.site-header {
  position: relative;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, #222b72 0%, #5f438f 53%, #176b7a 100%);
  background-size: 18px 18px, 18px 18px, 100% 100%;
  color: #fff;
  border-bottom: 5px solid #8adbd7;
}

.header-utility {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 16px;
  color: #d9fafa;
  background: rgba(4, 10, 45, 0.52);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.logo-area {
  position: relative;
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.logo-area::before,
.logo-area::after {
  position: absolute;
  content: "";
  width: 250px;
  height: 250px;
  border: 1px solid rgba(114, 236, 235, 0.25);
  transform: rotate(45deg);
}

.logo-area::before {
  left: -150px;
}

.logo-area::after {
  right: -150px;
}

.logo-copy {
  position: relative;
  z-index: 1;
  padding: 26px 30px 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #aef8f0;
  font: 700 0.75rem/1.2 "Courier New", monospace;
  letter-spacing: 0.35em;
  text-shadow: 1px 1px #172253;
}

.logo-copy h1 {
  margin: 0;
  color: #fff;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: clamp(2.7rem, 7vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -0.07em;
  text-shadow:
    3px 3px 0 #20245c,
    6px 6px 0 rgba(35, 14, 79, 0.38);
}

.logo-copy h1 span {
  display: inline-block;
  margin-left: 0.15em;
  color: #72ece4;
  font-size: 0.62em;
  letter-spacing: 0;
  transform: rotate(-5deg);
}

.tagline {
  display: inline-block;
  margin: 12px 0 0;
  padding: 3px 22px;
  color: #313363;
  background: #fff;
  border-left: 7px solid #79e8df;
  border-right: 7px solid #79e8df;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sparkle {
  position: absolute;
  z-index: 1;
  color: #fff7b1;
  font-size: 3rem;
  text-shadow: 0 0 14px rgba(255, 245, 151, 0.85);
  animation: twinkle 1.8s steps(2, end) infinite;
}

.sparkle-left {
  left: 12%;
  top: 38%;
}

.sparkle-right {
  right: 12%;
  top: 23%;
  animation-delay: -0.7s;
}

@keyframes twinkle {
  50% { opacity: 0.32; transform: scale(0.82); }
}

.ticker {
  overflow: hidden;
  color: #10174a;
  background: #fff4b8;
  border-top: 1px solid #fff;
  font: 700 0.82rem/2.2 "MS PGothic", "Yu Gothic", sans-serif;
  white-space: nowrap;
}

.ticker span {
  display: inline-block;
  min-width: 100%;
  padding-left: 100%;
  animation: ticker 20s linear infinite;
  animation-delay: -6s;
}

@keyframes ticker {
  to { transform: translateX(-100%); }
}

.site-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 22px;
  background-color: #f7f7fc;
  background-image: radial-gradient(#d5d6eb 0.8px, transparent 0.8px);
  background-size: 10px 10px;
}

.sidebar {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 15px;
}

.side-panel {
  position: relative;
  background: #fff;
  border: 1px solid #9ea3d1;
  box-shadow: 3px 3px 0 rgba(80, 82, 143, 0.16);
}

.side-panel h2 {
  margin: 0;
  padding: 7px 10px;
  color: #fff;
  background: linear-gradient(90deg, #263979, #6761a5);
  border-bottom: 3px double #a5eee8;
  font: 700 0.84rem/1.3 Verdana, sans-serif;
  letter-spacing: 0.12em;
}

.side-panel h2 span {
  color: #74ece3;
}

.menu-panel nav {
  display: grid;
  padding: 7px;
}

.menu-panel a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 35px;
  padding: 5px 9px 5px 22px;
  color: #263065;
  border-bottom: 1px dotted #a8acd0;
  background: linear-gradient(90deg, transparent 0 10px, #dbe0f9 10px 11px, transparent 11px);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.menu-panel a::before {
  position: absolute;
  margin-left: -16px;
  color: #7c68be;
  content: "◆";
  font-size: 0.56rem;
}

.menu-panel a:hover,
.menu-panel a.is-active {
  color: #fff;
  background: linear-gradient(90deg, #4e5aa8, #7370b4);
}

.menu-panel a:hover::before,
.menu-panel a.is-active::before {
  color: #80eee8;
}

.menu-panel small {
  color: #777da4;
  font: 400 0.69rem/1 "Courier New", monospace;
}

.menu-panel a:hover small,
.menu-panel a.is-active small {
  color: #d7f9f7;
}

.counter-panel,
.update-panel,
.profile-panel {
  padding-bottom: 10px;
  text-align: center;
}

.counter-panel p,
.update-panel p {
  margin: 11px 10px 7px;
  font-size: 0.75rem;
  line-height: 1.65;
}

.counter-panel strong {
  display: inline-block;
  margin: 3px;
  padding: 0 6px;
  color: #8eff72;
  background: #111822;
  border: 2px inset #d2d2d2;
  font: 700 1.06rem/1.5 "Courier New", monospace;
  letter-spacing: 0.14em;
  text-shadow: 0 0 5px #53d53c;
}

.counter-panel dl,
.profile-panel dl {
  margin: 8px 12px 0;
  font-size: 0.7rem;
}

.counter-panel dl div,
.profile-panel dl div {
  display: flex;
  justify-content: space-between;
  padding: 2px 5px;
  border-bottom: 1px dotted #b1b4cf;
}

.counter-panel dt,
.counter-panel dd,
.profile-panel dt,
.profile-panel dd {
  margin: 0;
}

.counter-panel dt,
.profile-panel dt {
  color: #7a6bb2;
  font-weight: 700;
}

.new-badge {
  display: inline-block;
  padding: 0 6px;
  color: #fff;
  background: #ef3f64;
  font: 700 0.67rem/1.6 Verdana, sans-serif;
  transform: rotate(-4deg);
  animation: blink 1.25s steps(2, end) infinite;
}

@keyframes blink {
  50% { opacity: 0.45; }
}

.online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  background: #2dcf72;
  border-radius: 50%;
  box-shadow: 0 0 4px #2dcf72;
}

.retro-banner {
  display: grid;
  width: 176px;
  min-height: 62px;
  margin: 0 auto;
  place-content: center;
  color: #fff;
  background:
    repeating-linear-gradient(-45deg, transparent 0 5px, rgba(255,255,255,.1) 5px 10px),
    linear-gradient(135deg, #221f6b, #8b4d9f 55%, #147984);
  border: 2px outset #e8e8ff;
  text-align: center;
  text-shadow: 2px 2px #1e1a57;
}

.retro-banner span {
  font: 900 0.85rem/1.1 Verdana, sans-serif;
  letter-spacing: 0.08em;
}

.retro-banner small {
  color: #86f8ea;
  font: 700 0.63rem/1.4 "Courier New", monospace;
  letter-spacing: 0.28em;
}

.main-content {
  min-width: 0;
}

.welcome-box {
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #aeb1d4;
  border-top: 6px solid #5e62a6;
  box-shadow: 4px 4px 0 rgba(91, 93, 148, 0.13);
}

.welcome-title-row {
  display: flex;
  gap: 15px;
  align-items: center;
  padding-bottom: 11px;
  border-bottom: 1px dotted #aaaed0;
}

.folder-icon {
  position: relative;
  display: block;
  width: 48px;
  height: 35px;
  flex: 0 0 auto;
  background: #ffd357;
  border: 2px solid #d2a83a;
  border-radius: 2px;
  box-shadow: inset 0 4px rgba(255,255,255,.35), 3px 3px 0 #e8e8f6;
}

.folder-icon::before {
  position: absolute;
  top: -9px;
  left: -2px;
  width: 22px;
  height: 9px;
  background: #ffd357;
  border: 2px solid #d2a83a;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  content: "";
}

.section-kicker,
.language-heading p {
  margin: 0;
  color: #8071b6;
  font: 700 0.68rem/1.3 "Courier New", monospace;
  letter-spacing: 0.16em;
}

.welcome-box h2 {
  margin: 1px 0 0;
  color: #26336e;
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  line-height: 1.25;
}

.welcome-box > p {
  margin: 18px 0 13px;
  font-size: 0.94rem;
}

.welcome-box code {
  padding: 2px 5px;
  color: #3f2f78;
  background: #eceaf8;
  border: 1px solid #d5d1ec;
  font-family: "Courier New", monospace;
  font-weight: 700;
}

.welcome-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  padding: 8px 11px;
  color: #4a4d79;
  background: #f2f6ff;
  border: 1px dashed #9ca9d0;
  font-size: 0.75rem;
}

.welcome-notes span::first-letter {
  color: #efbf29;
}

.content-divider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 22px 0;
  color: #8a75bf;
  font-size: 0.85rem;
}

.content-divider::before,
.content-divider::after {
  height: 1px;
  flex: 1;
  background: repeating-linear-gradient(90deg, #9498bf 0 3px, transparent 3px 7px);
  content: "";
}

.language-section {
  scroll-margin-top: 18px;
  margin-bottom: 30px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid #b9bbd4;
  box-shadow: 4px 4px 0 rgba(89, 91, 142, 0.12);
}

.language-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px dotted #aeb1ca;
}

.language-heading h2 {
  margin: 1px 0 0;
  color: #252e65;
  font: 700 1.25rem/1.1 "Trebuchet MS", Verdana, sans-serif;
}

.language-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(52, 54, 101, 0.38), 3px 3px 0 #e2e2f0;
  font: 800 0.86rem/1 Verdana, sans-serif;
}

.icon-python { background: linear-gradient(135deg, #3973a3 50%, #f0c94a 50%); }
.icon-js { color: #26221b; background: #f2d344; }
.icon-ts { background: #397db4; }
.icon-java { background: linear-gradient(135deg, #e96835, #24629b); }
.icon-c { background: #5964a9; }
.icon-cpp { background: #376ca7; font-size: 0.7rem; }
.icon-csharp { background: #7c4fa6; }
.icon-go { color: #133b46; background: #5fc8d7; }
.icon-rust { background: #a95734; }
.icon-php { background: #747bb6; font-size: 0.7rem; }
.icon-ruby { background: #c94345; }
.icon-swift { background: #ef7246; }

.file-name {
  margin-left: auto;
  padding: 2px 9px;
  color: #575b82;
  background: #ececf6;
  border: 1px solid #d1d2e4;
  font: 700 0.72rem/1.7 "Courier New", monospace;
}

.terminal {
  overflow: hidden;
  background: var(--terminal-body);
  border: 1px solid #405269;
  border-radius: 8px 8px 1px 1px;
  box-shadow: 0 10px 22px rgba(11, 18, 37, 0.28);
}

.terminal-bar {
  position: relative;
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#314258, var(--terminal-bar));
  border-bottom: 1px solid #435268;
}

.window-buttons {
  position: absolute;
  left: 15px;
  display: flex;
  gap: 8px;
}

.window-buttons i {
  display: block;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.28);
}

.window-buttons .close { background: #ff5f57; }
.window-buttons .maximize { background: #28c840; }
.window-buttons .minimize { background: #febc2e; }

.terminal-title {
  color: #f7f9fd;
  font: 600 0.77rem/1 Verdana, sans-serif;
  letter-spacing: 0.02em;
  text-shadow: 0 1px #0b1320;
}

.copy-button {
  position: absolute;
  right: 9px;
  display: grid;
  width: 35px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: #9aa8ba;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.copy-button:hover {
  color: #d8e2ed;
  background: rgba(255, 255, 255, 0.07);
}

.copy-button::after {
  position: absolute;
  right: 0;
  bottom: 38px;
  padding: 4px 7px;
  color: #eef4fb;
  background: #111b2b;
  border: 1px solid #526276;
  border-radius: 3px;
  content: "コピー";
  font: 400 0.69rem/1.2 sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
}

.copy-button:hover::after,
.copy-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.copy-button.is-copied {
  color: #63dfa8;
}

.copy-button.is-copied::after {
  content: "コピーしました";
  opacity: 1;
  transform: translateY(0);
}

.copy-icon {
  position: relative;
  display: block;
  width: 13px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 1px;
}

.copy-icon::before {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 11px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-radius: 1px;
  content: "";
}

.terminal pre {
  min-height: 88px;
  margin: 0;
  overflow-x: auto;
  padding: 24px 25px 27px;
  color: #e5edf6;
  background:
    radial-gradient(circle at 90% 15%, rgba(48, 92, 127, 0.07), transparent 45%),
    var(--terminal-body);
  font: 500 0.9rem/1.72 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  tab-size: 4;
}

.terminal code {
  font: inherit;
  white-space: pre;
}

.syn-kw { color: #c792ea; }
.syn-fn { color: #82aaff; }
.syn-str { color: #c3e88d; }
.syn-type { color: #ffcb6b; }
.syn-obj { color: #89ddff; }
.syn-pre { color: #f78c6c; }
.syn-num { color: #f78c6c; }
.syn-macro { color: #ff729d; }
.syn-op { color: #89ddff; }
.syn-punc { color: #b7c3d0; }

.back-to-top {
  text-align: right;
}

.back-to-top a {
  display: inline-block;
  padding: 5px 11px;
  color: #fff;
  background: #555a99;
  border: 2px outset #a8aad0;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.back-to-top a:active {
  border-style: inset;
}

.site-footer {
  padding: 22px 18px 18px;
  color: #dfe6ff;
  background: #151b4d;
  border-top: 5px solid #7edbd5;
  text-align: center;
  font-size: 0.72rem;
}

.site-footer p {
  margin: 3px 0;
}

.footer-nav {
  margin-bottom: 8px !important;
}

.site-footer a {
  color: #90ece5;
}

.footer-note {
  color: #9da8d4;
  font-size: 0.67rem;
}

.copy-status {
  position: fixed;
  z-index: 20;
  right: 18px;
  bottom: 18px;
  margin: 0;
  padding: 9px 14px;
  color: #fff;
  background: #172236;
  border: 1px solid #5f748e;
  border-radius: 3px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.32);
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

.copy-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 20px, 700px);
    margin: 14px auto;
  }

  .site-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-panel {
    grid-column: 1 / -1;
  }

  .menu-panel nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .menu-panel a {
    border-right: 1px dotted #a8acd0;
  }

  .profile-panel,
  .retro-banner {
    display: none;
  }

  .sparkle-left { left: 5%; }
  .sparkle-right { right: 5%; }
}

@media (max-width: 560px) {
  .page-shell {
    width: 100%;
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  .header-utility span:last-child,
  .sparkle {
    display: none;
  }

  .header-utility {
    justify-content: center;
  }

  .logo-area {
    min-height: 160px;
  }

  .logo-copy h1 {
    letter-spacing: -0.08em;
  }

  .tagline {
    padding: 3px 11px;
    font-size: 0.78rem;
  }

  .site-layout {
    gap: 16px;
    padding: 12px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .menu-panel nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .counter-panel,
  .update-panel {
    display: none;
  }

  .welcome-box,
  .language-section {
    padding: 15px;
  }

  .welcome-title-row {
    align-items: flex-start;
  }

  .welcome-notes {
    display: grid;
  }

  .file-name {
    display: none;
  }

  .terminal pre {
    padding: 20px 18px 23px;
    font-size: 0.8rem;
  }

  .window-buttons {
    left: 11px;
    gap: 6px;
  }

  .window-buttons i {
    width: 10px;
    height: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ticker span,
  .sparkle,
  .new-badge {
    animation: none;
  }

  .ticker span {
    padding-left: 14px;
  }
}
