:root {
  --ink: #20252c;
  --ink-soft: #414851;
  --muted: #68717b;
  --line: #d9dddc;
  --line-strong: #aeb5b5;
  --paper: #ffffff;
  --wash: #f5f2ec;
  --accent: #9b402d;
  --accent-dark: #743020;
  --accent-soft: #f4e4df;
  --sage: #c8d6d3;
  --success: #245f45;
  --success-soft: #e4f1e9;
  --warning: #7a5619;
  --warning-soft: #fff4d8;
  --error: #8b2f25;
  --error-soft: #f9e5e2;
  --radius: 10px;
  --shadow: 0 18px 48px rgb(32 37 44 / 8%);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  overflow-x: hidden;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--wash);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
}

a,
button,
input,
textarea {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgb(155 64 45 / 18%);
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button,
input,
textarea {
  font: inherit;
}

button,
.button,
a {
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

:focus-visible {
  outline: 3px solid rgb(155 64 45 / 42%);
  outline-offset: 3px;
}

.wrap {
  width: calc(100% - 48px);
  max-width: 1160px;
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgb(245 242 236 / 92%);
}

.header-inner {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: 600 25px/1 var(--serif);
  letter-spacing: -0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.brand i {
  width: 22px;
  height: 5px;
  flex: 0 0 auto;
  background: var(--accent);
}

.brand:hover {
  color: var(--accent-dark);
}

.brand-small {
  font-size: 18px;
}

.brand-small i {
  width: 16px;
  height: 4px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

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

.site-nav .editor-link {
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.site-nav .editor-link:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.home {
  min-width: 0;
}

.edition {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 44px 0 15px;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

time {
  font-variant-numeric: tabular-nums;
}

.feature {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 5vw, 68px);
  padding: 28px 0 72px;
  border-bottom: 1px solid var(--line);
}

.feature-art {
  min-width: 0;
  min-height: 500px;
  display: grid;
  align-items: end;
  padding: clamp(24px, 3vw, 34px);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 18%), transparent 45%),
    var(--sage);
  color: var(--paper);
  font: clamp(88px, 13vw, 178px) / 0.72 var(--serif);
}

.feature-art-image {
  display: block;
  padding: 0;
  background: var(--sage);
}

.feature-art-image img {
  width: 100%;
  height: 100%;
  min-height: 500px;
  display: block;
  object-fit: cover;
  transition: transform 300ms ease;
}

.feature-art-image:hover img {
  transform: scale(1.018);
}

.feature-copy {
  min-width: 0;
  align-self: end;
  padding-bottom: 18px;
}

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

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

.feature-copy h1 {
  max-width: 100%;
  margin: 0;
  font: 500 clamp(36px, 4.4vw, 56px) / 1 var(--serif);
  letter-spacing: -0.052em;
}

.feature-copy > p:not(.eyebrow) {
  max-width: 48ch;
  margin: 24px 0;
  color: var(--muted);
  font-size: 17px;
}

.read-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.read-link b,
.arrow-link {
  color: var(--accent);
  font-size: 24px;
}

.read-link:hover {
  color: var(--accent-dark);
  transform: translateX(3px);
}

.archive {
  padding: 58px 0 92px;
  scroll-margin-top: 24px;
}

.archive-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  border-bottom: 1px solid var(--ink);
}

.archive-head h2 {
  margin: 0 0 18px;
  font: 500 35px/1.1 var(--serif);
}

.archive-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 44px;
  gap: 20px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.archive-row time {
  color: var(--muted);
  font-size: 13px;
}

.archive-row h3 {
  min-width: 0;
  margin: 0;
  font: 500 23px/1.22 var(--serif);
}

.archive-row h3 a {
  text-decoration: none;
}

.archive-row h3 a:hover {
  color: var(--accent-dark);
}

.arrow-link {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  text-decoration: none;
}

.archive-empty,
.muted {
  color: var(--muted);
}

.empty-state,
.error-page {
  max-width: 780px;
  min-height: 58vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 0;
}

.empty-state h1,
.error-page h1 {
  margin: 0;
  font: 500 clamp(42px, 7vw, 76px) / 1 var(--serif);
  letter-spacing: -0.05em;
}

.empty-state > p:not(.eyebrow),
.error-page > p:not(.eyebrow) {
  max-width: 52ch;
  color: var(--muted);
  font-size: 18px;
}

.article {
  padding-bottom: 100px;
}

.article-top {
  max-width: 920px;
  padding-top: 50px;
  text-align: center;
}

.back-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent-dark);
}

.article-top .back-link {
  margin-bottom: 34px;
}

.article-top h1 {
  max-width: 100%;
  margin: 14px auto 44px;
  font: 500 clamp(32px, 4vw, 52px) / 1.08 var(--serif);
  letter-spacing: -0.052em;
}

