/* =========================================================================
 * Unix Timestamp Converter — styles. Adapted from the HEIC tool template.
 * Accent: indigo #4f46e5. Site amber #f5a623, ink #0f1420, 1200px container.
 * All motion disabled under prefers-reduced-motion.
 * ========================================================================= */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --ink: #0f1420;
  --ink-soft: #4b5573;
  --ink-faint: #8a93ad;
  --line: #e2e7f2;
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --brand-soft: #eef2ff;
  --amber: #f5a623;
  --amber-soft: #fef6e0;
  --ok: #0f9d58;
  --ok-soft: #e5f6ec;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --err: #dc2626;
  --err-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 20, 32, 0.08);
  --shadow-lg: 0 18px 50px rgba(79, 70, 229, 0.16);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.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;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  text-decoration: none; font-weight: 700; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 12px; min-width: 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.05rem; min-width: 0; overflow-wrap: anywhere; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow);
}
.brand-mark svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; }
.nav { display: flex; gap: 4px; flex: none; }
.nav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  padding: 8px 12px; border-radius: 10px; transition: background 0.18s, color 0.18s;
}
.nav a:hover, .nav a:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }

/* ---------------- hero ---------------- */
.hero {
  padding: 26px 0 10px;
  background:
    radial-gradient(600px 300px at 15% 0%, rgba(79, 70, 229, 0.10), transparent 60%),
    radial-gradient(700px 320px at 90% 10%, rgba(245, 166, 35, 0.12), transparent 60%);
}
.hero h1 {
  font-size: clamp(1.65rem, 3.4vw, 2.25rem);
  line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 6px; max-width: none;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: 1rem; color: var(--ink-soft); max-width: none; margin: 0 0 12px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.trust-row li {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft);
  box-shadow: 0 2px 8px rgba(15, 20, 32, 0.05);
}
.trust-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

