:root {
  color-scheme: light;
  --bg: #f6fbff;
  --bg-2: #e8f1f8;
  --ink: #0c2434;
  --muted: #537187;
  --line: #d9e6f2;
  --accent: #0b6ad3;
  --accent-2: #00a1ff;
  --accent-3: #7be0ff;
  --danger: #c94141;
  --shadow: 0 20px 60px rgba(12, 36, 52, 0.12);
  --radius: 24px;
  --ring-bg: #e7f1f7;
  --font-display: "Space Grotesk", "IBM Plex Sans JP", sans-serif;
  --font-body: "IBM Plex Sans JP", "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(160deg, #f7fbff 0%, #e7f3ff 55%, #f8fbff 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.glow {
  position: absolute;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(0, 161, 255, 0.3), rgba(0, 161, 255, 0));
  top: -120px;
  right: -60px;
  filter: blur(2px);
}

.mesh {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(transparent 94%, rgba(11, 106, 211, 0.08) 95%),
    linear-gradient(90deg, transparent 94%, rgba(11, 106, 211, 0.08) 95%);
  background-size: 120px 120px;
  opacity: 0.3;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 12px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0b6ad3, #00a1ff);
  color: #fff;
  font-size: 18px;
}

.brand-name {
  font-weight: 600;
  font-size: 20px;
}

.brand-tagline {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.top-actions {
  display: flex;
  gap: 12px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero-text p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 24px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.metric-value {
  font-weight: 600;
  margin-top: 6px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(12, 36, 52, 0.04);
}

.active-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.card-header h2 {
  font-size: 22px;
  font-weight: 600;
}

.status-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-2);
  color: var(--muted);
}

.status-pill.status-active {
  background: rgba(0, 161, 255, 0.12);
  color: #0b6ad3;
}

.status-pill.status-done {
  background: #e6f7ec;
  color: #1f7a4a;
}

.status-pill.status-failed,
.status-pill.status-failed_paid {
  background: #f9ecec;
  color: #c94141;
}

.progress-wrap {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.progress-ring {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0%, var(--ring-bg) 0%);
  display: grid;
  place-items: center;
  transition: background 0.5s ease;
}

.progress-center {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: inset 0 0 20px rgba(12, 36, 52, 0.05);
}

.progress-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.progress-time {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
}

.progress-sub {
  font-size: 12px;
  color: var(--muted);
}

.progress-meta {
  display: grid;
  gap: 12px;
}

.meta-label {
  font-size: 12px;
  color: var(--muted);
}

.meta-value {
  font-weight: 500;
}

.card-actions {
  display: flex;
  gap: 12px;
}

button {
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button:active {
  transform: scale(0.98);
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(11, 106, 211, 0.2);
}

.primary:hover {
  background: #095fbe;
}

.ghost {
  background: #f2f7fb;
  color: var(--ink);
}

.danger {
  background: #f9ecec;
  color: var(--danger);
}

.danger:hover {
  background: #f4dddd;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.form-card form {
  display: grid;
  gap: 18px;
  margin-top: 12px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-family: var(--font-body);
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 106, 211, 0.12);
}

.helper {
  font-size: 12px;
  color: var(--muted);
}

.quick-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-picks button {
  background: var(--bg-2);
  color: var(--ink);
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 999px;
}

.pledge-card {
  display: grid;
  gap: 20px;
}

.pledge {
  display: grid;
  gap: 12px;
}

.philosophy-card {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(11, 106, 211, 0.15);
  background: linear-gradient(180deg, #ffffff 0%, #f1f7ff 100%);
}

.philosophy-card h3 {
  font-size: 20px;
}

.philosophy-card p {
  color: var(--muted);
  line-height: 1.8;
}

.philosophy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pledge-lead {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.toggle input {
  width: 18px;
  height: 18px;
}

.history {
  display: grid;
  gap: 18px;
}

.history-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.history-list {
  list-style: none;
  display: grid;
  gap: 12px;
}

.history-list li {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.history-list .empty {
  color: var(--muted);
  justify-content: center;
}

.tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-2);
}

.tag.status-done {
  background: #e6f7ec;
  color: #1f7a4a;
}

.tag.status-failed,
.tag.status-failed_paid {
  background: #f9ecec;
  color: #c94141;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.modal.is-open {
  opacity: 1;
  pointer-events: all;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 30, 45, 0.4);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, 90vw);
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.modal-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--muted);
}

.modal-text {
  color: var(--muted);
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.legal-card {
  width: min(680px, 92vw);
}

.legal-content {
  display: none;
  gap: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.legal-content.is-active {
  display: grid;
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 24px 16px 48px;
  font-size: 12px;
  display: grid;
  gap: 12px;
}

.legal-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.link {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

[data-animate] {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.8s ease forwards;
}

[data-animate]:nth-of-type(1) {
  animation-delay: 0.1s;
}

[data-animate]:nth-of-type(2) {
  animation-delay: 0.2s;
}

[data-animate]:nth-of-type(3) {
  animation-delay: 0.3s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

  .progress-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .progress-meta {
    grid-auto-flow: row;
  }

  .history-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 32px 18px 60px;
  }

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

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .card-actions {
    flex-direction: column;
  }

  .progress-ring {
    width: 180px;
    height: 180px;
  }
}