.article-cover {
  width: 100%;
  height: min(50vw, 560px);
  min-height: 300px;
  background:
    linear-gradient(145deg, transparent, rgb(155 64 45 / 14%)),
    var(--sage);
}

.article-gallery {
  width: min(calc(100% - 32px), 960px);
  margin-inline: auto;
  overflow: hidden;
  border-radius: 18px;
  background: var(--ink);
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  position: relative;
  width: 100%;
  min-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  background: #11161c;
  scroll-margin-top: 20px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.carousel-slide:target {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 44%);
  border-radius: 50%;
  background: rgb(17 22 28 / 72%);
  color: var(--paper);
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.carousel-arrow:hover {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}

.carousel-arrow-previous {
  left: clamp(14px, 3vw, 38px);
}

.carousel-arrow-next {
  right: clamp(14px, 3vw, 38px);
}

.carousel-count {
  position: absolute;
  right: clamp(14px, 3vw, 38px);
  bottom: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgb(17 22 28 / 72%);
  color: var(--paper);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.06em;
  backdrop-filter: blur(8px);
}

.carousel-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 15px 16px 17px;
  background: var(--wash);
}

.carousel-dots a {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.carousel-dots a:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.article-video {
  width: min(calc(100% - 32px), 960px);
  margin-inline: auto;
}

.article-gallery + .article-video {
  margin-top: 28px;
}

.video-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
  border-radius: 18px;
  background: var(--ink);
  color: var(--paper);
}

.video-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.video-preview::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgb(10 14 18 / 70%),
    transparent 55%
  );
  content: "";
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 52%);
  border-radius: 50%;
  background: rgb(155 64 45 / 90%);
  font-size: 28px;
  line-height: 1;
  text-indent: 4px;
  transform: translate(-50%, -50%);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.video-label {
  position: absolute;
  right: 22px;
  bottom: 20px;
  left: 22px;
  z-index: 1;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-align: center;
}

.video-preview:hover .video-play {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.06);
}

.article-body {
  max-width: 700px;
  padding-top: 54px;
  white-space: pre-line;
  font: 22px/1.72 var(--serif);
}

.article-source {
  max-width: 700px;
  margin-top: 30px;
}

.article-source a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--accent-dark);
  font-weight: 750;
}

.auth-shell {
  min-height: calc(100vh - 175px);
  display: grid;
  place-items: center;
  padding-block: 64px;
}

