/* Unix Timestamp Converter — base layout and variables */
:root {
  --bg: #0f0f12;
  --surface: #18181c;
  --border: #2a2a30;
  --text: #e4e4e7;
  --text-muted: #a1a1aa;
  --accent: #22c55e;
  --accent-hover: #4ade80;
  --error: #f87171;
  --radius: 12px;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-display: "DS-Digital", var(--font-mono);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header .title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  margin: 0 0 0.5rem;
  letter-spacing: 0.04em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 480px) {
  .header .title {
    font-size: 1.35rem;
  }
}

.tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s ease;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
}

.input::placeholder {
  color: var(--text-muted);
}

.input.mono {
  font-family: var(--font-mono);
}

.label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.output-row {
  margin-top: 0.5rem;
}

.output-row .label {
  margin-bottom: 0.25rem;
}

.value {
  font-size: 1rem;
  word-break: break-all;
}

.value.mono {
  font-family: var(--font-mono);
  font-weight: 500;
}

.value.output {
  color: var(--text);
}

.error {
  color: var(--error);
  font-size: 0.875rem;
  margin: 0 0 0.5rem;
}

.value-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.value-row .value {
  flex: 1;
  min-width: 0;
}

.btn-copy {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-copy:hover {
  background: var(--accent);
  color: var(--bg);
}

.btn-copy:active {
  transform: scale(0.98);
}

.btn-copy,
.btn-primary {
  transition: transform 0.1s ease;
}

.btn-copy.copied {
  border-color: #22c55e;
  color: #22c55e;
}

.btn-primary {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:active {
  transform: scale(0.99);
}

.now-block .now-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.now-item .value-row {
  margin-top: 0.25rem;
}

.now-block .value {
  white-space: nowrap;
}

.footer {
  text-align: center;
  padding-top: 2rem;
  margin-top: 0.5rem;
}

.credit {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (min-width: 480px) {
  .now-block .now-content {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .now-item {
    flex: 1;
    min-width: 280px;
  }
}
