/* Tokyo Temp — Thermal Lag Observatory */
/* Handwritten CSS — warm parchment theme */
/* No frameworks. No utilities. Pure CSS3. */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;1,400;1,600&family=Source+Sans+3:wght@400;500&display=swap');

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: #2C1810;
  background-color: #F7F3EF;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: #C75C2E;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #9E3A14;
  text-decoration: underline;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Crimson Pro', serif;
  font-weight: 600;
  line-height: 1.2;
  color: #2C1810;
}

h1 {
  font-size: 2.4rem;
  margin-bottom: 1.2rem;
}

h2 {
  font-size: 1.8rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.35rem;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  font-weight: 400;
  font-style: italic;
}

h4 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

p {
  margin-bottom: 1.1rem;
}

/* ── Header ── */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: #F7F3EF;
  border-bottom: 1px solid #D4C5B9;
  padding: 0 2rem;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

#site-logo {
  font-family: 'Crimson Pro', serif;
  font-weight: 600;
  font-style: italic;
  font-size: 1.5rem;
  color: #2C1810;
  text-decoration: none;
}

#site-logo:hover {
  color: #C75C2E;
  text-decoration: none;
}

/* ── Navigation ── */
#main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.8rem;
}

#main-nav a {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  color: #2C1810;
  text-decoration: none;
  position: relative;
}

#main-nav a:hover {
  color: #C75C2E;
  text-decoration: none;
}

#main-nav a.active {
  color: #C75C2E;
}

/* ── Mobile Menu ── */
#mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

#mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #2C1810;
  margin: 5px 0;
  transition: 0.3s;
}

/* ── Layout ── */
main {
  padding-top: 64px;
  min-height: calc(100vh - 300px);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Page Header ── */
.page-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid #D4C5B9;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: #5C4A42;
  font-size: 1.05rem;
  margin-bottom: 0;
}

/* ── Spiral Section (index) ── */
.spiral-section {
  padding: 2rem 0 1rem;
  text-align: center;
}

.spiral-head {
  font-family: 'Crimson Pro', serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.spiral-sub {
  color: #5C4A42;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.spiral-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0;
}

#thermal-spiral {
  max-width: 520px;
  width: 100%;
}

.spiral-note {
  font-size: 0.85rem;
  color: #5C4A42;
  margin-top: 1rem;
  font-style: italic;
}

/* ── Content Sections ── */
.content-section {
  padding: 2rem 0;
}

.content-section h2 {
  border-bottom: 1px solid #D4C5B9;
  padding-bottom: 0.5rem;
}

/* ── Cards ── */
.lag-card {
  background-color: #FFFFFF;
  border: 1px solid #D4C5B9;
  border-radius: 4px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.lag-card h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

/* ── Weather Box ── */
.temp-head {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.temp-photo {
  flex: 0 0 55%;
  max-width: 55%;
}

.temp-photo img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid #D4C5B9;
}

.temp-box {
  flex: 1;
  min-width: 220px;
  background-color: #FFFFFF;
  border: 1px solid #D4C5B9;
  border-radius: 4px;
  padding: 1.2rem;
}

.temp-box h3 {
  margin-top: 0;
  font-size: 1rem;
  color: #5C4A42;
  font-style: normal;
  font-weight: 500;
}

.temp-val {
  font-family: 'Crimson Pro', serif;
  font-size: 2rem;
  font-weight: 600;
  color: #C75C2E;
  margin: 0.3rem 0;
}

.temp-detail {
  font-size: 0.9rem;
  color: #5C4A42;
  margin: 0.2rem 0;
}

.temp-status {
  font-size: 0.8rem;
  color: #5C4A42;
  margin-top: 0.8rem;
  font-style: italic;
}

/* ── Thermal Mass Bars ── */
.mass-section {
  padding: 2rem 0;
}

.mass-chart {
  margin: 2rem 0;
  background-color: #FFFFFF;
  border: 1px solid #D4C5B9;
  border-radius: 4px;
  padding: 2rem;
}

#thermal-mass-bars {
  width: 100%;
}

