:root {
  --bg: #07111f;
  --bg-soft: #0d1d32;
  --panel: rgba(8, 22, 39, 0.76);
  --panel-strong: rgba(8, 20, 35, 0.92);
  --line: rgba(165, 204, 255, 0.14);
  --text: #eef6ff;
  --muted: rgba(219, 234, 255, 0.7);
  --accent: #9fe8ff;
  --accent-strong: #4fc8ff;
  --accent-warm: #ffd37b;
  --danger: #ff8f80;
  --festival: #a6ffbe;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.35);
  --radius: 28px;
  --font-display: "Source Han Serif SC", "Noto Serif SC", "STSong", serif;
  --font-body: "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 200, 255, 0.22), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(255, 211, 123, 0.16), transparent 24%),
    linear-gradient(180deg, #091827 0%, #06111b 38%, #08121c 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.035) 0%, transparent 30%),
    repeating-linear-gradient(
      180deg,
      rgba(164, 210, 255, 0.02) 0,
      rgba(164, 210, 255, 0.02) 1px,
      transparent 1px,
      transparent 72px
    );
  pointer-events: none;
}

.page-shell {
  position: relative;
  overflow: clip;
}

.hero,
.overview,
.planner,
.reference {
  width: min(1200px, calc(100% - 88px));
  margin: 0 auto;
}

.hero {
  position: relative;
  padding: 28px 44px 56px;
  min-height: clamp(640px, 78svh, 780px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 8px 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-mark,
.section-label,
.eyebrow,
.panel-kicker,
.detail-kicker {
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-mark {
  font-size: 0.78rem;
  color: var(--accent);
}

.brand-sub,
.topbar-meta,
.section-note,
.muted,
.detail-meta,
.detail-note {
  color: var(--muted);
}

.topbar-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 0.9rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 420px);
  gap: 32px;
  align-items: end;
  padding: 34px 0 0;
  margin-top: auto;
}

.hero-copy {
  max-width: 720px;
  animation: rise 0.9s ease both;
}

.eyebrow,
.section-label,
.panel-kicker,
.detail-kicker {
  font-size: 0.78rem;
  color: var(--accent);
  margin: 0 0 12px;
}

.hero-copy h1,
.overview h2,
.section-head h2 {
  font-family: var(--font-display);
  line-height: 1.02;
  margin: 0;
}

.hero-copy h1 {
  font-size: clamp(3.2rem, 7vw, 6.8rem);
  max-width: 11ch;
  text-wrap: balance;
}

.hero-text {
  margin: 24px 0 0;
  font-size: 1.08rem;
  line-height: 1.9;
  max-width: 48rem;
  color: rgba(239, 247, 255, 0.82);
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.button:hover,
.icon-button:hover,
.day-cell:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #06111b;
  background: linear-gradient(135deg, #cbf7ff 0%, #8bdfff 100%);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.hero-panel,
.calendar-card,
.detail-card,
.overview-item,
.reference-card,
.notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 28px;
  animation: rise 1.1s ease both;
}

.hero-panel h2 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.05;
  font-family: var(--font-display);
}

.hero-panel p {
  margin: 0;
  line-height: 1.8;
  color: rgba(236, 244, 255, 0.76);
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.hero-highlights div {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.highlight-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.76rem;
  color: var(--muted);
}

.hero-waves {
  position: absolute;
  inset: auto -8% -10% -8%;
  height: 180px;
  pointer-events: none;
}

.hero-waves span {
  position: absolute;
  inset: auto 0 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform-origin: center bottom;
}

.hero-waves span:nth-child(1) {
  height: 160px;
  background: linear-gradient(180deg, rgba(125, 232, 255, 0.08), rgba(66, 127, 179, 0.03));
  animation: sway 16s ease-in-out infinite;
}

.hero-waves span:nth-child(2) {
  height: 190px;
  opacity: 0.14;
  background: linear-gradient(180deg, rgba(44, 123, 176, 0.12), rgba(6, 17, 27, 0.02));
  animation: sway 20s ease-in-out infinite reverse;
}

.hero-waves span:nth-child(3) {
  height: 220px;
  opacity: 0.08;
  background: linear-gradient(180deg, rgba(15, 74, 116, 0.16), rgba(6, 17, 27, 0));
  animation: sway 24s ease-in-out infinite;
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr);
  gap: 32px;
  padding: 44px 24px 66px;
  align-items: start;
}

.overview h2,
.section-head h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.overview-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.overview-item {
  padding: 28px;
  min-height: 230px;
}

.overview-item span {
  display: inline-flex;
  margin-bottom: 16px;
  font-size: 0.86rem;
  color: var(--accent-warm);
}

.overview-item h3 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.overview-item p {
  margin: 0;
  line-height: 1.8;
  color: var(--muted);
}

.planner,
.reference {
  padding: 40px 24px 80px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 26px;
}

.planner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.75fr);
  gap: 22px;
}

