/* ─── Page reset ─────────────────────────────────────────────── */
:root {
  --paper: #f6f3ec;
  --ink: #111111;
  --ink-soft: #444;
  --accent: #c8392e;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: #0a0a0a;
  font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }

/* ─── Stage scaling — fixed 1600×1000, scaled to viewport ────── */
.app {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #1a1a1a 0%, #0a0a0a 100%);
}
.stage {
  position: absolute;
  top: 50%; left: 50%;
  width: 1600px; height: 1000px;
  background: var(--paper);
  color: var(--ink);
  transform: translate(-50%, -50%);
  transform-origin: center center;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(0,0,0,0.025) 0, transparent 38%),
    radial-gradient(circle at 88% 78%, rgba(0,0,0,0.025) 0, transparent 38%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.012) 0 1px, transparent 1px 4px);
  box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.4);
  overflow: hidden;
}

/* ─── Drawing frame ──────────────────────────────────────────── */
.frame-outer {
  position: absolute;
  top: 24px; left: 24px; right: 24px; bottom: 24px;
  border: 1px solid var(--ink);
  pointer-events: none;
}
.frame-inner {
  position: absolute;
  top: 32px; left: 32px; right: 32px; bottom: 32px;
  border: 1.5px solid var(--ink);
  pointer-events: none;
}

.reg {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  font-size: 14px;
  color: var(--ink);
  line-height: 1;
}
.reg-l { left: 11px; }
.reg-r { right: 11px; }

.grid-labels {
  position: absolute;
  display: flex;
  justify-content: space-around;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink);
  letter-spacing: 0.1em;
  pointer-events: none;
}
.grid-labels-top    { top: 4px; left: 32px; right: 32px; }
.grid-labels-bottom { bottom: 4px; left: 32px; right: 32px; }
.grid-labels-left {
  top: 32px; bottom: 32px;
  left: 8px;
  flex-direction: column;
  align-items: center;
}
.grid-labels-right {
  top: 32px; bottom: 32px;
  right: 8px;
  flex-direction: column;
  align-items: center;
}

/* ─── Header ─────────────────────────────────────────────────── */
.header {
  position: absolute;
  top: 32px; left: 32px; right: 32px;
  height: 92px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  border-bottom: 1.5px solid var(--ink);
  padding: 0 18px;
}
.logo {
  display: flex; align-items: center; gap: 14px;
  color: var(--ink);
}
.logo svg { display: block; }
.logo-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  line-height: 1.35;
  border-left: 1px solid rgba(0,0,0,0.25);
  padding-left: 14px;
}
.logo-pn { font-weight: 600; }
.logo-rev { opacity: 0.55; }

.social { display: flex; align-items: stretch; gap: 0; }
.social-box {
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  border-left: 1px solid rgba(0,0,0,0.25);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s;
}
.social-box:first-child { border-left: none; }
.social-box:hover { background: rgba(0,0,0,0.05); }
.social-glyph {
  display: grid; place-items: center;
  width: 32px; height: 32px;
}
.social-text {
  display: flex; flex-direction: column;
  line-height: 1.25;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
}
.social-label { font-size: 11px; font-weight: 600; }
.social-sub { font-size: 12px; opacity: 0.75; }

/* ─── Portrait ───────────────────────────────────────────────── */
.portrait-wrap {
  position: absolute;
  inset: 32px 32px 32px 32px;
  pointer-events: none;
  z-index: 2;
}
.portrait-svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}

/* ─── Description — left column ──────────────────────────────── */
.notes {
  position: absolute;
  top: 200px;
  left: 64px;
  width: 420px;
  z-index: 4;
}
.description {
  font-family: "JetBrains Mono", monospace;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
}
.description p { margin: 0 0 14px 0; text-wrap: pretty; }

.tooling {
  position: absolute;
  top: 404px;
  right: 64px;
  width: 460px;
  z-index: 4;
}
.block-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  margin-bottom: 14px;
}
.block-no {
  font-weight: 600;
  background: var(--ink);
  color: var(--paper);
  padding: 2px 6px;
}
.block-title { font-weight: 700; color: var(--ink); }
.block-rule {
  flex: 1; height: 1px;
  background: var(--ink);
  opacity: 0.6;
  margin-bottom: 3px;
}

.spec-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.spec-list li {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px dotted rgba(0,0,0,0.3);
}
.spec-list span { opacity: 0.55; }
.spec-list b { font-weight: 600; letter-spacing: 0.02em; }