.auth-card {
  width: min(100%, 520px);
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.auth-card h1,
.admin h1,
.narrow h1 {
  margin: 0;
  font: 500 clamp(38px, 5vw, 52px) / 1.05 var(--serif);
  letter-spacing: -0.045em;
}

.auth-card > .muted {
  margin: 18px 0 26px;
}

.auth-back {
  margin-top: 22px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

label {
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  max-width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
}

input {
  min-height: 48px;
  padding: 10px 12px;
}

textarea {
  min-height: 210px;
  padding: 12px;
  line-height: 1.55;
  resize: vertical;
}

input:hover,
textarea:hover {
  border-color: var(--ink-soft);
}

input:focus,
textarea:focus {
  border-color: var(--accent);
}

.file-input {
  min-height: 52px;
  padding: 6px;
  color: var(--muted);
}

.file-input::file-selector-button {
  min-height: 38px;
  margin-right: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--wash);
  color: var(--ink);
  font: 700 13px/1 var(--sans);
  cursor: pointer;
}

.file-input::file-selector-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

button,
.button {
  min-height: 46px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  padding: 11px 18px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: var(--paper);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.button-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button-ghost:hover {
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

.button-danger {
  border-color: var(--error);
  background: var(--error);
  color: var(--paper);
}

.button-danger:hover {
  border-color: #7f241d;
  background: #7f241d;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.form-actions button,
.form-actions .button,
.form-actions form {
  margin-top: 0;
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.alert {
  margin: 22px 0;
  padding: 13px 15px;
  border: 1px solid;
  border-radius: 7px;
  overflow-wrap: anywhere;
}

.alert-error {
  border-color: #d6a19b;
  background: var(--error-soft);
  color: var(--error);
}

.alert-warning {
  border-color: #ddc480;
  background: var(--warning-soft);
  color: var(--warning);
}

.alert-success {
  border-color: #9fc4af;
  background: var(--success-soft);
  color: var(--success);
}

code {
  font: 0.9em Consolas, monospace;
}

.admin {
  padding: 54px 0 88px;
}

.admin-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-actions form {
  margin: 0;
}

.admin-actions .button {
  margin-top: 0;
}

.admin-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  min-width: 0;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.panel h2 {
  margin: 0;
  font: 500 28px/1.15 var(--serif);
  letter-spacing: -0.035em;
}

.panel > .muted {
  margin: 10px 0 0;
}

.panel-divider {
  height: 1px;
  margin: 30px 0;
  border: 0;
  background: var(--line);
}

.archive-panel {
  padding-bottom: 12px;
}

.admin-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.admin-list li {
  min-width: 0;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.admin-list time {
  color: var(--muted);
  font-size: 13px;
}

.admin-list a {
  min-width: 0;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.admin-list a:hover {
  color: var(--accent-dark);
}

.admin-post-summary {
  min-width: 0;
}

.admin-post-title {
  display: block;
}

.admin-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  font-size: 13px;
}

.admin-post-actions a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.admin-post-actions .danger-link {
  color: var(--error);
}

.admin-editor .panel,
.delete-confirmation .panel {
  margin-top: 26px;
}

.image-manager {
  min-width: 0;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
}

.image-manager legend {
  padding: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
}

.image-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.image-manager-item {
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--wash);
  cursor: pointer;
}

.image-manager-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  border-radius: 5px;
  background: var(--ink);
  object-fit: cover;
}

.image-manager-item span {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--ink);
  font-size: 13px;
}

.image-manager-item input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--error);
}

.narrow {
  max-width: 760px;
  padding: 62px 0 90px;
}

.narrow > .eyebrow {
  margin-top: 32px;
}

.narrow > .muted {
  margin-bottom: 28px;
}

.about-copy {
  margin-top: 34px;
  font: 20px/1.65 var(--serif);
}

.about-copy p {
  margin: 0 0 20px;
}

.error-page .button {
  margin-top: 14px;
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 13px;
}

.footer-details {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-details a,
.about-copy a {
  color: var(--accent-dark);
}

@media (max-width: 900px) {
  .feature {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .feature-art {
    min-height: 390px;
  }

  .feature-art-image img {
    min-height: 390px;
  }

  .feature-copy {
    max-width: 720px;
    padding-bottom: 0;
  }

  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .header-inner {
    min-height: 72px;
    gap: 12px;
  }

  .brand {
    font-size: 21px;
  }

  .brand i {
    width: 16px;
    height: 4px;
  }

  .site-nav {
    flex: 0 0 auto;
  }

  .site-nav > a:not(.editor-link) {
    display: none;
  }

  .site-nav .editor-link {
    min-height: 42px;
    padding: 7px 10px;
  }

  .edition {
    align-items: flex-start;
    padding-top: 28px;
  }

  .feature {
    padding: 20px 0 54px;
  }

  .feature-art {
    min-height: 310px;
    padding: 22px;
    font-size: 88px;
  }

  .feature-art-image img {
    min-height: 310px;
  }

  .feature-copy h1 {
    font-size: clamp(32px, 10vw, 42px);
    line-height: 1.04;
  }

  .feature-copy > p:not(.eyebrow) {
    margin: 20px 0;
    font-size: 16px;
  }

  .archive {
    padding: 44px 0 64px;
  }

  .archive-row {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
    padding: 18px 0;
  }

  .archive-row time {
    grid-column: 1 / -1;
  }

  .archive-row h3 {
    font-size: 20px;
  }

  .article {
    padding-bottom: 70px;
  }

  .article-top {
    padding-top: 30px;
    text-align: left;
  }

  .article-top .back-link {
    margin-bottom: 28px;
  }

  .article-top h1 {
    margin-bottom: 34px;
    font-size: clamp(30px, 8.4vw, 38px);
  }

  .article-cover {
    height: 280px;
    min-height: 0;
  }

  .carousel-slide {
    aspect-ratio: 4 / 3;
  }

  .carousel-arrow {
    width: 44px;
    height: 44px;
  }

  .carousel-count {
    bottom: 14px;
  }

  .article-gallery,
  .article-video {
    width: calc(100% - 24px);
    border-radius: 12px;
  }

  .video-preview {
    border-radius: 12px;
  }

  .video-play {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }

  .article-body {
    padding-top: 36px;
    font-size: 19px;
  }

  .auth-shell {
    min-height: auto;
    padding-block: 36px 54px;
  }

  .auth-card {
    padding: 26px 22px;
  }

  .admin {
    padding: 38px 0 62px;
  }

  .admin-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-actions .button {
    flex: 1 1 auto;
  }

  .panel {
    padding: 22px 18px;
  }

  .admin-list li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .narrow {
    padding: 40px 0 64px;
  }

  button,
  .button {
    min-height: 48px;
  }

  .footer-inner {
    min-height: 112px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding-block: 22px;
  }

  .footer-details {
    align-items: flex-start;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
