:root {
  --bg: #071120;
  --bg-deep: #040914;
  --surface: rgba(10, 22, 40, 0.72);
  --surface-strong: rgba(14, 28, 50, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.08);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: #f5f7ff;
  --muted: #aab6d3;
  --blue: #70a7ff;
  --purple: #9d7cff;
  --amber: #ffb36b;
  --green: #5fd6a6;
  --danger: #ff7b92;
  --shadow: 0 24px 70px rgba(5, 10, 25, 0.35);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(112, 167, 255, 0.28), transparent 30%),
    radial-gradient(circle at 85% 18%, rgba(255, 179, 107, 0.18), transparent 22%),
    linear-gradient(180deg, #081224 0%, #050b16 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(7, 17, 32, 0.28), rgba(7, 17, 32, 0.86)),
    url("./assets/hero-time-arc.png") center top / cover no-repeat;
  opacity: 0.34;
  pointer-events: none;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 0 auto;
  width: min(42vw, 560px);
  aspect-ratio: 1;
  background: url("./assets/time-ripple-texture.png") center / cover no-repeat;
  opacity: 0.14;
  filter: blur(8px);
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.site-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 20px 0 64px;
}

.topbar,
.hero,
.workspace,
.about,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(7, 17, 32, 0.64);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(112, 167, 255, 0.9), rgba(157, 124, 255, 0.95));
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(112, 167, 255, 0.25);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.72rem;
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 22px;
}

.site-nav a,
.nav-action {
  color: var(--muted);
  border: 0;
  background: transparent;
  transition: color 180ms ease, transform 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.nav-action:hover,
.nav-action:focus-visible {
  color: var(--text);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
  border-radius: 999px;
}

.panel,
.glass,
.modal-card,
.about-card,
.countdown-card,
.control-panel,
.detail-panel {
  border: 1px solid var(--stroke);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  border-radius: var(--radius-xl);
}

.glass {
  border-radius: calc(var(--radius-xl) - 4px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  gap: 28px;
  padding: 40px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(7, 17, 32, 0.84) 25%, rgba(7, 17, 32, 0.36)),
    url("./assets/hero-time-arc.png") right center / cover no-repeat;
  opacity: 0.95;
  z-index: -1;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.eyebrow {
  margin: 0;
  color: #bfd0f3;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.hero h1,
.section-head h2,
.about h2 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-family: "Space Grotesk", sans-serif;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  max-width: 11ch;
}

.hero-text,
.about-card p,
.modal-copy,
.detail-empty p,
.footer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.hero-actions,
.share-actions,
.detail-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags span,
.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.84rem;
}

.badge {
  background: rgba(112, 167, 255, 0.14);
  color: #dce9ff;
}

.status-pill {
  background: rgba(95, 214, 166, 0.14);
  color: #d5f8ea;
}

.status-pill.is-expired {
  background: rgba(255, 123, 146, 0.14);
  color: #ffd7de;
}

.hero-stage {
  padding: 22px;
  align-self: stretch;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(10, 22, 40, 0.72)),
    rgba(10, 22, 40, 0.4);
}

.hero-stage__meta,
.hero-stage__footer,
.detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-stage__meta,
.hero-stage__footer p,
.detail-target {
  color: var(--muted);
}

.hero-stage h2,
.detail-content h3 {
  margin: 20px 0 18px;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.1;
}

.hero-stage h2 {
  font-size: clamp(1.9rem, 4vw, 3.1rem);
}

.detail-content h3 {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.countdown-grid--hero {
  gap: 14px;
}

.time-tile {
  padding: 18px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03));
  text-align: center;
}

.time-value {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.06em;
}

.time-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.btn,
.icon-button {
  border: 0;
  transition:
    transform 160ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    opacity 180ms ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
}

.btn:hover,
.btn:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
}

