:root {
  --sand-50: #fdf8f1;
  --sand-100: #f8ecd9;
  --sand-200: #efd6b0;
  --amber-400: #d9922b;
  --amber-500: #bc7a1f;
  --ink-900: #1e1a17;
  --ink-700: #4a4036;
  --ink-500: #75685c;
  --paper: rgba(255, 255, 255, 0.88);
  --border: rgba(30, 26, 23, 0.18);
  --focus: #0f766e;
  --shadow: 0 20px 40px rgba(46, 32, 19, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  color: var(--ink-900);
  background:
    radial-gradient(
      circle at 15% 10%,
      rgba(239, 214, 176, 0.45),
      transparent 38%
    ),
    radial-gradient(
      circle at 90% 8%,
      rgba(188, 122, 31, 0.22),
      transparent 36%
    ),
    linear-gradient(150deg, #fefaf3 0%, #f8ecd9 45%, #f5e2c4 100%);
  font-family: "IBM Plex Sans", "Noto Sans", "Liberation Sans", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.page {
  width: min(1040px, calc(100% - 2rem));
  margin: 2rem auto 2.5rem;
  animation: fade-slide 320ms ease-out;
}

.hero {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.96),
    rgba(255, 248, 237, 0.88)
  );
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.4rem 1.4rem 1.6rem;
  box-shadow: var(--shadow);
}

.hero__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  font-weight: 700;
  text-decoration: none;
}

.brand__logo {
  width: 1.8rem;
  height: 1.8rem;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
}

.brand__name {
  letter-spacing: 0.02em;
}

.hero__nav {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--ink-700);
}

.hero__content {
  margin-top: 1rem;
}

.hero__eyebrow {
  margin: 0;
  color: var(--amber-500);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.hero h1 {
  margin: 0.4rem 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", serif;
  font-size: clamp(1.6rem, 2vw + 1rem, 2.45rem);
  line-height: 1.18;
}

.hero p {
  margin: 0;
  color: var(--ink-700);
}

.hero__owner {
  margin: 1.1rem 0 0;
  color: var(--ink-500);
  font-size: 0.92rem;
}

.hero__owner a {
  font-weight: 600;
}

.grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.1rem;
  box-shadow: 0 10px 22px rgba(48, 34, 21, 0.1);
}

.panel h2 {
  margin: 0;
  font-size: 1.1rem;
}

.panel > p {
  margin-top: 0.35rem;
  color: var(--ink-700);
}

.field {
  margin-top: 0.9rem;
  display: block;
  font-weight: 600;
}

textarea,
input {
  margin-top: 0.35rem;
  width: 100%;
  font: inherit;
  color: var(--ink-900);
  border-radius: 12px;
  border: 1px solid rgba(30, 26, 23, 0.25);
  background: rgba(255, 255, 255, 0.94);
  padding: 0.65rem 0.75rem;
}

.panel--editor textarea {
  resize: vertical;
}

.field--radio {
  margin-top: 0.9rem;
  border: 0;
  padding: 0;
}

.field--radio legend {
  padding: 0;
  font-weight: 600;
}

.field--radio label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 1rem 0 0;
}

.field--radio input {
  margin: 0;
  width: auto;
}

button {
  margin-top: 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(130deg, var(--amber-400), var(--amber-500));
  color: #fff;
  padding: 0.62rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(188, 122, 31, 0.3);
}

.preview {
  margin-top: 0.75rem;
  min-height: 6.5rem;
  border-radius: 12px;
  border: 1px dashed rgba(30, 26, 23, 0.25);
  background: #fff;
  padding: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.preview img {
  max-width: 100%;
  height: auto;
}

.snippets {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.65rem;
}

.snippet {
  display: block;
}

.snippet > span {
  display: inline-block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.snippet textarea {
  min-height: 4.8rem;
  font-family: "IBM Plex Mono", "Cascadia Code", "Fira Code", monospace;
  font-size: 0.88rem;
  resize: vertical;
  color: #2a2018;
}

.panel__links {
  margin: 0.9rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-weight: 600;
}

.permalink {
  margin: 0.95rem 0 0;
  color: var(--ink-700);
  font-size: 0.92rem;
}

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

  .hero {
    padding: 1.1rem;
  }

  .page {
    width: min(1040px, calc(100% - 1rem));
  }
}

@keyframes fade-slide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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