:root {
  --ink: #18221d;
  --muted: #62706a;
  --paper: #f8f6ef;
  --panel: #ffffff;
  --line: #d9d1c2;
  --moss: #315f51;
  --clay: #af5f3f;
  --gold: #b18c3f;
  --blue: #506f86;
  --danger: #9d3e3e;
  --shadow: 0 16px 36px rgba(20, 24, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.app-header,
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 246, 239, 0.94);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
}

.app-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.brand,
nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  background: var(--moss);
}

nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
}

nav a,
.app-footer a {
  text-decoration: none;
}

nav a:hover,
.app-footer a:hover {
  color: var(--ink);
}

.marketing-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(78vh, 720px);
  padding: clamp(70px, 9vw, 124px) clamp(20px, 5vw, 70px);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(14, 22, 18, 0.88), rgba(28, 38, 34, 0.48), rgba(28, 38, 34, 0.12)),
    url("img/share-card.png") center / cover no-repeat;
}

.marketing-copy {
  max-width: 760px;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.3);
}

.marketing-hero h1 {
  margin-bottom: 14px;
  font-size: clamp(4rem, 15vw, 10rem);
  line-height: 0.78;
}

.marketing-hero .eyebrow {
  color: #f0c878;
}

.marketing-hero .lede {
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.12rem, 2vw, 1.45rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 800;
}

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

.button.secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.intro-band {
  padding: 26px clamp(20px, 5vw, 70px);
  color: #fff;
  background: var(--moss);
}

.intro-band p {
  max-width: 1040px;
  margin: 0 auto;
  font-size: clamp(1.02rem, 1.5vw, 1.24rem);
  line-height: 1.55;
}

.marketing-section .section-heading {
  max-width: 920px;
  margin-bottom: 28px;
}

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

.feature-card {
  min-height: 250px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.feature-card p {
  color: var(--muted);
  line-height: 1.58;
}

.kicker {
  display: inline-block;
  margin-bottom: 36px;
  color: var(--gold);
  font-weight: 850;
}

.proof-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: clamp(24px, 5vw, 66px);
  align-items: end;
  padding: clamp(56px, 8vw, 92px) clamp(20px, 5vw, 70px);
  background: #e8ece7;
}

.proof-section h2 {
  max-width: 780px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.layer-actions {
  display: grid;
  gap: 10px;
}

.layer-actions a {
  min-height: 46px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdfa;
  text-decoration: none;
  font-weight: 800;
}

.page-shell {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
  padding: 44px 0 70px;
}

.page-shell.narrow {
  width: min(780px, calc(100% - 36px));
}

.page-heading,
.detail-header {
  margin-bottom: 28px;
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--clay);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.35rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.28rem;
  line-height: 1.15;
}

.lede {
  max-width: 840px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.58;
}

.stat-grid,
.work-grid,
.detail-grid {
  display: grid;
  gap: 16px;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 18px;
}

.work-grid,
.detail-grid {
  grid-template-columns: minmax(340px, 0.88fr) minmax(420px, 1.12fr);
}

.stat,
.panel,
.api-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stat {
  min-height: 112px;
  padding: 20px;
}

.stat strong {
  display: block;
  margin-bottom: 10px;
  color: var(--moss);
  font-size: 2.1rem;
  line-height: 1;
}

.stat span,
.muted,
.panel-heading p,
.record-row p,
.empty,
.field small {
  color: var(--muted);
}

.panel {
  padding: 22px;
  box-shadow: 0 1px 0 rgba(20, 24, 22, 0.04);
}

.panel + .panel,
.api-strip {
  margin-top: 16px;
}

.panel-heading {
  margin-bottom: 18px;
}

.record-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.94rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfc7b8;
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fffdfa;
  font: inherit;
}

textarea {
  resize: vertical;
}

input[type="checkbox"] {
  width: auto;
  justify-self: start;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: var(--moss);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #244a3e;
}

.record-stack,
.event-stack {
  display: grid;
  gap: 10px;
}

.record-row,
.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.event-row {
  display: block;
}

.event-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.record-title {
  font-weight: 850;
  text-decoration: none;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 0.82rem;
  font-weight: 800;
}

.api-strip {
  padding: 24px;
  background: #e8ece7;
}

.share-panel {
  margin-top: 16px;
}

.share-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.share-card {
  min-height: 250px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.share-card img {
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
}

.share-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.share-card p {
  color: var(--muted);
  line-height: 1.55;
}

.share-card code {
  display: block;
  overflow-wrap: anywhere;
  padding: 9px 10px;
}

.review-queue,
.writer-outbox {
  margin-top: 16px;
}

.compact-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.compact-form .field:last-of-type {
  grid-column: 1 / -1;
}

.certificate-shell {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 44px 0 70px;
}

.certificate {
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: var(--shadow);
}

.certificate-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.certificate-top strong {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--moss);
  white-space: nowrap;
}

.certificate-summary {
  margin: 24px 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.62;
}

.certificate-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.28fr) minmax(0, 1fr);
  gap: 12px 18px;
  margin: 0;
}

.certificate-grid dt {
  color: var(--muted);
  font-weight: 850;
}

.certificate-grid dd {
  margin: 0;
  min-width: 0;
}

.review-note {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.certificate-legal {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

code,
pre {
  border-radius: 6px;
  background: #efe9dc;
  color: #26312b;
}

code {
  padding: 2px 5px;
  word-break: break-all;
}

pre {
  overflow-x: auto;
  padding: 16px;
  white-space: pre-wrap;
}

.kv {
  display: grid;
  grid-template-columns: minmax(130px, 0.36fr) minmax(0, 1fr);
  gap: 12px 16px;
  margin: 0;
}

.kv dt {
  color: var(--muted);
  font-weight: 800;
}

.kv dd {
  margin: 0;
  min-width: 0;
}

.form-errors,
.error {
  color: var(--danger);
}

@media (max-width: 860px) {
  .app-header,
  .app-footer,
  .detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .stat-grid,
  .work-grid,
  .detail-grid,
  .feature-grid,
  .proof-section,
  .share-card-grid,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .compact-form .field:last-of-type {
    grid-column: auto;
  }

  .certificate-top {
    flex-direction: column;
  }

  .record-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .marketing-hero {
    min-height: 640px;
  }
}

@media (max-width: 560px) {
  .button {
    width: 100%;
  }
}

@media print {
  .app-header,
  .app-footer {
    display: none;
  }

  body {
    background: #fff;
  }

  .certificate-shell {
    width: 100%;
    padding: 0;
  }

  .certificate {
    box-shadow: none;
  }
}
