:root {
  --bg: #c45c32;
  --paper: #f3eee4;
  --paper-2: #ebe6da;
  --ink: #1c1917;
  --muted: #6f6a63;
  --faint: #9a948b;
  --rule: #d8d1c4;
  --rule-strong: #c8c0b0;
  --accent: #d4532a;
  --accent-deep: #b54422;
  --screen: #15241b;
  --screen-glow: #3ee08a;
  --status: #e23b3b;
  --shadow: 0 18px 50px rgba(92, 32, 12, 0.22);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

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

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

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 220, 180, 0.18), transparent 55%),
    var(--bg);
}

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

img {
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

.frame {
  padding: 28px 22px 36px;
}

.paper {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.paper::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  min-height: 54px;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-mark {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px 8px 20px;
  border-left: 1px solid var(--rule);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status);
  box-shadow: 0 0 0 3px rgba(226, 59, 59, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-fill {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf4;
}

.btn-fill:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fffaf4;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 640px;
}

.home-copy {
  padding: 34px 40px 28px;
  border-right: 1px solid var(--rule);
}

.home-iso {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  background: #1a1420;
}

.kicker {
  margin: 0 0 22px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.headline {
  margin: 0 0 20px;
  max-width: 13ch;
  font-family: var(--serif);
  font-size: clamp(40px, 4.6vw, 56px);
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.headline em {
  font-style: normal;
  color: var(--accent);
}

.lede {
  max-width: 46ch;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.specs span {
  display: block;
}

.specs dt,
.spec-label {
  margin-bottom: 6px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.specs dd,
.spec-value {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.latest {
  margin: 8px 0 28px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

.latest-card {
  display: grid;
  gap: 6px;
}

.latest-card:hover .latest-title {
  color: var(--accent);
}

.latest-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.latest .log-excerpt {
  max-width: none;
}

.note-label,
.meta-label {
  margin: 0 0 10px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.stage {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.stage th,
.stage td {
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  font-weight: 500;
}

.stage th {
  color: var(--faint);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  max-width: 22ch;
  padding-right: 16px;
  vertical-align: top;
}

.stage td:last-child {
  text-align: right;
  color: var(--muted);
}

.stage tr:last-child th,
.stage tr:last-child td {
  border-bottom: 0;
}

.home-photo {
  position: absolute;
  inset: 0;
  margin: 0;
}

.home-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.home-photo figcaption {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-photo-label,
.home-photo-meta {
  position: absolute;
  margin: 0;
  color: rgba(243, 238, 228, 0.86);
  text-shadow: 0 1px 8px rgba(20, 10, 24, 0.45);
}

.home-photo-label {
  top: 18px;
  right: 28px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.home-photo-meta {
  right: 28px;
  bottom: 18px;
  text-align: right;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.page-body {
  padding: 36px 48px 56px;
}

.page-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page-intro {
  max-width: 62ch;
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.log-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.log-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}

.log-item:hover .log-title {
  color: var(--accent);
}

.log-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.log-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.log-excerpt {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.log-go {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.empty-log {
  padding: 28px 0;
  color: var(--muted);
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 48px;
  align-items: start;
}

.post-header {
  margin-bottom: 28px;
}

.post-kicker {
  margin: 0 0 12px;
}

.prose {
  max-width: 62ch;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  font-optical-sizing: auto;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose h2,
.prose h3 {
  margin: 1.6em 0 0.6em;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.prose h2 { font-size: 1.45em; }
.prose h3 { font-size: 1.18em; }

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1.05em;
}

.prose a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: rgba(196, 92, 50, 0.08);
  padding: 0.1em 0.35em;
}

.prose pre {
  overflow: auto;
  padding: 16px 18px;
  background: #2a2724;
  color: #f3eee4;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 1.2em;
}

.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.prose blockquote {
  margin: 0 0 1.2em;
  padding: 0 0 0 16px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.prose img,
.prose video {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.2em 0;
  border: 1px solid var(--rule);
  background: #1c1917;
}

.prose video {
  max-height: 72vh;
}

.post-side {
  position: sticky;
  top: 24px;
  padding-top: 8px;
}

.post-side .stage {
  margin-bottom: 22px;
}

.back-link {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.writer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 640px;
}

.writer:has(#gate-form:not([hidden])) {
  grid-template-columns: minmax(0, 32rem);
}

.writer-form,
.writer-main,
.writer-preview {
  padding: 32px 36px 48px;
}

.writer-form,
.writer-main {
  border-right: 1px solid var(--rule);
}

.writer-main .writer-form {
  padding: 0;
  border-right: 0;
}

.now-form {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.now-intro {
  margin: 0 0 16px;
  max-width: 44ch;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.writer-preview {
  background: var(--paper-2);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--rule-strong);
  background: #fffaf4;
  color: var(--ink);
  padding: 10px 12px;
}

.field textarea {
  min-height: 340px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid rgba(212, 83, 42, 0.35);
  border-color: var(--accent);
}

.field textarea.is-drop {
  outline: 2px solid rgba(212, 83, 42, 0.35);
  border-color: var(--accent);
  background: #fff4ea;
}

.media-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.media-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.writer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.save-status {
  margin: -8px 0 16px;
  min-height: 1.2em;
  font-size: 12px;
  color: var(--muted);
}

.flash {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--accent-deep);
}

.existing {
  margin-top: 36px;
}

.existing a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}

.existing a:hover {
  color: var(--accent);
}

.existing a.is-draft::after {
  content: "Draft";
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.preview-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.preview-date {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px 16px;
  border-top: 1px solid var(--rule);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.locked {
  padding: 64px 48px;
  text-align: center;
}

.locked h1 {
  font-family: var(--serif);
  font-weight: 600;
}

@media (max-width: 980px) {
  .home-grid,
  .writer,
  .post-layout {
    grid-template-columns: 1fr;
  }

  .home-copy {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .writer-form,
  .writer-main {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .writer-main .writer-form {
    border-bottom: 0;
  }

  .post-side {
    position: static;
  }

  .page-body,
  .home-copy,
  .writer-form,
  .writer-main,
  .writer-preview {
    padding: 28px 22px;
  }

  .writer-main .writer-form {
    padding: 0;
  }

  .home-iso {
    min-height: 420px;
  }
}

@media (max-width: 780px) {
  .frame {
    padding: 0;
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .brand,
  .header-status {
    min-height: 48px;
  }

  .header-status {
    justify-content: space-between;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .log-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .home-photo-label,
  .home-photo-meta {
    right: 22px;
  }
}
