/* idefzero.com — base layout: the drawing sheet */

* { box-sizing: border-box; margin: 0; }

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

body {
  font-family: var(--body);
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--ink);
  padding: clamp(0.4rem, 1.2vw, 1rem);
  min-height: 100vh;
}

/* The sheet itself */
.sheet {
  position: relative;
  background: var(--mylar);
  min-height: calc(100vh - 2rem);
  padding: var(--sheet-pad);
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

/* Drawing frame: double border with zone ticks, drawn in CSS */
.sheet-frame {
  position: absolute;
  inset: var(--frame-inset);
  border: var(--rule-heavy);
  outline: 1px solid var(--prussian);
  outline-offset: 3px;
  pointer-events: none;
}
.sheet-frame::before, .sheet-frame::after {
  content: "";
  position: absolute;
  background-image: repeating-linear-gradient(90deg,
    var(--prussian) 0 1px, transparent 1px 25%);
}
.sheet-frame::before { top: -1px; left: 0; right: 0; height: 6px; }
.sheet-frame::after  { bottom: -1px; left: 0; right: 0; height: 6px; }

.sheet-body {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

/* Masthead */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap);
  flex-wrap: wrap;
  max-width: 72rem;
  margin: 0.5rem auto 0;
  width: 100%;
  padding-bottom: 0.75rem;
  border-bottom: var(--rule-heavy);
}
.masthead-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--prussian);
}
.mark-box {
  font-family: var(--mono);
  font-size: var(--text-sm);
  border: 2px solid var(--prussian);
  padding: 0.1rem 0.45rem;
}
.mark-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: 0.14em;
}
.masthead-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.masthead-nav a {
  font-family: var(--display);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--prussian);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.masthead-nav a:hover { border-bottom-color: var(--redline); }

/* Typography */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  color: var(--prussian);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.15;
}
h1 { font-size: var(--text-2xl); margin: 1.5rem 0 0.75rem; }
h2 { font-size: var(--text-xl); margin: 2.5rem 0 0.75rem; }
h3 { font-size: var(--text-lg); margin: 1.75rem 0 0.5rem; }
p, ul, ol { max-width: var(--measure); margin-bottom: 1rem; }
a { color: var(--prussian); }
a:hover { color: var(--redline); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--vellum); padding: 0.1em 0.3em; border: var(--rule); }

.lede {
  font-size: var(--text-lg);
  max-width: 52ch;
  color: var(--ink);
}
.eyebrow {
  font-family: var(--mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--prussian);
}

/* Title block — the signature. Bottom-right, like a real drawing.
   The row shares the 72rem content column so the block sits exactly on
   the colophon's top rule, which closes its bottom edge. */
.titleblock-row {
  max-width: 72rem;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: flex-end;
}
.titleblock {
  display: grid;
  grid-template-columns: minmax(12rem, auto) repeat(3, auto);
  border: var(--rule-heavy);
  border-bottom: none;
  background: var(--vellum);
  font-family: var(--mono);
  font-size: var(--text-sm);
  position: relative;
  z-index: 1;
}
.tb-cell {
  padding: 0.35rem 0.8rem 0.45rem;
  border-left: var(--rule);
  white-space: nowrap;
}
.tb-cell:first-child { border-left: none; }
.tb-title { font-weight: 500; }
.tb-org { grid-column: 1 / -1; border-top: var(--rule); border-left: none; }
.tb-label {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--prussian);
  opacity: 0.75;
}

/* Colophon */
.colophon {
  border-top: var(--rule-heavy);
  padding: 1rem 0 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
  width: 100%;
  font-size: var(--text-sm);
  color: var(--ink);
}
.colophon p { margin-bottom: 0.25rem; }

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--redline);
  outline-offset: 2px;
}

@media (max-width: 40rem) {
  .titleblock { grid-template-columns: 1fr 1fr; flex: 1; }
  .tb-title { grid-column: 1 / -1; border-left: none; white-space: normal; }
}