.btn:active,
.icon-button:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #081224;
  background: linear-gradient(135deg, #f0d5c2, #fff4ea);
  box-shadow: 0 18px 34px rgba(240, 213, 194, 0.18);
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-ghost {
  color: #d8e5ff;
  background: transparent;
  border: 1px solid rgba(216, 229, 255, 0.22);
}

.btn-danger {
  color: #fff3f5;
  background: rgba(255, 123, 146, 0.18);
  border: 1px solid rgba(255, 123, 146, 0.22);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.workspace,
.about {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  max-width: 12ch;
}

.section-head--compact h2 {
  max-width: 16ch;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  gap: 20px;
}

.rail,
.list-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.control-panel,
.detail-panel,
.about {
  padding: 22px;
  border-radius: var(--radius-xl);
}

.control-row,
.form-grid {
  display: grid;
  gap: 14px;
}

.control-row {
  grid-template-columns: 1fr 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  color: #dce6fb;
  font-size: 0.92rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(112, 167, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(112, 167, 255, 0.14);
}

.field textarea {
  resize: vertical;
  min-height: 112px;
}

.field--full {
  grid-column: 1 / -1;
}

.error-text {
  min-height: 1.2em;
  color: #ffc1cb;
  font-size: 0.82rem;
}

.form-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 123, 146, 0.2);
  border-radius: var(--radius-md);
  color: #ffd7de;
  background: rgba(255, 123, 146, 0.08);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stat-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.stat-card strong,
.countdown-card__cell strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  letter-spacing: -0.05em;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-empty,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 28px;
  text-align: center;
}

.detail-empty__title,
.empty-state__title {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-meta {
  display: grid;
  gap: 14px;
  margin: 0;
}

.detail-meta div,
.share-box {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.detail-meta dt,
.share-box__label {
  color: #dce6fb;
  font-size: 0.82rem;
}

.detail-meta dd,
.share-box p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.skeleton-grid,
.card-grid,
.about-grid {
  display: grid;
  gap: 16px;
}

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

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

.skeleton-card,
.countdown-card {
  min-height: 250px;
  border-radius: 28px;
}

.skeleton-card {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.countdown-card {
  position: relative;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(9, 21, 39, 0.84)),
    rgba(10, 22, 40, 0.74);
  box-shadow: var(--shadow);
}

.countdown-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent, var(--blue));
}

.countdown-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -45px auto;
  width: 180px;
  aspect-ratio: 1;
  background: url("./assets/time-ripple-texture.png") center / cover no-repeat;
  opacity: 0.14;
  filter: blur(2px);
}

.countdown-card.is-selected {
  outline: 2px solid rgba(240, 213, 194, 0.8);
}

.countdown-card.is-expired {
  filter: saturate(0.72);
}

.countdown-card__header,
.countdown-card__footer,
.countdown-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.countdown-card__header {
  margin-bottom: 18px;
}

.countdown-card__title {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.25;
}

.countdown-card__meta,
.countdown-card__note,
.countdown-card__target {
  color: var(--muted);
  line-height: 1.7;
}

.countdown-card__days {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.countdown-card__cell {
  padding: 10px 8px;
  border-radius: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
}

.countdown-card__cell span {
  display: block;
  margin-top: 4px;
  font-size: 0.76rem;
}

.countdown-card__actions {
  flex-wrap: wrap;
  margin-top: 18px;
}

.countdown-card__actions button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
}

.about {
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(10, 22, 40, 0.84), rgba(10, 22, 40, 0.74)),
    url("./assets/time-ripple-texture.png") center / cover no-repeat;
}

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

.about-card {
  padding: 24px;
}

.about-card h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 12px 4px 0;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 18, 0.72);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  width: min(100%, 720px);
  padding: 24px;
  border-radius: 28px;
  background: var(--surface-strong);
}

.modal-card--small {
  width: min(100%, 480px);
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.modal-head h3 {
  margin: 6px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
}

.modal-actions {
  margin-top: 22px;
  justify-content: flex-end;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 60;
}

.toast {
  min-width: 220px;
  max-width: min(92vw, 320px);
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(10, 22, 40, 0.92);
  box-shadow: var(--shadow);
}

.fab {
  position: fixed;
  right: 18px;
  bottom: 22px;
  display: none;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  color: #081224;
  font-size: 2rem;
  background: linear-gradient(135deg, #f0d5c2, #fff4ea);
  box-shadow: 0 18px 34px rgba(240, 213, 194, 0.18);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.fab.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

[data-color="blue"] {
  --accent: var(--blue);
}

[data-color="purple"] {
  --accent: var(--purple);
}

[data-color="amber"] {
  --accent: var(--amber);
}

[data-color="green"] {
  --accent: var(--green);
}

@media (max-width: 1179px) {
  .hero,
  .workspace-grid,
  .about-grid,
  .card-grid,
  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 28px;
  }

  .footer {
    flex-direction: column;
  }
}

@media (max-width: 860px) {
  .site-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding-top: 14px;
  }

  .topbar {
    border-radius: 28px;
  }

  .menu-toggle {
    display: inline-block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: min(80vw, 300px);
    padding: 16px;
    border: 1px solid var(--stroke);
    border-radius: 24px;
    background: rgba(7, 17, 32, 0.96);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a,
  .nav-action {
    padding: 10px 12px;
    border-radius: 14px;
    text-align: left;
  }

  .site-nav a:hover,
  .nav-action:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .control-row,
  .stats-grid,
  .countdown-grid,
  .countdown-card__days {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

@media (max-width: 699px) {
  .hero,
  .control-panel,
  .detail-panel,
  .about,
  .modal-card {
    padding: 20px;
  }

  .hero h1 {
    max-width: none;
  }

  .hero-stage__meta,
  .hero-stage__footer,
  .detail-topline,
  .countdown-card__header,
  .countdown-card__footer {
    align-items: start;
    flex-direction: column;
  }

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

  .toast-stack {
    right: 10px;
    left: 10px;
    bottom: 12px;
  }

  .toast {
    max-width: none;
  }

  .fab {
    display: inline-grid;
    place-items: center;
  }
}