/* ---------------- live clock strip ---------------- */
.clock-strip { padding: 10px 0 0; }
.clock-card {
  background: linear-gradient(135deg, #171231, #2d1a63);
  color: #e8e4f7; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 18px;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 6px 24px; align-items: center;
}
.clock-main { min-width: 0; }
.clock-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #b9b3d6; margin: 0 0 2px; }
.clock-seconds { font-family: var(--mono); font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; color: #fff; line-height: 1.2; overflow-wrap: anywhere; }
.clock-seconds .tick { color: var(--amber); }
.clock-sub { min-width: 0; font-size: 0.88rem; color: #cfc9e8; }
.clock-sub code { font-family: var(--mono); color: #fff; overflow-wrap: anywhere; }
.clock-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.clock-actions .btn { flex: none; }

/* ---------------- tool card ---------------- */
.tool-section { padding: 16px 0 32px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: clamp(18px, 3vw, 28px);
}
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.tool-panel { min-width: 0; }
.tool-panel h2 { font-weight: 800; margin: 0 0 4px; font-size: 1.05rem; }
.panel-sub { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 14px; }
.field-label { font-weight: 700; display: block; margin: 0 0 6px; }
.text-input {
  width: 100%; font: inherit; font-family: var(--mono); font-size: 1rem;
  padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); min-width: 0;
}
.text-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18); }
select.text-input { font-family: var(--font); }
.unit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 10px; }
.unit-row .btn { white-space: nowrap; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mode-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0 0; }
.mode-row label { font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.mode-row input { accent-color: var(--brand); }
.error {
  color: var(--err); background: var(--err-soft); border-radius: 10px;
  font-size: 0.92rem; font-weight: 600; padding: 9px 12px; margin: 12px 0 0;
}
.error[hidden] { display: none; }
.empty-note { color: var(--ink-faint); font-size: 0.9rem; margin: 14px 0 0; }
.empty-note[hidden] { display: none; }

/* example chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; align-items: center; }
.chips-label { font-size: 0.86rem; font-weight: 700; color: var(--ink-soft); }
.chip {
  font: inherit; font-family: var(--mono); font-size: 0.85rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  background: var(--surface); color: var(--ink); font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}
.chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.chip:focus-visible { outline: 3px solid rgba(79, 70, 229, 0.35); outline-offset: 2px; }

/* result rows */
.results { margin-top: 16px; display: grid; gap: 8px; }
.results[hidden] { display: none; }
.res-row {
  display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) auto;
  gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px;
  background: #fafaff;
}
.res-label { font-weight: 700; font-size: 0.88rem; color: var(--ink-soft); min-width: 0; overflow-wrap: anywhere; }
.res-value { font-family: var(--mono); font-size: 0.92rem; overflow-wrap: anywhere; min-width: 0; word-break: break-all; }
.btn-copy {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 9px; padding: 6px 12px; font: inherit; font-size: 0.84rem; font-weight: 700;
  cursor: pointer; flex: none; transition: background 0.15s, border-color 0.15s;
}
.btn-copy:hover { background: var(--surface-2); border-color: var(--brand); }
.btn-copy.copied { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.btn-copy:focus-visible { outline: 3px solid rgba(79, 70, 229, 0.4); outline-offset: 2px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 0.92rem; text-decoration: none;
  padding: 10px 18px; transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-small { padding: 7px 13px; font-size: 0.85rem; border-radius: 10px; }
.btn-dark { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.btn-dark:hover { background: rgba(255, 255, 255, 0.2); }
.btn:focus-visible { outline: 3px solid rgba(79, 70, 229, 0.4); outline-offset: 2px; }

/* privacy */
.privacy { padding: 8px 0 44px; }
.privacy-card {
  background: linear-gradient(135deg, #171231, #2d1a63);
  color: #e8e4f7; border-radius: 22px; padding: clamp(22px, 3vw, 36px);
  box-shadow: var(--shadow-lg);
}
.privacy-card h2 { color: #fff; margin: 0 0 10px; font-size: 1.4rem; }
.privacy-card p { margin: 0 0 16px; }
.net-meter {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px; padding: 9px 16px; font-weight: 700; color: #fff;
}
.net-meter b { font-size: 1.15rem; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #34d399; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}
.verify-steps { margin: 16px 0 0; padding-left: 20px; }
.verify-steps li { margin: 6px 0; }
kbd {
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px; padding: 1px 7px; font: inherit; font-size: 0.85em;
}
.tool-card kbd, .content kbd {
  background: var(--surface-2); border-color: var(--line); color: var(--ink);
}

/* content */
.content { padding: 20px 0 44px; }
.content h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin: 0 0 12px; }
.content h3 { font-size: 1.08rem; margin: 26px 0 8px; }
.content p, .content li { color: var(--ink-soft); }
.content ol, .content ul { padding-left: 22px; }
.content li { margin: 6px 0; }
.content code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.content pre {
  background: var(--ink); color: #e8e4f7; border-radius: 12px; padding: 14px 16px;
  overflow-x: auto; font-size: 0.88rem; line-height: 1.55; margin: 12px 0;
}
.content pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.example-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.93rem; }
.example-table th, .example-table td {
  border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top;
  min-width: 0; overflow-wrap: anywhere;
}
.example-table th { background: var(--surface-2); font-weight: 800; }
.example-table td code { font-family: var(--mono); }
.prose-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.prose-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.prose-card h3 { margin: 0 0 6px; }
.prose-card p { margin: 0; font-size: 0.93rem; }

.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 18px; margin: 10px 0;
}
.faq summary { font-weight: 700; cursor: pointer; }
.faq summary:focus-visible { outline: 3px solid rgba(79, 70, 229, 0.35); outline-offset: 2px; border-radius: 6px; }
.faq details p { margin: 10px 0 2px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 18px 0 26px; color: var(--ink-faint); font-size: 0.85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: space-between; }
.site-footer p { margin: 0; }
.site-footer .footer-note { color: var(--ink-faint); }
.site-footer a { color: var(--brand); font-weight: 700; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* responsive */
@media (max-width: 860px) {
  .tool-layout { grid-template-columns: minmax(0, 1fr); }
  .clock-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .hero { padding: 20px 0 8px; }
  .unit-row { grid-template-columns: minmax(0, 1fr); }
  .unit-row .btn { width: 100%; }
  .res-row { grid-template-columns: minmax(0, 1fr) auto; }
  .res-label { grid-column: 1 / -1; }
  .btn-row .btn { flex: 1 1 auto; }
  .site-footer .wrap { flex-direction: column; gap: 2px; }
}

/* reduced motion: kill every animation */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
