/* TimePatch site — palette from the app icon (sunset gradient) and the app's dark UI. */

:root {
  --sunset-a: #f79e56;
  --sunset-b: #ec5566;
  --sunset-c: #e4426e;
  --paper: #fffdfb;
  --card: #ffffff;
  --ink: #26232e;
  --ink-soft: #6b6575;
  --line: #ece7e3;
  --accent: #4b63f2;
  --patch-bg: #23242b;
  --patch-ink: #e9e8ee;
  --patch-dim: #8e8d99;
  --ok: #34c77b;
  --shadow: 0 24px 60px -24px rgba(83, 35, 60, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17181d;
    --card: #1f2027;
    --ink: #eceaf0;
    --ink-soft: #a09aab;
    --line: #2c2d35;
    --accent: #7b8cff;
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  }
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "PingFang SC", "PingFang TC", "Apple SD Gothic Neo", "Noto Sans JP", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.mono,
.fix-diff,
.patch-card {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

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

a {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- header ---------- */

.site-header {
  position: relative;
  z-index: 2;
}

/* on the index page the header floats over the hero gradient,
   so no sliver of body background can show above it */
body[data-page="index"] .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(60, 10, 30, 0.3);
}

.header-spacer {
  flex: 1;
}

#lang-picker {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background-color: rgba(255, 255, 255, 0.14);
  background-image:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 16 16"><g fill="none" stroke="white" stroke-width="1.3"><circle cx="8" cy="8" r="6.3"/><ellipse cx="8" cy="8" rx="2.8" ry="6.3"/><path d="M1.7 8h12.6M2.8 4.6h10.4M2.8 11.4h10.4"/></g></svg>'),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" fill="none" stroke="white" stroke-width="1.6" stroke-linecap="round"/></svg>');
  background-repeat: no-repeat;
  background-position: left 12px center, right 12px center;
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  padding: 7px 32px 7px 34px;
  border-radius: 999px;
  cursor: pointer;
}

#lang-picker option {
  color: #26232e;
  background: #fff;
}

/* privacy page has no gradient hero — header sits on paper */
body[data-page="privacy"] .brand {
  color: var(--ink);
}

body[data-page="privacy"] .brand img {
  box-shadow: none;
}

body[data-page="privacy"] #lang-picker {
  border-color: var(--line);
  background-color: var(--card);
  color: var(--ink);
  background-image:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 16 16"><g fill="none" stroke="%23888" stroke-width="1.3"><circle cx="8" cy="8" r="6.3"/><ellipse cx="8" cy="8" rx="2.8" ry="6.3"/><path d="M1.7 8h12.6M2.8 4.6h10.4M2.8 11.4h10.4"/></g></svg>'),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" fill="none" stroke="%23888" stroke-width="1.6" stroke-linecap="round"/></svg>');
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding-top: 75px;
  background: linear-gradient(155deg, var(--sunset-a) 0%, var(--sunset-b) 55%, var(--sunset-c) 100%);
  color: #fff;
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 190px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
  text-wrap: balance;
}

.hero-lede {
  font-size: 1.02rem;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.92);
  max-width: 34em;
  margin-bottom: 28px;
}

.hero-cta {
  display: inline-block;
  background: #fff;
  color: var(--sunset-c);
  font-weight: 700;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 999px;
  box-shadow: 0 8px 24px -8px rgba(60, 10, 30, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(60, 10, 30, 0.55);
}

/* the signature: a dark, app-like card where a wrong date gets patched */

.patch-card {
  background: var(--patch-bg);
  color: var(--patch-ink);
  border-radius: 16px;
  padding: 22px 24px;
  font-size: 0.88rem;
  line-height: 1.9;
  box-shadow: var(--shadow);
  min-width: 0;
}

.patch-file {
  color: var(--patch-dim);
  font-size: 0.8rem;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  overflow-wrap: anywhere;
}

.patch-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.patch-key {
  color: var(--patch-dim);
  font-size: 0.8rem;
  min-width: 4.5em;
}

.patch-old {
  position: relative;
  color: var(--patch-dim);
}

.patch-old::after {
  content: "";
  position: absolute;
  left: 0;
  top: 52%;
  height: 2px;
  width: 100%;
  background: var(--sunset-b);
  transform: scaleX(0);
  transform-origin: left center;
  animation: strike 0.45s ease-out 0.7s forwards;
}

.patch-new {
  color: #fff;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  animation: stamp 0.4s cubic-bezier(0.2, 1.4, 0.5, 1) 1.3s forwards;
}

.patch-new::before {
  content: "→ ";
  color: var(--ok);
  font-weight: 400;
}

.patch-chip {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.76rem;
  color: var(--ok);
  border: 1px solid rgba(52, 199, 123, 0.45);
  border-radius: 999px;
  padding: 2px 12px;
  opacity: 0;
  animation: fadein 0.4s ease 1.9s forwards;
}

.patch-caption {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", sans-serif;
  color: var(--patch-dim);
  font-size: 0.78rem;
  line-height: 1.6;
  margin-top: 14px;
}

@keyframes strike {
  to { transform: scaleX(1); }
}

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

@keyframes fadein {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .patch-old::after { animation: none; transform: scaleX(1); }
  .patch-new { animation: none; opacity: 1; transform: none; }
  .patch-chip { animation: none; opacity: 1; }
  .hero-cta { transition: none; }
}

/* ---------- screenshot overlapping the hero ---------- */

.shot-section {
  margin-top: -150px;
  position: relative;
  z-index: 1;
}

.shot-frame {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- sections ---------- */

.section {
  padding: 72px 0 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 26px;
}

/* fix ledger */

.fix-list {
  list-style: none;
  border-top: 1px solid var(--line);
}

.fix-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto;
  gap: 8px 24px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.fix-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.fix-diff {
  font-size: 0.82rem;
  justify-self: end;
  text-align: right;
}

.fix-diff del {
  color: var(--ink-soft);
  text-decoration-color: var(--sunset-b);
  text-decoration-thickness: 2px;
}

.fix-diff ins {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

.fix-diff ins::before {
  content: "→ ";
  color: var(--ok);
  font-weight: 400;
}

/* FAQ */

#faq-list details {
  border-bottom: 1px solid var(--line);
}

#faq-list details:first-child {
  border-top: 1px solid var(--line);
}

#faq-list summary {
  cursor: pointer;
  font-weight: 600;
  padding: 16px 4px;
  list-style-position: outside;
}

#faq-list summary::marker {
  color: var(--sunset-b);
}

#faq-list p {
  padding: 0 4px 18px 24px;
  color: var(--ink-soft);
  max-width: 44em;
}

/* support */

.support-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 8px 30px -18px rgba(83, 35, 60, 0.25);
}

.support-card p {
  color: var(--ink-soft);
  max-width: 44em;
  margin-bottom: 22px;
}

.form-button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 999px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.form-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.form-pending {
  display: inline-block;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.92rem;
  margin-bottom: 0 !important;
}

/* ---------- privacy page ---------- */

.doc {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 0;
}

.doc h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.doc-updated {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

.doc-intro {
  font-size: 1.02rem;
  margin-bottom: 12px;
}

.doc h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 30px 0 8px;
}

.doc p {
  color: var(--ink-soft);
}

.doc-back {
  display: inline-block;
  margin-top: 40px;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 88px;
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
}

.site-footer a {
  color: var(--ink-soft);
}

.footer-spacer {
  flex: 1;
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-bottom: 150px;
  }

  .shot-section {
    margin-top: -110px;
  }

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

  .fix-diff {
    justify-self: start;
    text-align: left;
  }

  .support-card {
    padding: 26px 22px;
  }
}
