/* Tenki Link — Tokyo's Connected Microclimates */
/* Handwritten CSS — no frameworks, no utilities */
/* ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Lora', Georgia, serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: #312E81;
  background-color: #F5F3FF;
  -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
  line-height: 1.25;
  color: #312E81;
  margin-bottom: 0.6em;
}

h1 {
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 1.7rem;
  margin-top: 1.8em;
}

h3 {
  font-size: 1.3rem;
  font-weight: 400;
  margin-top: 1.5em;
  color: #6D28D9;
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.3em;
  color: #312E81;
}

p {
  margin-bottom: 1.1em;
  max-width: 680px;
}

a {
  color: #8B5CF6;
  text-decoration: none;
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  transition: color 0.2s ease;
}

a:hover {
  color: #7C3AED;
  text-decoration: underline;
}

strong {
  font-weight: 600;
  color: #312E81;
}

/* --- Header --- */
.net-head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: #F5F3FF;
  border-bottom: 1px solid #DDD6FE;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.net-head .logo {
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 1px;
  color: #312E81;
  text-decoration: none;
}

.net-head .logo span {
  color: #8B5CF6;
}

.net-head nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.net-head nav a {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.9rem;
  color: #6D28D9;
  text-decoration: none;
}

.net-head nav a:hover {
  color: #7C3AED;
  text-decoration: underline;
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #312E81;
  margin: 5px 0;
  transition: 0.3s;
}

/* --- Main Content --- */
main {
  padding-top: 60px;
  min-height: 100vh;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- SVG Network Graph --- */
.net-viz {
  text-align: center;
  padding: 40px 0 30px;
}

.net-viz svg {
  max-width: 100%;
  height: auto;
}

.net-viz .net-label {
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  fill: #FFFFFF;
  pointer-events: none;
}

.net-line {
  transition: stroke-width 0.5s ease;
}

/* --- Intro Section --- */
.link-hero {
  text-align: center;
  padding: 20px 0 40px;
  border-bottom: 1px solid #DDD6FE;
  margin-bottom: 40px;
}

.link-hero h1 {
  font-size: 1.9rem;
  margin-bottom: 0.5em;
}

.link-hero p {
  font-size: 1.15rem;
  color: #6D28D9;
  max-width: 600px;
  margin: 0 auto;
  font-family: 'Lora', Georgia, serif;
  font-weight: 400;
  line-height: 1.6;
}

/* --- Node Cards --- */
.node-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 30px 0 50px;
}

.node-card {
  background-color: #FFFFFF;
  border: 1px solid #DDD6FE;
  border-radius: 8px;
  padding: 22px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.node-card:hover {
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.08);
  border-color: #C4B5FD;
}

.node-card h3 {
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #312E81;
  margin: 0 0 10px 0;
}

.node-card .temp {
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: #312E81;
  margin: 4px 0;
}

.node-card .temp span {
  font-size: 0.95rem;
  color: #6D28D9;
}

.node-card .meta {
  font-size: 0.82rem;
  color: #6D28D9;
  margin-top: 8px;
  line-height: 1.5;
}

.node-card .view-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  color: #8B5CF6;
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
}

.node-card .view-link:hover {
  color: #7C3AED;
}

.node-card .view-link::before {
  content: '\2192  ';
  opacity: 0;
  transition: opacity 0.2s ease;
}

.node-card .view-link:hover::before {
  opacity: 1;
}

/* --- Node Detail Card (top of essay pages) --- */
.node-detail {
  background-color: #312E81;
  color: #FFFFFF;
  border-radius: 8px;
  padding: 28px 32px;
  margin: 30px 0 35px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}

.node-detail h2 {
  color: #FFFFFF;
  margin: 0;
  font-size: 1.4rem;
  flex: 1 1 100%;
}

.node-detail .stat {
  flex: 1 1 auto;
}

.node-detail .stat-label {
  font-size: 0.75rem;
  color: #C4B5FD;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
}

.node-detail .stat-value {
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: #FFFFFF;
  margin-top: 2px;
}

/* --- Cross-link pills --- */
.xlink {
  display: inline-block;
  background-color: #F5F3FF;
  border: 1px solid #C4B5FD;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.82rem;
  color: #8B5CF6;
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  text-decoration: none;
  margin: 2px 4px 2px 0;
  white-space: nowrap;
}

.xlink:hover {
  background-color: #8B5CF6;
  color: #FFFFFF;
  border-color: #8B5CF6;
  text-decoration: none;
}

/* --- Essay Content --- */
.essay {
  padding-bottom: 60px;
}

.essay h2 {
  border-bottom: 1px solid #DDD6FE;
  padding-bottom: 0.3em;
}

.essay p {
  max-width: 680px;
}

.essay blockquote {
  border-left: 3px solid #8B5CF6;
  margin: 1.5em 0;
  padding: 0.5em 0 0.5em 22px;
  color: #6D28D9;
  font-style: italic;
  max-width: 640px;
}

.essay ul, .essay ol {
  margin: 1em 0 1.5em 24px;
  max-width: 640px;
}

