:root {
  --bg: #ffffff;
  --bg-soft: rgba(255, 255, 255, 0.92);
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --text: #060606;
  --muted: #5f5f5f;
  --line: rgba(0, 0, 0, 0.12);
  --accent: #050505;
  --accent-deep: #000000;
  --danger: #111111;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.06);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: Consolas, monospace;
}

.page-shell,
.admin-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.page-shell {
  padding: 32px 0 48px;
}

.site-header,
.admin-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0 28px;
}

.brand-block {
  max-width: 460px;
}

.brand {
  display: inline-block;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: auto;
  max-width: min(420px, 72vw);
  max-height: 150px;
  height: auto;
  object-fit: contain;
}

.brand-text-fallback {
  display: inline-block;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.brand-copy,
.admin-subtitle,
.muted-copy {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.top-nav,
.admin-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.top-nav a,
.button-secondary,
.button-primary,
.button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.button-primary {
  background: var(--accent);
  border-color: transparent;
  color: #ffffff;
  font-weight: 700;
}

.button-secondary {
  background: #ffffff;
}

.button-ghost {
  background: transparent;
}

.button-ghost.danger {
  color: var(--danger);
}

.top-nav a:hover,
.top-nav a:focus-visible,
.button-secondary:hover,
.button-primary:hover,
.button-ghost:hover {
  transform: translateY(-1px);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent-deep);
}

.hero,
.article-listing {
  margin-top: 24px;
}

.featured-article,
.article-content,
.admin-card,
.admin-login-card,
.not-found,
.stat-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.featured-article {
  padding: clamp(24px, 4vw, 42px);
}

.featured-home {
  display: grid;
  gap: 24px;
}

.article-meta,
.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.featured-media {
  position: relative;
  display: block;
  min-height: 520px;
  aspect-ratio: 16 / 11;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.media-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.has-photo::after,
.article-photo-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 18%, rgba(0, 0, 0, 0.74) 100%);
}

.featured-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 4vw, 36px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 20%, rgba(0, 0, 0, 0.72) 100%);
}

.featured-overlay,
.article-hero-overlay {
  z-index: 1;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-deep);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.featured-overlay .eyebrow,
.article-hero .eyebrow {
  color: rgba(255, 255, 255, 0.82);
}

.featured-overlay h1,
.section-heading h2,
.article-card h3,
.article-hero h1,
.admin-card h2,
.admin-login-card h1,
.not-found h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  letter-spacing: -0.04em;
}

.featured-overlay h1,
.article-hero h1 {
  max-width: 11ch;
  color: #ffffff;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.94;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #ffffff;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.article-card:hover,
.article-card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(0, 0, 0, 0.24);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.06);
}

.card-media {
  position: relative;
  display: block;
  min-height: 280px;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.card-media::before,
.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card-media::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 55%),
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.18), transparent 22%),
    radial-gradient(circle at 75% 28%, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.34) 100%);
}

.card-media::after {
  inset: auto 14% 18% 14%;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 -34px 0 rgba(255, 255, 255, 0.1),
    0 34px 0 rgba(255, 255, 255, 0.08);
}