.mass-row {
  display: flex;
  align-items: center;
  margin: 1rem 0;
}

.mass-label {
  width: 120px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  color: #2C1810;
  text-align: right;
  padding-right: 1rem;
  flex-shrink: 0;
}

.mass-bar-wrap {
  flex: 1;
  height: 32px;
  background-color: #F7F3EF;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.mass-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

.mass-val {
  width: 50px;
  padding-left: 0.8rem;
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-weight: 600;
  color: #2C1810;
  flex-shrink: 0;
}

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background-color: #FFFFFF;
  border: 1px solid #D4C5B9;
  border-radius: 4px;
  overflow: hidden;
}

.data-table th {
  background-color: #2C1810;
  color: #E8DED4;
  font-family: 'Crimson Pro', serif;
  font-weight: 600;
  text-align: left;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
}

.data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #E8DED4;
  color: #2C1810;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:nth-child(even) {
  background-color: #FAF8F5;
}

/* ── Lists ── */
ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1.1rem;
}

li {
  margin-bottom: 0.4rem;
}

/* ── Links as CTAs ── */
.cta-link {
  font-family: 'Crimson Pro', serif;
  font-weight: 400;
  font-style: italic;
  font-size: 1.1rem;
  color: #C75C2E;
  text-decoration: none;
}

.cta-link:hover {
  color: #9E3A14;
  text-decoration: underline;
}

/* ── Contact Form ── */
.form-group {
  margin-bottom: 1.3rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid #D4C5B9;
  border-radius: 4px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  color: #2C1810;
  background-color: #FFFFFF;
}

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

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

.mass-btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  background-color: #C75C2E;
  color: #FFFFFF;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.mass-btn:hover {
  background-color: #9E3A14;
  text-decoration: none;
}

/* ── Thanks Page ── */
.thanks-box {
  text-align: center;
  padding: 4rem 2rem;
}

.thanks-box h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.thanks-box p {
  font-size: 1.1rem;
  color: #5C4A42;
}

/* ── Cookie Banner ── */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #2C1810;
  color: #E8DED4;
  padding: 1rem 2rem;
  z-index: 2000;
  display: none;
  font-size: 0.9rem;
}

#cookie-banner.show {
  display: block !important;
}

.cookie-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cookie-links a {
  color: #D4A574;
  margin-left: 1rem;
  cursor: pointer;
}

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

/* ── Footer ── */
#site-footer {
  background-color: #2C1810;
  color: #E8DED4;
  border-top: 3px solid #C75C2E;
  padding: 2.5rem 2rem 2rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-col h4 {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-weight: 600;
  color: #D4A574;
  margin-top: 0;
  margin-bottom: 1rem;
}

.footer-col p,
.footer-col a {
  font-size: 0.88rem;
  color: #E8DED4;
  line-height: 1.8;
}

.footer-col a {
  display: block;
  text-decoration: none;
}

.footer-col a:hover {
  color: #D4A574;
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid #5C4A42;
  font-size: 0.8rem;
  color: #5C4A42;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #mobile-toggle {
    display: block;
  }

  #main-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background-color: #F7F3EF;
    border-bottom: 1px solid #D4C5B9;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  #main-nav.open {
    max-height: 500px;
  }

  #main-nav ul {
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 0.8rem;
  }

  .header-inner {
    position: relative;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .temp-head {
    flex-direction: column;
  }

  .temp-photo {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .temp-box {
    width: 100%;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .mass-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .mass-label {
    text-align: left;
    padding-right: 0;
    margin-bottom: 0.3rem;
  }

  .mass-bar-wrap {
    width: 100%;
  }

  .container,
  .container-narrow {
    padding: 0 1rem;
  }

  #site-header {
    padding: 0 1rem;
  }
}

/* ── Utility ── */
.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 2rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

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