.essay li {
  margin-bottom: 0.5em;
}

.essay hr {
  border: none;
  border-top: 1px solid #DDD6FE;
  margin: 2.5em 0;
  max-width: 200px;
}

/* --- About Page --- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin: 30px 0 50px;
}

.team-card {
  background-color: #FFFFFF;
  border: 1px solid #DDD6FE;
  border-radius: 8px;
  padding: 26px;
}

.team-card h3 {
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #312E81;
  margin: 0 0 6px 0;
}

.team-card .role {
  font-size: 0.8rem;
  color: #8B5CF6;
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  margin-bottom: 12px;
}

.team-card p {
  font-size: 0.92rem;
  color: #312E81;
  line-height: 1.65;
  margin: 0;
  max-width: none;
}

/* --- Contact Form --- */
.form-wrap {
  max-width: 560px;
  margin: 30px auto 60px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: #312E81;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #DDD6FE;
  border-radius: 6px;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.95rem;
  color: #312E81;
  background-color: #FFFFFF;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #8B5CF6;
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

.btn-send {
  background-color: #312E81;
  color: #FFFFFF;
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  padding: 12px 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-send:hover {
  background-color: #4C4D9B;
}

/* --- Thanks Page --- */
.thanks-box {
  text-align: center;
  padding: 80px 24px;
  max-width: 520px;
  margin: 0 auto;
}

.thanks-box h1 {
  font-size: 2rem;
  margin-bottom: 0.5em;
}

.thanks-box p {
  color: #6D28D9;
  font-size: 1.1rem;
  margin: 0 auto 1.5em;
}

/* --- Legal Pages --- */
.legal {
  padding-bottom: 60px;
}

.legal h2 {
  font-size: 1.4rem;
  margin-top: 2em;
}

.legal h3 {
  font-size: 1.15rem;
  margin-top: 1.6em;
}

.legal p {
  max-width: 680px;
  text-align: justify;
}

/* --- Trust Pages --- */
.trust {
  padding-bottom: 60px;
}

.trust h2 {
  font-size: 1.4rem;
  margin-top: 2em;
}

.trust ul {
  margin: 1em 0 1.5em 24px;
}

.trust li {
  margin-bottom: 0.6em;
}

/* --- Fix Log Table --- */
.fix-table {
  width: 100%;
  max-width: 680px;
  border-collapse: collapse;
  margin: 20px 0 40px;
  font-size: 0.92rem;
}

.fix-table th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid #DDD6FE;
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
  color: #312E81;
  font-size: 0.85rem;
}

.fix-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #DDD6FE;
  color: #312E81;
}

.fix-table tr:hover td {
  background-color: #FAF8FF;
}

/* --- Cookie Banner --- */
.cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background-color: #312E81;
  color: #C4B5FD;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

.cookie-bar.show {
  transform: translateY(0);
}

.cookie-bar p {
  margin: 0;
  max-width: none;
}

.cookie-bar a {
  color: #C4B5FD;
  text-decoration: underline;
  cursor: pointer;
  font-family: 'Lora', Georgia, serif;
}

.cookie-bar a.decline {
  color: #8B5CF6;
  margin-left: 16px;
}

.cookie-bar a:hover {
  color: #FFFFFF;
}

/* --- Footer --- */
.site-foot {
  background-color: #312E81;
  border-top: 2px solid #C4B5FD;
  padding: 48px 24px 32px;
  color: #C4B5FD;
}

.foot-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}

.foot-col h4 {
  font-family: 'Liter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
}

.foot-col p,
.foot-col a {
  font-size: 0.85rem;
  color: #C4B5FD;
  line-height: 1.7;
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
}

.foot-col a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.foot-bottom {
  max-width: 900px;
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(196, 181, 253, 0.2);
  text-align: center;
  font-size: 0.8rem;
  color: #C4B5FD;
}

/* --- Mobile Nav --- */
.mobile-nav {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #F5F3FF;
  z-index: 99;
  padding: 24px;
  flex-direction: column;
  gap: 16px;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.1rem;
  color: #6D28D9;
  padding: 8px 0;
  border-bottom: 1px solid #DDD6FE;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .net-head nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .node-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .foot-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  h1 {
    font-size: 1.7rem !important;
  }

  .link-hero h1 {
    font-size: 1.6rem;
  }

  .node-detail {
    flex-direction: column;
    align-items: flex-start;
  }

  .node-detail .stat {
    flex: none;
  }

  .wrap {
    padding: 0 16px;
  }

  .cookie-bar {
    flex-direction: column;
    text-align: center;
  }
}

@media (min-width: 769px) {
  .mobile-nav.open {
    display: none !important;
  }
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* --- Section spacing --- */
section {
  margin-bottom: 2rem;
}

/* --- Loading state --- */
.loading {
  color: #6D28D9;
  font-style: italic;
}

/* node fetch loading text */
.node-loading {
  font-size: 0.85rem;
  color: #6D28D9;
  font-style: italic;
}