.calendar-card,
.detail-card {
  padding: 24px;
}

.calendar-controls,
.calendar-summary,
.clock-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.calendar-controls {
  margin-bottom: 18px;
}

.control-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-button,
select {
  color: var(--text);
  font: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.icon-button {
  min-width: 48px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.selectors label,
.clock-head label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

select {
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 14px;
}

.calendar-summary {
  margin-bottom: 20px;
}

.calendar-summary h3,
.detail-card h3,
.detail-lunar {
  margin: 0;
}

.calendar-badge {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(159, 232, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(159, 232, 255, 0.2);
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.weekday-row {
  margin-bottom: 10px;
}

.weekday-row span {
  padding: 12px 0;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
}

.calendar-grid {
  min-height: 560px;
}

.day-cell {
  position: relative;
  min-height: 112px;
  padding: 14px 12px 12px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}

.day-cell.empty {
  background: rgba(255, 255, 255, 0.02);
  cursor: default;
  opacity: 0.3;
}

.day-cell.is-today {
  border-color: rgba(159, 232, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(159, 232, 255, 0.15);
}

.day-cell.is-selected {
  background: linear-gradient(180deg, rgba(108, 207, 255, 0.18), rgba(255, 211, 123, 0.08));
  border-color: rgba(159, 232, 255, 0.45);
}

.day-cell.is-tide::after {
  content: "";
  position: absolute;
  inset: 10px 10px auto auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 6px rgba(79, 200, 255, 0.12);
}

.day-cell.is-festival .day-sub {
  color: var(--festival);
}

.day-main {
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.day-sub {
  display: block;
  margin-top: 10px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.calendar-legend,
.detail-tags,
.clock-grid,
.reference-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.calendar-legend {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.today {
  background: #d7fbff;
}

.legend-dot.tide {
  background: var(--accent-strong);
}

.legend-dot.festival {
  background: var(--festival);
}

.detail-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-block {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-card .detail-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-lunar {
  font-size: 2rem;
  font-family: var(--font-display);
}

.detail-tags {
  padding: 2px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.86rem;
}

.tag.tide {
  color: #03111a;
  background: linear-gradient(135deg, #bef4ff 0%, #83dcff 100%);
}

.tag.festival {
  color: #04120d;
  background: linear-gradient(135deg, #d9ffe6 0%, #a8f7bf 100%);
}

.tag.term {
  color: #1b1100;
  background: linear-gradient(135deg, #ffe6b1 0%, #ffd37b 100%);
}

.tide-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.tide-pair div,
.clock-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tide-pair span,
.clock-item span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.tide-pair strong,
.clock-item strong {
  display: block;
  margin-top: 10px;
  font-size: 1.5rem;
  font-family: var(--font-display);
}

.clock-grid {
  margin-top: 16px;
}

.clock-item {
  flex: 1 1 180px;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.reference-card {
  padding: 28px;
}

.reference-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.reference-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.season-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.season-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.season-item strong {
  display: block;
  margin-bottom: 10px;
}

.season-item span {
  display: block;
  color: var(--muted);
  line-height: 1.7;
}

.notice {
  margin-top: 20px;
  padding: 24px 28px;
}

.notice strong {
  display: block;
  margin-bottom: 8px;
}

.notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sway {
  0%, 100% {
    transform: translateX(0) scaleX(1);
  }
  50% {
    transform: translateX(2%) scaleX(1.04);
  }
}

@media (max-width: 1080px) {
  .hero-grid,
  .overview,
  .planner-grid,
  .section-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .section-head {
    align-items: start;
  }

  .overview-list,
  .reference-grid {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .hero,
  .overview,
  .planner,
  .reference {
    width: min(100% - 32px, 1200px);
  }

  .hero {
    padding: 24px 18px 68px;
  }

  .topbar,
  .calendar-controls,
  .calendar-summary,
  .clock-head {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-meta {
    justify-content: flex-start;
  }

  .hero-grid {
    padding: 42px 0 0;
  }

  .hero-panel,
  .calendar-card,
  .detail-card,
  .overview-item,
  .reference-card,
  .notice {
    border-radius: 22px;
  }

  .hero-highlights,
  .season-grid,
  .tide-pair {
    grid-template-columns: 1fr;
  }

  .selectors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .selectors label,
  .clock-head label {
    width: 100%;
  }

  select {
    min-width: 0;
    width: 100%;
  }

  .weekday-row {
    gap: 6px;
  }

  .calendar-grid {
    gap: 6px;
  }

  .day-cell {
    min-height: 92px;
    padding: 12px 10px 10px;
    border-radius: 16px;
  }

  .day-main {
    font-size: 1.2rem;
  }

  .day-sub {
    margin-top: 8px;
    font-size: 0.72rem;
  }
}

.topbar-tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.topbar-copy {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.9rem;
}

.lang-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.lang-link:hover {
  transform: translateY(-2px);
  border-color: rgba(159, 232, 255, 0.42);
}

.lang-link.is-current {
  color: #06111b;
  background: linear-gradient(135deg, #cbf7ff 0%, #8bdfff 100%);
  border-color: transparent;
}

select,
option,
optgroup {
  background: #10223a;
  color: var(--text);
}

select {
  color-scheme: dark;
}

.day-sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

@media (max-width: 720px) {
  .topbar-tools,
  .lang-switch,
  .topbar-copy {
    align-items: flex-start;
    justify-content: flex-start;
  }
}

.site-link {
  border-color: rgba(255, 211, 123, 0.2);
  background: rgba(255, 211, 123, 0.08);
}

.site-footer {
  width: min(1200px, calc(100% - 88px));
  margin: 0 auto 36px;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(7, 19, 32, 0.72);
  color: var(--muted);
  line-height: 1.8;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 720px) {
  .site-footer {
    width: min(100% - 32px, 1200px);
    margin-bottom: 20px;
    padding: 18px;
  }
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 34px;
  z-index: 0;
}

.hero-video,
.hero-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-video {
  object-fit: cover;
  object-position: center 44%;
  filter: saturate(1.08) brightness(0.9) contrast(1.06);
}

.hero-scrim {
  background:
    linear-gradient(180deg, rgba(4, 10, 18, 0.22) 0%, rgba(4, 10, 18, 0.12) 34%, rgba(4, 10, 18, 0.42) 100%),
    radial-gradient(circle at 28% 34%, rgba(120, 226, 255, 0.05), transparent 36%),
    linear-gradient(90deg, rgba(4, 10, 18, 0.34) 0%, rgba(4, 10, 18, 0.08) 38%, rgba(4, 10, 18, 0.24) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none;
  }
}

@media (max-width: 720px) {
  .hero-media {
    border-radius: 24px;
  }
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.lang-menu {
  position: relative;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.lang-trigger::-webkit-details-marker {
  display: none;
}

.lang-trigger::after {
  content: "▾";
  font-size: 0.8rem;
  color: var(--muted);
}

.lang-menu[open] .lang-trigger {
  border-color: rgba(159, 232, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
}

.lang-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 170px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 20, 35, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  display: none;
}

.lang-dropdown:not([hidden]) {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.lang-option.is-current {
  background: rgba(159, 232, 255, 0.14);
  color: var(--accent);
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2em;
  font-size: 1rem;
  line-height: 1;
}

@media (max-width: 720px) {
  .topbar-actions {
    justify-content: flex-start;
  }

  .lang-dropdown {
    right: auto;
    left: 0;
  }
}


.lang-menu.is-open .lang-trigger {
  border-color: rgba(159, 232, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
}

.lang-menu.is-open .lang-trigger::after {
  transform: rotate(180deg);
}

.lang-trigger::after {
  transition: transform 0.2s ease;
}

.hero-copy,
.hero-panel,
.overview article,
.section-head,
.notice,
.site-footer {
  padding-inline: 4px;
}

@media (max-width: 720px) {
  .calendar-card,
  .detail-card,
  .overview-item,
  .reference-card,
  .notice {
    padding: 28px;
  }

  .hero-copy,
  .hero-panel,
  .overview article,
  .section-head,
  .notice,
  .site-footer {
    padding-inline: 2px;
  }
}







/* H5 moon gradient background */
.hero-waves {
  display: none !important;
}

.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 34px;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(82, 129, 166, 0.16), transparent 24%),
    radial-gradient(circle at 72% 18%, rgba(68, 108, 142, 0.1), transparent 26%),
    linear-gradient(180deg, #1a3650 0%, #112941 28%, #0a1d31 58%, #071423 100%);
}

.hero-media > div {
  position: absolute;
}

.moon-glow {
  top: 38px;
  left: 92px;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 231, 243, 0.12) 0%, rgba(214, 231, 243, 0.05) 36%, rgba(214, 231, 243, 0) 72%);
  filter: blur(6px);
}

.moon-ring {
  top: 60px;
  left: 116px;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 1px solid rgba(214, 229, 239, 0.32);
  box-shadow:
    0 0 0 14px rgba(214, 229, 239, 0.03),
    0 0 38px rgba(214, 229, 239, 0.08);
}

.tower-silhouette {
  top: 176px;
  left: 168px;
  width: 110px;
  height: 230px;
  opacity: 0.62;
  pointer-events: none;
}

.tower-silhouette span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: block;
}

.tower-glow {
  bottom: 14px;
  width: 138px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(206, 219, 230, 0.14) 0%, rgba(206, 219, 230, 0.04) 42%, rgba(206, 219, 230, 0) 74%);
  filter: blur(8px);
}

.tower-base {
  bottom: 0;
  width: 124px;
  height: 22px;
  border-radius: 40px 40px 8px 8px;
  background: linear-gradient(180deg, rgba(16, 30, 43, 0.72), rgba(7, 16, 26, 0.96));
  box-shadow: 0 -1px 0 rgba(194, 209, 220, 0.12) inset;
}

.tower-body {
  background: linear-gradient(180deg, rgba(26, 46, 62, 0.5), rgba(8, 19, 30, 0.92));
  box-shadow: 0 -1px 0 rgba(199, 214, 223, 0.1) inset;
}

.tower-body::before,
.tower-body::after {
  content: "";
  position: absolute;
  top: 6px;
  width: calc(100% + 18px);
  height: 8px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(72, 100, 121, 0.3), rgba(10, 21, 31, 0.85));
}

.tower-tier-1 {
  bottom: 18px;
  width: 92px;
  height: 44px;
  border-radius: 10px 10px 8px 8px;
}

.tower-tier-2 {
  bottom: 56px;
  width: 76px;
  height: 38px;
  border-radius: 9px 9px 7px 7px;
}

.tower-tier-3 {
  bottom: 89px;
  width: 60px;
  height: 34px;
  border-radius: 8px 8px 6px 6px;
}

.tower-tier-4 {
  bottom: 118px;
  width: 44px;
  height: 30px;
  border-radius: 7px 7px 5px 5px;
}

.tower-spire {
  bottom: 147px;
  width: 8px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(88, 118, 140, 0.42), rgba(10, 18, 28, 0.94));
}

.hero-gradient {
  inset: 0;
  background:
    radial-gradient(circle at 50% 108%, rgba(64, 120, 156, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(90, 122, 150, 0.08) 0%, rgba(90, 122, 150, 0) 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 26%);
}

.hero-haze {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 14%),
    radial-gradient(ellipse at 58% 32%, rgba(150, 182, 201, 0.08), transparent 30%),
    radial-gradient(ellipse at 40% 58%, rgba(85, 121, 150, 0.06), transparent 38%);
  opacity: 0.72;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(4, 10, 18, 0.28) 0%, rgba(4, 10, 18, 0.12) 34%, rgba(4, 10, 18, 0.34) 100%),
    linear-gradient(90deg, rgba(5, 14, 24, 0.42) 0%, rgba(5, 14, 24, 0.14) 40%, rgba(5, 14, 24, 0.24) 100%);
}

/* Native language select */
.lang-native-wrap {
  position: relative;
  z-index: 180;
}

.lang-native {
  min-width: 128px;
  min-height: 36px;
  padding: 0 36px 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(219, 234, 255, 0.7) 50%),
    linear-gradient(135deg, rgba(219, 234, 255, 0.7) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 15px,
    calc(100% - 13px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.lang-native:focus {
  outline: none;
  border-color: rgba(159, 232, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(159, 232, 255, 0.08);
}

@media (max-width: 720px) {
  .hero,
  .overview,
  .reference,
  .site-footer {
    width: min(100% - 20px, 1200px) !important;
  }

  .planner {
    width: min(100% - 8px, 1400px) !important;
    padding: 28px 8px 42px !important;
  }

  .overview,
  .reference {
    padding: 28px 14px 42px !important;
  }

  .hero {
    padding: 18px 14px 34px !important;
    min-height: auto;
  }

  .hero-grid {
    padding: 24px 0 0 !important;
    gap: 18px;
  }

  .brand,
  .topbar-copy {
    display: none !important;
  }

  .topbar,
  .topbar-tools,
  .topbar-actions {
    width: 100%;
    align-items: center !important;
    justify-content: flex-end !important;
  }

  .topbar-actions {
    gap: 6px;
    flex-wrap: nowrap;
    overflow: visible;
  }

  .site-link {
    min-height: 34px;
    padding: 0 12px;
    white-space: nowrap;
    font-size: 0.92rem;
  }

  .lang-native-wrap {
    min-width: 108px;
    flex: 0 0 auto;
  }

  .lang-native {
    min-width: 108px;
    min-height: 34px;
    padding: 0 32px 0 12px;
    font-size: 0.92rem;
    white-space: nowrap;
  }

  .hero-copy h1 {
    font-size: clamp(1.9rem, 9.2vw, 2.8rem) !important;
    line-height: 1.04;
    max-width: none;
  }

  .hero-text {
    margin-top: 14px;
    font-size: 0.96rem;
    line-height: 1.72;
  }

  .hero-panel,
  .calendar-card,
  .detail-card,
  .overview-item,
  .reference-card,
  .notice {
    padding: 18px !important;
    border-radius: 20px !important;
  }

  .calendar-card,
  .detail-card {
    padding: 16px !important;
  }

  .planner-grid {
    gap: 12px;
  }

  .calendar-controls,
  .calendar-summary,
  .clock-head {
    flex-direction: column;
    align-items: stretch;
  }

  .weekday-row {
    gap: 4px !important;
  }

  .weekday-row span {
    padding: 8px 0;
    font-size: 0.74rem;
  }

  .calendar-grid {
    gap: 4px !important;
    min-height: auto;
  }

  .day-cell {
    min-height: 86px !important;
    padding: 10px 8px 8px !important;
    border-radius: 14px !important;
  }

  .day-main {
    font-size: 1.08rem !important;
  }

  .day-sub {
    margin-top: 6px !important;
    font-size: 0.66rem !important;
    line-height: 1.3;
  }

  .calendar-legend {
    gap: 10px;
    font-size: 0.78rem;
  }

  .tide-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .hero-media {
    border-radius: 24px;
    background:
      radial-gradient(circle at 16% 14%, rgba(76, 123, 158, 0.16), transparent 24%),
      radial-gradient(circle at 76% 18%, rgba(60, 100, 136, 0.08), transparent 24%),
      linear-gradient(180deg, #193248 0%, #10263b 30%, #091a2c 66%, #06111c 100%);
  }

  .moon-glow {
    top: 22px;
    left: 28px;
    width: 112px;
    height: 112px;
  }

  .moon-ring {
    top: 34px;
    left: 42px;
    width: 70px;
    height: 70px;
  }

  .tower-silhouette {
    top: 96px;
    left: 86px;
    width: 74px;
    height: 150px;
    opacity: 0.5;
  }

  .tower-glow {
    width: 92px;
    height: 58px;
  }

  .tower-base {
    width: 84px;
    height: 14px;
  }

  .tower-tier-1 {
    width: 58px;
    height: 28px;
  }

  .tower-tier-2 {
    bottom: 38px;
    width: 48px;
    height: 24px;
  }

  .tower-tier-3 {
    bottom: 58px;
    width: 38px;
    height: 22px;
  }

  .tower-tier-4 {
    bottom: 76px;
    width: 28px;
    height: 18px;
  }

  .tower-spire {
    bottom: 92px;
    height: 34px;
  }
}


/* Mobile polish */
@media (max-width: 720px) {
  body {
    background:
      radial-gradient(circle at 18% 0%, rgba(79, 200, 255, 0.18), transparent 24%),
      linear-gradient(180deg, #0a1725 0%, #07121d 48%, #08111a 100%);
  }

  .page-shell {
    padding-top: 6px;
  }

  .hero,
  .overview,
  .reference,
  .site-footer {
    width: min(100% - 14px, 1200px) !important;
  }

  .hero {
    padding: 14px 12px 22px !important;
    min-height: auto;
    border-radius: 24px;
  }

  .topbar {
    gap: 10px;
    padding: 2px 0 0;
  }

  .topbar-tools {
    gap: 10px;
  }

  .topbar-actions {
    gap: 6px;
    justify-content: space-between !important;
  }

  .site-link,
  .lang-native {
    min-height: 32px;
    border-radius: 999px;
    font-size: 0.84rem;
    letter-spacing: 0.01em;
  }

  .site-link {
    padding: 0 10px;
  }

  .lang-native-wrap {
    min-width: 102px;
  }

  .lang-native {
    min-width: 102px;
    padding: 0 30px 0 10px;
    background-position:
      calc(100% - 16px) 14px,
      calc(100% - 11px) 14px;
  }

  .hero-grid {
    padding: 18px 0 0 !important;
    gap: 14px;
  }

  .eyebrow,
  .section-label,
  .panel-kicker,
  .detail-kicker {
    margin-bottom: 8px;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
  }

  .hero-copy h1 {
    font-size: clamp(1.7rem, 8.4vw, 2.35rem) !important;
    line-height: 1.02;
    letter-spacing: -0.02em;
  }

  .hero-text {
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.62;
  }

  .hero-actions {
    margin-top: 18px;
    gap: 10px;
  }

  .button {
    min-height: 42px;
    padding: 0 16px;
    font-size: 0.92rem;
  }

  .hero-panel {
    padding: 16px !important;
  }

  .hero-panel h2 {
    font-size: clamp(1.45rem, 7vw, 2rem);
    line-height: 1.08;
  }

  .hero-panel p {
    font-size: 0.88rem;
    line-height: 1.62;
  }

  .hero-highlights {
    margin-top: 16px;
    gap: 10px;
  }

  .hero-highlights div {
    padding-top: 10px;
  }

  .highlight-label {
    margin-bottom: 4px;
    font-size: 0.68rem;
  }

  .planner {
    width: min(100% - 4px, 1400px) !important;
    padding: 20px 4px 28px !important;
  }

  .overview,
  .reference {
    padding: 20px 10px 28px !important;
  }

  .section-head {
    gap: 8px;
    margin-bottom: 16px;
  }

  .section-head h2,
  .overview h2 {
    font-size: clamp(1.72rem, 8vw, 2.3rem);
    line-height: 1.06;
  }

  .section-note {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .planner-grid {
    gap: 10px;
  }

  .calendar-card,
  .detail-card {
    padding: 14px !important;
  }

  .calendar-controls,
  .calendar-summary,
  .clock-head {
    gap: 12px;
  }

  .control-group {
    gap: 8px;
  }

  .icon-button {
    min-width: 42px;
    height: 40px;
  }

  .selectors label,
  .clock-head label {
    gap: 6px;
    font-size: 0.78rem;
  }

  #yearSelect,
  #monthSelect,
  #timezoneSelect {
    min-width: 0;
    width: 100%;
  }

  .calendar-summary {
    margin-bottom: 14px;
  }

  .calendar-summary h3,
  .detail-card h3,
  .detail-lunar {
    font-size: 1.08rem;
  }

  .calendar-badge {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .weekday-row {
    margin-bottom: 6px;
  }

  .weekday-row span {
    padding: 6px 0;
    font-size: 0.68rem;
  }

  .calendar-grid {
    gap: 3px !important;
  }

  .day-cell {
    min-height: 78px !important;
    padding: 8px 6px 6px !important;
    border-radius: 12px !important;
  }

  .day-main {
    font-size: 0.98rem !important;
  }

  .day-sub {
    margin-top: 4px !important;
    font-size: 0.62rem !important;
    line-height: 1.22;
  }

  .day-cell.is-tide::after {
    inset: 7px 7px auto auto;
    width: 7px;
    height: 7px;
    box-shadow: 0 0 0 4px rgba(79, 200, 255, 0.1);
  }

  .calendar-legend {
    margin-top: 12px;
    gap: 8px 12px;
    font-size: 0.72rem;
  }

  .detail-block + .detail-block {
    margin-top: 14px;
  }

  .detail-meta,
  .detail-note {
    font-size: 0.8rem;
    line-height: 1.55;
  }

  .detail-tags,
  .clock-grid {
    gap: 8px;
  }

  .tag,
  .clock-item {
    border-radius: 14px;
  }

  .tide-pair {
    gap: 8px;
  }

  .tide-pair div {
    padding: 10px 8px;
  }

  .clock-item {
    flex: 1 1 calc(50% - 4px);
    min-width: calc(50% - 4px);
    padding: 10px 10px 12px;
  }

  .overview {
    gap: 14px;
  }

  .overview-list,
  .reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .overview-item,
  .reference-card,
  .notice {
    padding: 14px !important;
    min-height: 0;
  }

  .overview-item span {
    margin-bottom: 8px;
    font-size: 0.74rem;
  }

  .overview-item h3 {
    margin-bottom: 8px;
    font-size: 1rem;
    line-height: 1.28;
  }

  .overview-item p,
  .reference-card p,
  .notice p {
    font-size: 0.84rem;
    line-height: 1.55;
  }

  .site-footer {
    margin-bottom: 14px;
    padding: 14px;
    font-size: 0.78rem;
    line-height: 1.55;
  }
}

.mobile-detail-summary,
.mobile-detail-close {
  display: none;
}

@media (max-width: 720px) {
  body.detail-sheet-open {
    overflow: hidden;
  }

  .planner {
    padding-bottom: 116px !important;
  }

  .detail-card {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 260;
    max-height: min(74vh, 560px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 78px 14px calc(16px + env(safe-area-inset-bottom)) !important;
    border-radius: 22px !important;
    background: rgba(7, 19, 32, 0.96);
    box-shadow: 0 -16px 44px rgba(0, 0, 0, 0.42);
    transform: translateY(calc(100% - 68px));
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    backdrop-filter: blur(18px);
  }

  .detail-card.is-sheet-open {
    transform: translateY(0);
  }

  .detail-card::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 42px;
    height: 4px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
  }

  .mobile-detail-summary,
  .mobile-detail-close {
    display: block;
  }

  .mobile-detail-summary {
    position: absolute;
    top: 16px;
    left: 12px;
    right: 58px;
    min-height: 46px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
  }

  .mobile-detail-summary-label {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .mobile-detail-summary-date {
    display: block;
    margin-top: 4px;
    font-size: 1rem;
    line-height: 1.2;
    font-family: var(--font-display);
  }

  .mobile-detail-summary-meta {
    display: block;
    margin-top: 3px;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.35;
  }

  .mobile-detail-close {
    position: absolute;
    top: 16px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1;
  }

  .detail-card.is-sheet-open .mobile-detail-summary {
    right: 56px;
  }
}

@media (max-width: 720px) {
  .detail-card::before {
    width: 54px;
    height: 5px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(196, 229, 255, 0.4), rgba(255, 255, 255, 0.16));
  }

  .mobile-detail-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-detail-summary-copy {
    min-width: 0;
    flex: 1 1 auto;
  }

  .mobile-detail-summary-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-detail-summary-indicator {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    position: relative;
  }

  .mobile-detail-summary-indicator::before,
  .mobile-detail-summary-indicator::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 7px;
    height: 1.5px;
    background: rgba(229, 240, 255, 0.78);
  }

  .mobile-detail-summary-indicator::before {
    left: 8px;
    transform: translateY(-50%) rotate(36deg);
  }

  .mobile-detail-summary-indicator::after {
    right: 8px;
    transform: translateY(-50%) rotate(-36deg);
  }

  .detail-card.is-sheet-open .mobile-detail-summary-indicator::before {
    transform: translateY(-50%) rotate(-36deg);
  }

  .detail-card.is-sheet-open .mobile-detail-summary-indicator::after {
    transform: translateY(-50%) rotate(36deg);
  }
}

@media (max-width: 720px) {
  .detail-card {
    padding-top: 70px !important;
  }

  .detail-card .detail-block:nth-of-type(1),
  .detail-card .detail-block:nth-of-type(2) {
    display: none;
  }

  .detail-card .detail-tags {
    margin-top: 0;
    margin-bottom: 2px;
  }

  .detail-card .tide-detail {
    padding-top: 0;
  }
}

@media (max-width: 720px) {
  .detail-card .clock-block {
    display: none;
  }
}

@media (max-width: 720px) {
  .detail-card .detail-tags {
    margin-top: 8px;
  }
}


html[lang="ar"] body { direction: rtl; }
html[lang="ar"] .hero-copy,
html[lang="ar"] .hero-panel,
html[lang="ar"] .overview article,
html[lang="ar"] .overview-item,
html[lang="ar"] .section-head,
html[lang="ar"] .notice,
html[lang="ar"] .site-footer { text-align: right; }
html[lang="ar"] .weekday-row,
html[lang="ar"] .calendar-grid { direction: ltr; }

.hero-copy,
.hero-copy h1,
.hero-panel,
.hero-panel h2,
.hero-panel strong,
.overview h2,
.section-head h2,
.calendar-summary h3,
.detail-card h3,
.detail-lunar,
.reference-card h3,
.notice strong,
.button-secondary,
.site-link,
.lang-native {
  color: var(--text);
}

.hero-copy h1,
.hero-panel h2,
.overview h2,
.section-head h2 {
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}
