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

:root {
  --paper: #f6f7f2;
  --ink: #151515;
  --muted: #666b60;
  --line: #222;
  --panel: #fff;
  --mist: #dfe9dd;
  --rose: #e87d88;
  --blue: #4169e1;
  --olive: #8da35d;
  --radius: 7px;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(21,21,21,0.05) 1px, transparent 1px),
    linear-gradient(180deg, #fbfbf8 0%, var(--paper) 100%);
  background-size: 44px 44px, auto;
  color: var(--ink);
  font-family: "Work Sans", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.studio-shell {
  width: min(1320px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.desk-top,
.desk-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 2px solid var(--line);
}

.desk-footer {
  border-top: 2px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--rose);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  font-weight: 600;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.desk-nav,
.desk-footer {
  color: var(--muted);
}

.desk-nav,
.desk-footer nav {
  display: flex;
  gap: 18px;
}

.writing-desk {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  gap: 16px;
  padding: 16px 0;
}

.brief-panel,
.editor-panel,
.drawer-panel {
  min-width: 0;
}

.brief-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 2px solid var(--line);
  padding: 10px 16px 10px 0;
}

.kicker,
.surface-head span,
.note-strip span,
.ad-badge {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--blue);
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 14px;
  font-family: "DM Serif Display", serif;
  font-size: 3.8rem;
  line-height: 0.92;
  font-weight: 400;
}

h2 {
  font-size: 1.5rem;
}

.field-stack {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

label {
  font-size: 0.92rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 12px;
}

textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.55;
}

.ink-button,
.editor-tab {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-weight: 700;
}

.ink-button {
  background: var(--ink);
  color: #fff;
}

.editor-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

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

.editor-tab {
  background: var(--mist);
  color: var(--ink);
}

.editor-tab.is-active {
  background: var(--rose);
}

.editor-surface {
  display: none;
  min-height: 640px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px;
}

.editor-surface.is-active {
  display: grid;
  align-content: start;
  gap: 14px;
}

.surface-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.drawer-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.note-strip,
.ad-slot {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--mist);
  padding: 16px;
}

.note-strip p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.ad-slot {
  min-height: 110px;
  background: #fff;
}

.ad-slot-sidebar { min-height: 230px; }
.ad-slot-inline { min-height: 120px; }
.ad-slot.is-hidden { display: none; }

.drawer-panel.ads-empty .ad-slot { display: none; }

.ad-link {
  display: grid;
  gap: 10px;
}

.ad-link-image {
  overflow: hidden;
  border-radius: var(--radius);
  border: 2px solid var(--line);
}

.ad-link-image img {
  display: block;
  width: 100%;
  height: auto;
}

.ad-copy {
  display: grid;
  gap: 4px;
}

.ad-copy span {
  color: var(--muted);
  line-height: 1.5;
}

.subpage-main {
  max-width: 880px;
  margin: 22px auto;
  display: grid;
  gap: 14px;
}

.subpage-hero,
.policy-card {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px;
}

.subpage-hero p,
.policy-card p,
.policy-card li {
  color: var(--muted);
  line-height: 1.7;
}

.policy-card ul {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 1080px) {
  .writing-desk {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .drawer-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .note-strip {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .studio-shell {
    width: min(100% - 18px, 1320px);
  }

  .desk-top,
  .desk-footer,
  .desk-nav,
  .desk-footer nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .writing-desk,
  .drawer-panel,
  .editor-tabs {
    grid-template-columns: 1fr;
  }

  .brief-panel {
    border-right: 0;
    border-bottom: 2px solid var(--line);
    padding: 0 0 16px;
  }

  h1 {
    font-size: 2.7rem;
  }

  .editor-surface {
    min-height: 420px;
    padding: 16px;
  }
}
