@charset "UTF-8";

:root {
  --bg-color: #0a0a0c;
  --text-main: #e0e0e0;
  --text-sub: #7a7a85;
  --lamp-off: #2a2a35;
  --lamp-on: #00d2ff;

  --font-serif: "Times New Roman", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  --font-sans: "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-serif);
  margin: 0;
  line-height: 2.4;
  /* Index default */
  letter-spacing: 0.04em;
  position: relative;
}

/* Language: Japanese Overrides */
html[lang="ja"] body {
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  letter-spacing: 0.08em;
}

/* Layout: Documentation (Signal, Principles) */
body.layout-doc {
  line-height: 2.2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

html[lang="ja"] body.layout-doc {
  letter-spacing: 0.06em;
}

/* --- Shared Components --- */

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Doc layout often uses wider container */
body.layout-doc .container {
  max-width: 1100px;
  padding: 60px 24px;
  width: 100%;
  box-sizing: border-box;
}

/* Links */
a {
  color: var(--text-sub);
  text-decoration: none;
  transition: color 0.25s ease, border-color 0.25s ease;
}

a:hover {
  color: var(--lamp-on);
}

/* Lamp Icon */
.lamp-icon {
  width: 12px;
  height: 12px;
  background-color: var(--lamp-off);
  border-radius: 50%;
  margin: 0 auto 40px;
  transition: all 1.5s ease-in-out;
}

/* On Doc pages, lamp icon is sometimes always on or behaves differently */
body.layout-doc .lamp-icon {
  background-color: var(--lamp-on);
  box-shadow: 0 0 20px var(--lamp-on), 0 0 60px rgba(0, 210, 255, 0.4);
  display: inline-block;
  margin: 0;
  /* Wrapper handles margin */
  animation: breathe 6s infinite ease-in-out;
}

.lamp-active {
  background-color: var(--lamp-on);
  box-shadow: 0 0 20px var(--lamp-on), 0 0 60px rgba(0, 210, 255, 0.4);
  animation: breathe 6s infinite ease-in-out;
}

@keyframes breathe {
  0% {
    opacity: 0.6;
    transform: scale(0.95);
  }

  50% {
    opacity: 1.0;
    transform: scale(1.05);
  }

  100% {
    opacity: 0.6;
    transform: scale(0.95);
  }
}

/* Language Switcher (Index) */
.lang-switch {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 100;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.lang-switch a {
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: all 0.25s ease;
}

.lang-switch a:hover {
  border-bottom-color: var(--lamp-on);
}

/* Footer */
footer {
  text-align: center;
  padding: 80px 0 60px;
  /* Index */
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-sub);
  border-top: 1px solid #1a1a20;
  /* Index */
  margin-top: 60px;
  /* Index */
}

/* Doc Footer Adjustments */
body.layout-doc footer {
  margin-top: 80px;
  padding-top: 40px;
  padding-bottom: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  /* Slightly different color in principles? Keeping Index default #1a1a20 is probably fine or use css variable */
  display: flex;
  justify-content: center;
  /* principles/signal/index.html have centered content via container or flex */
}

/* Principles/Signal sometimes use flex space-between, but simple center is robust */

.link-footer {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  opacity: 0.6;
  border-bottom: 1px solid rgba(122, 122, 133, 0.4);
  padding-bottom: 2px;
  display: inline-block;
  margin-top: 16px;
  /* Index */
}

body.layout-doc .link-footer {
  margin-top: 0;
}

/* --- Index Specific --- */
section {
  padding: 100px 0;
}

h1,
h2,
h3 {
  font-weight: normal;
  margin: 0;
}

.section-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  display: block;
  margin-bottom: 24px;
  opacity: 0.5;
}

#hero {
  text-align: center;
  padding: 160px 0 100px;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-copy {
  font-size: 2.6rem;
  line-height: 1.4;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

html[lang="ja"] .hero-copy {
  line-height: 1.6;
  letter-spacing: 0.1em;
}

.hero-sub {
  font-size: 0.9rem;
  color: var(--text-sub);
  font-family: var(--font-sans);
  letter-spacing: 0.15em;
}

.message-p {
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  text-align: left;
}

html[lang="ja"] .message-p {
  text-align: justify;
  text-justify: inter-ideograph;
}

strong {
  font-weight: bold;
  color: #fff;
  font-size: 1.2rem;
  display: block;
  margin-bottom: 1.5rem;
}

/* Doc pages use strong differently */
body.layout-doc strong {
  font-size: 1rem;
  display: inline;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(0, 210, 255, 0.3);
}

/* Link List (Index) */
.paths {
  margin-top: 12px;
  border-top: 1px solid #1a1a20;
  padding-top: 36px;
}

.paths-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.paths-list li {
  margin: 0 0 22px 0;
}

.link-path {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  display: inline-block;
  border-bottom: 1px solid rgba(122, 122, 133, 0.6);
  padding-bottom: 2px;
}

html[lang="ja"] .link-path {
  letter-spacing: 0.14em;
}

.paths-desc {
  margin: 6px 0 0 0;
  color: var(--text-sub);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  font-family: var(--font-sans);
  line-height: 1.6;
}

html[lang="ja"] .paths-desc {
  letter-spacing: 0.05em;
}

/* New Link Group Styles */
.paths-group {
  margin-bottom: 40px;
}

.paths-group-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-sub);
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 20px;
  display: block;
}

