@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/SpaceGrotesk-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/SpaceGrotesk-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/SpaceGrotesk-SemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/SpaceGrotesk-Bold.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/IBMPlexMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/IBMPlexMono-Medium.woff2') format('woff2');
}

:root {
  --bg: #f6f2ea;
  --ink: #10131a;
  --muted: #4c5566;
  --accent: #ff7a1a;
  --accent-dark: #d85f00;
  --surface: #ffffff;
  --border: #e2d8c8;
  --shadow: rgba(16, 19, 26, 0.12);
  --glow: rgba(255, 122, 26, 0.18);
  --control-height: 38px;
  --remove-size: 28px;
  --action-primary: #4a3522;
  --action-primary-hover: #5a3f28;
  --action-primary-text: #fff4e8;
  --action-secondary: #f3dec9;
  --action-secondary-hover: #ecd2ba;
  --action-secondary-text: #4a3522;
  --action-shadow: rgba(74, 53, 34, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(255, 122, 26, 0.12), transparent 55%),
    radial-gradient(circle at 20% 40%, rgba(16, 19, 26, 0.07), transparent 45%),
    var(--bg);
  min-height: 100vh;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 72px;
  animation: fade-in 0.6s ease-out;
}

.hero {
  display: flex;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}

h1 {
  font-size: clamp(32px, 4vw, 56px);
  margin: 0 0 16px;
  line-height: 1.05;
}

.lede {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px 24px;
  box-shadow: 0 20px 60px -40px var(--shadow);
  min-width: 260px;
  display: grid;
  gap: 16px;
}

.footer {
  margin-top: 28px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #d7c7b5;
}

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

.output-card {
  margin: 16px 0 18px;
  min-width: 0;
  padding: 16px 18px;
  background: #fff7ef;
  border-color: #f1d4bc;
  box-shadow: none;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.hero-stat span {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.panel {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: 0 18px 40px -32px var(--shadow);
  animation: float-in 0.7s ease-out;
}

.panel h2,
.panel h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.mode-block {
  margin-bottom: 24px;
}

.mode-block + .mode-block {
  margin-top: 1rem;
}

.mode-block + h2 {
  margin-top: 1rem;
}

.summary + h2 {
  margin-top: 1rem;
}

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

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #fdfbf8;
  border: 1px dashed #e8dcc8;
}

.mode-row label {
  flex: 1 1 0;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

input[type="number"] {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 15px;
  font-family: "Space Grotesk", sans-serif;
  height: var(--control-height);
  min-width: 0;
  width: 100%;
}

select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 15px;
  font-family: "Space Grotesk", sans-serif;
  background: #fff;
  height: var(--control-height);
  min-width: 0;
  width: 100%;
}

.remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--remove-size);
  height: var(--remove-size);
  padding: 0;
  font-size: 16px;
  line-height: 1;
  border-radius: 999px;
  align-self: flex-end;
  margin-bottom: calc((var(--control-height) - var(--remove-size)) / 2);
  margin-left: 0;
}

.options {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.option {
  display: grid;
  gap: 6px;
}

.toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 15px;
  color: var(--muted);
}

.auto-mark {
  font-size: 12px;
  color: var(--ink);
  transform: translateY(-1px);
}

.auto-note {
  font-size: 12px;
  color: var(--muted);
  margin-left: 28px;
}

.note-mark {
  font-size: 12px;
  color: var(--ink);
  transform: translateY(-1px);
}

.note-text {
  font-size: 12px;
  color: var(--muted);
  margin-left: 28px;
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn.action {
  border-radius: 14px;
  padding: 12px 22px;
  font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: 0 16px 30px -24px var(--action-shadow);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -18px var(--shadow);
  border-color: var(--accent);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}

.btn.primary {
  background: var(--action-primary);
  border-color: var(--action-primary);
  color: var(--action-primary-text);
  box-shadow: 0 16px 30px -24px var(--action-shadow);
}

.btn.primary:hover {
  background: var(--action-primary-hover);
  border-color: var(--action-primary-hover);
}

.btn.ghost {
  background: transparent;
}

.btn.secondary {
  background: var(--action-secondary);
  border-color: var(--action-secondary);
  color: var(--action-secondary-text);
  box-shadow: 0 16px 30px -24px var(--action-shadow);
}

.btn.secondary:hover {
  background: var(--action-secondary-hover);
  border-color: var(--action-secondary-hover);
}

.remove-btn {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--ink);
  cursor: pointer;
}

.remove-btn:hover {
  background: transparent;
  border: none;
  box-shadow: none;
  transform: none;
  color: var(--ink);
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: #4a3522;
  margin-bottom: 16px;
}

.summary.meta {
  margin-bottom: 10px;
}

.pill {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff4e8;
  border: 1px solid #f1d4bc;
  max-width: 100%;
}

.pill-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a07249;
}

.pill-value {
  font-size: 14px;
  font-weight: 600;
  color: #4a3522;
}

.pill.status {
  justify-content: center;
  min-height: 48px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 18px;
}

.hex-details {
  margin: 8px 0 12px;
}

.hex-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}

.hex-details[open] summary {
  color: var(--ink);
}

.hex {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 16px;
  min-height: 120px;
  overflow-x: auto;
  margin: 0;
}

.helper {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-line;
}

.footnote {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
  }

  .hero-card {
    width: 100%;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