.card-arrow {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #000000;
  font-size: 1.35rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

.hero-arrow {
  position: static;
  width: 64px;
  height: 64px;
  font-size: 1.6rem;
  color: var(--text);
}

.visual-featured {
  background:
    radial-gradient(circle at 22% 24%, rgba(255, 255, 255, 0.16), transparent 17%),
    radial-gradient(circle at 75% 22%, rgba(255, 255, 255, 0.08), transparent 18%),
    radial-gradient(circle at 48% 58%, rgba(255, 255, 255, 0.04), transparent 28%),
    linear-gradient(145deg, #101010 0%, #303030 44%, #000000 100%);
}

.visual-mist {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.16), transparent 22%),
    radial-gradient(circle at 72% 30%, rgba(255, 255, 255, 0.09), transparent 26%),
    linear-gradient(145deg, #2a2a2a 0%, #151515 52%, #000000 100%);
}

.visual-echo {
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.15), transparent 20%),
    radial-gradient(circle at 72% 36%, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(145deg, #1f1f1f 0%, #4b4b4b 38%, #111111 100%);
}

.visual-rhythm {
  background:
    radial-gradient(circle at 24% 26%, rgba(255, 255, 255, 0.14), transparent 18%),
    radial-gradient(circle at 78% 24%, rgba(255, 255, 255, 0.08), transparent 20%),
    linear-gradient(145deg, #151515 0%, #353535 48%, #000000 100%);
}

.visual-pulse {
  background:
    radial-gradient(circle at 26% 30%, rgba(255, 255, 255, 0.14), transparent 18%),
    radial-gradient(circle at 74% 24%, rgba(255, 255, 255, 0.08), transparent 20%),
    linear-gradient(145deg, #202020 0%, #4b4b4b 45%, #0a0a0a 100%);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-card h3 {
  font-size: 1.85rem;
  line-height: 1.05;
}

.article-card h3 a:hover,
.article-card h3 a:focus-visible {
  color: var(--accent-deep);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding: 22px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.article-page {
  margin-top: 20px;
}

.article-layout {
  display: grid;
  gap: 24px;
}

.article-hero {
  position: relative;
  padding: clamp(28px, 4vw, 42px);
  min-height: 420px;
  aspect-ratio: 16 / 10;
  border-radius: 28px;
  overflow: hidden;
}

.article-visual {
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.article-hero-overlay {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: end;
  height: 100%;
}

.article-hero-image {
  z-index: 0;
}

.article-date {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.article-content {
  width: min(760px, 100%);
  padding: clamp(24px, 4vw, 34px);
}

.article-content p {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 1.03rem;
  line-height: 1.95;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 2rem 0 0.9rem;
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.article-content h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.article-content h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.article-content h3 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.4rem 1.2rem;
  padding: 0;
}

.article-content li {
  margin-bottom: 0.65rem;
  line-height: 1.85;
}

.article-content hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.article-content blockquote {
  margin: 0 0 1.6rem;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid #000000;
}

.article-content blockquote p {
  color: var(--muted);
}

.article-content a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.article-content code {
  padding: 0.14rem 0.38rem;
  border-radius: 8px;
  background: #f3f3f3;
  font-size: 0.94em;
}

.article-content pre {
  margin: 0 0 1.6rem;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border-radius: 18px;
  background: #0b0b0b;
  color: #ffffff;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.article-content img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 1.6rem;
  border-radius: 22px;
}

.article-content .article-lead {
  color: var(--muted);
  font-weight: 600;
}

.back-link {
  display: inline-flex;
  margin-top: 8px;
  color: var(--accent-deep);
  font-weight: 700;
}

.flash {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.84);
}

.flash-success {
  border-color: rgba(49, 128, 77, 0.24);
}

.flash-error {
  border-color: rgba(164, 58, 48, 0.24);
}

.admin-body {
  background: #ffffff;
}

.admin-shell {
  padding: 28px 0 48px;
}

.admin-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.admin-login-card {
  width: min(460px, 100%);
  padding: 32px;
}

.admin-login-card h1 {
  margin-top: 18px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.admin-form,
.editor-form,
.settings-stack {
  display: grid;
  gap: 18px;
}

.admin-form label,
.editor-form label,
.inline-form label {
  display: grid;
  gap: 8px;
}

.admin-form span,
.editor-form span,
.inline-form span {
  font-weight: 700;
}

.editor-media-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
  align-items: start;
}

.image-guidance {
  padding: 18px;
  border: 1px solid rgba(35, 31, 27, 0.08);
  border-radius: 20px;
  background: #ffffff;
}

.image-guidance p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.7;
}

.image-guidance p:last-child {
  margin-bottom: 0;
}

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(35, 31, 27, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

.stats-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.admin-grid {
  grid-template-columns: 1.3fr 1fr;
  margin-top: 18px;
}

.stat-card {
  padding: 24px;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
}

.admin-card {
  padding: 24px;
  margin-top: 18px;
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-card h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(35, 31, 27, 0.08);
  text-align: left;
  vertical-align: top;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(191, 90, 54, 0.12);
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ip-box {
  padding: 18px;
  border: 1px solid rgba(35, 31, 27, 0.08);
  border-radius: 20px;
  background: rgba(255, 251, 246, 0.82);
}

.ip-box p {
  margin: 0 0 10px;
}

.top-article-list {
  display: grid;
  gap: 14px;
}

.top-article-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(35, 31, 27, 0.08);
  border-radius: 20px;
  background: #ffffff;
}

.top-article-item p {
  margin: 8px 0 0;
  color: var(--muted);
}

.current-logo-preview {
  width: min(100%, 360px);
  max-height: 120px;
  object-fit: contain;
  border-radius: 24px;
  border: 1px solid rgba(35, 31, 27, 0.08);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.current-image-card {
  display: grid;
  gap: 12px;
}

.current-image-preview {
  width: min(100%, 420px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(35, 31, 27, 0.08);
  box-shadow: var(--shadow);
}

.compact-checkbox {
  padding-top: 0;
}

.table-cover {
  width: 74px;
  height: 96px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(35, 31, 27, 0.08);
}

.table-cover-fallback {
  display: block;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 34px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.checkbox-field span {
  font-weight: 600;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.not-found {
  display: grid;
  gap: 14px;
  max-width: 720px;
  margin: 8vh auto 0;
  padding: 32px;
}

@media (max-width: 980px) {
  .stats-grid,
  .admin-grid,
  .editor-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .site-header,
  .admin-topbar,
  .section-heading,
  .site-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-nav,
  .admin-topbar-actions {
    justify-content: flex-start;
  }

  .brand-block {
    max-width: 100%;
  }

  .brand-logo {
    max-width: min(320px, 68vw);
    max-height: 112px;
  }

  .featured-media {
    min-height: 420px;
    aspect-ratio: 4 / 5;
  }

  .featured-overlay h1,
  .article-hero h1 {
    max-width: 100%;
  }

  .featured-overlay,
  .article-hero-overlay {
    gap: 18px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .page-shell,
  .admin-shell {
    width: min(calc(100% - 1.25rem), 1120px);
  }

  .featured-article,
  .article-content,
  .admin-card,
  .admin-login-card,
  .stat-card,
  .not-found {
    border-radius: 22px;
  }

  .page-shell {
    padding: 18px 0 34px;
  }

  .top-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .top-nav a {
    white-space: nowrap;
  }

  .brand-logo {
    max-width: min(260px, 72vw);
    max-height: 96px;
  }

  .featured-media {
    min-height: 360px;
    aspect-ratio: 4 / 5;
  }

  .featured-overlay {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
  }

  .hero-arrow {
    width: 56px;
    height: 56px;
  }

  .article-meta,
  .card-meta {
    flex-direction: column;
  }

  .card-meta {
    gap: 6px;
  }

  .stats-grid,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .article-card h3 {
    font-size: 1.55rem;
  }

  .card-media {
    min-height: 320px;
    aspect-ratio: 4 / 5;
  }

  .article-hero {
    min-height: 380px;
    aspect-ratio: 4 / 5;
  }

  .article-content {
    width: 100%;
    padding: 22px 18px;
  }

  .article-content p {
    font-size: 0.98rem;
    line-height: 1.85;
  }

  .article-content h1 {
    font-size: 1.8rem;
  }

  .article-content h2 {
    font-size: 1.45rem;
  }

  .site-footer {
    padding-top: 18px;
  }

  .button-secondary,
  .button-primary,
  .button-ghost {
    width: 100%;
  }

  .admin-topbar-actions {
    width: 100%;
  }

  .table-cover {
    width: 58px;
    height: 78px;
  }
}