/* Lamp Link Style */
.link-with-lamp {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-bottom: none !important;
  /* Remove underline for this specific style */
}

.link-lamp-icon {
  width: 10px;
  height: 10px;
  background-color: var(--lamp-off);
  border-radius: 50%;
  transition: all 0.5s ease;
  display: inline-block;
}

.link-with-lamp:hover .link-lamp-icon {
  background-color: var(--lamp-on);
  box-shadow: 0 0 10px var(--lamp-on), 0 0 20px rgba(0, 210, 255, 0.4);
}

.link-with-lamp span {
  border-bottom: 1px solid rgba(122, 122, 133, 0.6);
  padding-bottom: 2px;
  transition: border-color 0.25s ease;
}

.link-with-lamp:hover span {
  border-bottom-color: var(--lamp-on);
  color: var(--lamp-on);
}

/* --- Documentation Specific (Signal / Principles) --- */

/* Header */
body.layout-doc header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 60px;
}

body.layout-doc h1 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 0;
  opacity: 0.7;
}

.link-nav {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
}

.lamp-wrapper {
  text-align: center;
  margin-bottom: 60px;
}

/* Grid */
.protocol-grid,
.principles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 60px;
  padding-top: 0;
  margin-bottom: 80px;
  /* principles */
}

.column {
  display: flex;
  flex-direction: column;
}

.col-label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--lamp-on);
  margin-bottom: 32px;
  display: block;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.layout-doc p {
  font-size: 0.95rem;
  margin: 0 0 1.5rem 0;
  text-align: left;
}

/* Intro/Outro (Principles) */
.intro-block {
  text-align: center;
  margin-bottom: 80px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 60px;
}

.outro-block {
  text-align: center;
  margin-bottom: 60px;
}

.intro-p {
  font-size: 1.0rem;
  line-height: 2.4;
  margin-bottom: 0;
}

.footer-note {
  display: block;
  margin-bottom: 20px;
  opacity: 0.6;
}

/* Symbols (Principles) */
.symbol {
  height: 24px;
  margin-bottom: 24px;
  border-color: var(--lamp-on);
  opacity: 0.8;
  display: inline-block;
}

.sym-boundary {
  border-left: 2px solid var(--lamp-on);
  width: 0;
}

.sym-hold {
  border-left: 2px solid var(--lamp-on);
  border-right: 2px solid var(--lamp-on);
  width: 6px;
}

.sym-gate {
  border-left: 2px solid var(--lamp-on);
  border-right: 2px solid var(--lamp-on);
  width: 14px;
  position: relative;
}

.sym-gate::before,
.sym-gate::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 2px;
  background-color: var(--lamp-on);
  left: 0;
}

.sym-gate::before {
  top: 0;
  box-shadow: 10px 0 0 var(--lamp-on);
}

.sym-gate::after {
  bottom: 0;
  box-shadow: 10px 0 0 var(--lamp-on);
}


/* --- Media Queries --- */
@media (max-width: 600px) {

  /* Index */
  .hero-copy {
    font-size: 1.8rem;
    line-height: 1.3;
  }

  html[lang="ja"] .hero-copy {
    line-height: 1.5;
  }

  #hero {
    padding: 100px 0 60px;
  }

  .lang-switch {
    top: 20px;
    right: 20px;
  }

  /* Doc */
  .message-p {
    text-align: left;
  }
}

@media (max-width: 900px) {

  /* Doc */
  body.layout-doc {
    display: block;
    padding-top: 60px;
  }

  .protocol-grid,
  .principles-grid {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .column {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 24px;
  }

  .lamp-wrapper {
    margin-bottom: 40px;
  }

  .symbol {
    display: none;
  }

  .intro-block,
  .outro-block {
    text-align: left;
  }
}