/* ─── Revision table ─────────────────────────────────────────── */
.revtable {
  position: absolute;
  top: 219px;
  right: 64px;
  width: 460px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  z-index: 4;
  border-top: 1.2px solid var(--ink);
  border-bottom: 1.2px solid var(--ink);
}
.rev-head, .rev-row {
  display: grid;
  grid-template-columns: 36px 60px 1fr 32px;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px dotted rgba(0,0,0,0.4);
}
.rev-row:last-child { border-bottom: none; }
.rev-head {
  background: rgba(0,0,0,0.05);
  font-weight: 700;
  letter-spacing: 0.14em;
}
.rev-row-current { background: rgba(0,0,0,0.02); }

/* ─── Titleblock ─────────────────────────────────────────────── */
.titleblock {
  position: absolute;
  right: 32px;
  bottom: 32px;
  width: 760px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  z-index: 5;
}
.tb-row { display: grid; border-bottom: 1px solid var(--ink); }
.tb-row:last-child { border-bottom: none; }
.tb-row-1 {
  grid-template-columns: 1fr 90px 110px;
  height: 110px;
}
.tb-row-2 {
  grid-template-columns: repeat(5, 1fr);
  height: 50px;
}
.tb-cell {
  position: relative;
  border-right: 1px solid var(--ink);
  padding: 8px 10px;
  display: flex; flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.tb-cell:last-child { border-right: none; }

.tb-label {
  position: absolute;
  top: 4px; left: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 8.5px;
  letter-spacing: 0.18em;
  opacity: 0.55;
}
.tb-value {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
}
.tb-value-xl {
  font-size: 50px;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-top: 0px;  /* 16px */
}
.tb-value-md {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  opacity: 0.65;
  margin-top: 2px;
}
.tb-value-sm {
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.1em;
  margin-top: 10px;
}
.tb-mono-big {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-align: center;
  margin-top: 6px;
}
.tb-project { padding-right: 14px; }

/* ─── Bottom slug ────────────────────────────────────────────── */
.slug {
  position: absolute;
  left: 64px;
  bottom: 38px;
  display: flex; gap: 14px;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  opacity: 0.55;
  z-index: 5;
}
.slug-dot { font-size: 6px; opacity: 0.5; }

/* ─── Mobile portrait / footer (hidden on desktop) ───────── */
.portrait-mobile { display: none; }

.footer-mobile {
  display: none;
  border: 1.5px solid var(--ink);
  margin: 20px 20px 36px;
  background: var(--paper);
}
.fm-top {
  padding: 8px 12px 12px;
  border-bottom: 1px solid var(--ink);
}
.fm-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 8.5px;
  letter-spacing: 0.18em;
  opacity: 0.55;
  margin-bottom: 4px;
}
.fm-name {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1;
}
.fm-subtitle {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  opacity: 0.65;
  margin-top: 4px;
}
.fm-email {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
}
.fm-email-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  opacity: 0.55;
}
.fm-email-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.fm-copy {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  opacity: 0.5;
  padding: 8px 12px;
}

/* ─── Mobile layout ──────────────────────────────────────── */
@media (max-width: 768px) {
  html, body {
    height: auto;
  }
  body {
    overflow: auto;
    background: var(--paper);
  }
  .app {
    position: static;
    display: block;
    background: var(--paper);
  }
  .stage {
    position: static;
    width: 100%;
    height: auto;
    transform: none;
    box-shadow: none;
    overflow: visible;
  }

  .frame-outer,
  .frame-inner,
  .reg,
  .grid-labels,
  .portrait-svg,
  .revtable,
  .titleblock,
  .slug { display: none; }

  .header {
    position: static;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }
  .logo {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0,0,0,0.2);
  }
  .social-box {
    flex: 1;
    border-left: 1px solid rgba(0,0,0,0.2);
    border-top: 1px solid rgba(0,0,0,0.2);
    padding: 12px 14px;
  }
  .social-box:first-child {
    border-left: none;
  }

  .notes {
    position: static;
    width: auto;
    padding: 24px 20px 0;
  }

  .portrait-wrap {
    position: static;
    pointer-events: auto;
    padding: 20px;
  }
  .portrait-mobile {
    display: block;
    width: 100%;
    max-width: 260px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    object-position: center top;
    margin: 0 auto;
    border: 1.5px solid var(--ink);
  }

  .tooling {
    position: static;
    width: auto;
    padding: 20px 20px 24px;
  }

  .footer-mobile { display: block; }
}
