:root {
  --paper: #f2ebdc;
  --paper-deep: #e8dfc9;
  --paper-line: #d6c9ab;
  --ink: #1a1714;
  --ink-soft: #3e3830;
  --ink-faint: #6d6458;
  --accent: #9c2b2b;
  --accent-deep: #6e1c1c;
  --ochre: #a67a2e;

  --serif: 'Fraunces', 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.06 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* vertical rule decorations */
body::after {
  content: '';
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1300px, 94vw);
  border-left: 1px solid rgba(111, 96, 69, 0.18);
  border-right: 1px solid rgba(111, 96, 69, 0.18);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
  position: relative;
  z-index: 2;
}

/* ──────── HEADER ──────── */
.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 0 16px;
  border-bottom: 1px solid var(--paper-line);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.masthead .m-left {
  text-align: left;
}

.masthead .m-mid {
  text-align: center;
}

.masthead .m-right {
  text-align: right;
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  align-items: center;
}

.masthead strong {
  color: var(--ink);
  font-weight: 500;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: 1px;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.45;
    transform: scale(0.82);
  }
}

.sub-rule {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 10px 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--paper-line);
}

.sub-rule span {
  white-space: nowrap;
}

.sub-rule .sep {
  color: var(--paper-line);
}

/* ──────── MASTHEAD + SUB-RULE: MOBILE ──────── */
@media (max-width: 720px) {
  .masthead {
    grid-template-columns: 1fr auto;
    gap: 14px;
    font-size: 10px;
  }

  .masthead .m-mid {
    display: none;
  }

  .masthead .m-right {
    gap: 10px;
  }

  .sub-rule {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px 0;
    text-align: center;
  }

  .sub-rule .sep {
    display: none;
  }

  .sub-rule span {
    white-space: normal;
  }
}

/* ──────── HERO ──────── */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  padding: clamp(40px, 8vw, 96px) 0 clamp(30px, 6vw, 72px);
  position: relative;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.eyebrow::before,
.eyebrow::after {
  content: '';
  height: 1px;
  background: var(--accent);
  flex: 0 0 34px;
  opacity: 0.6;
}

.eyebrow::after {
  flex: 1;
  opacity: 0.25;
}

h1.title {
  font-family: var(--serif);
  font-weight: 340;
  font-variation-settings: "SOFT" 30, "opsz" 144;
  font-size: clamp(68px, 16vw, 220px);
  line-height: 0.88;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 18px;
}

h1.title .py {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
  font-variation-settings: "SOFT" 100, "opsz" 144;
}

.lede {
  font-family: var(--serif);
  font-weight: 360;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.35;
  max-width: 34ch;
  color: var(--ink-soft);
  margin-top: 28px;
  font-style: italic;
}

.lede em {
  font-style: normal;
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

/* decorative marginalia */
.margin-note {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-20%);
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  opacity: 0.7;
}

@media (max-width: 900px) {
  .margin-note {
    display: none;
  }
}

/* ──────── CONTENT GRID ──────── */
.content {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 720px;
  gap: clamp(30px, 5vw, 64px);
  padding-top: 40px;
  border-top: 1px solid var(--paper-line);
  align-items: start;
}

.section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--paper-line);
  display: flex;
  justify-content: space-between;
}

.section-label .num {
  color: var(--accent);
}

h2 {
  font-family: var(--serif);
  font-weight: 380;
  font-variation-settings: "SOFT" 50, "opsz" 80;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin-bottom: 18px;
  color: var(--ink);
}

.prose p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 14px;
  max-width: 44ch;
}

.prose p+p {
  text-indent: 1.4em;
}

/* ──────── CODE BLOCK ──────── */
.code {
  background: #1a1714;
  color: #e8dfc9;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 0;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.08),
    0 20px 40px -20px rgba(40, 30, 15, 0.35);
  position: relative;
}

.code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #221e1a;
  border-bottom: 1px solid #2d2822;
  font-size: 11px;
  color: #a8a096;
  letter-spacing: 0.08em;
}

.code-head .light {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4a3f35;
}

.code-head .light.on {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.code-head .filename {
  margin-left: auto;
  font-style: italic;
  opacity: 0.7;
}

.code-body {
  padding: 20px 22px 22px;
}

.code-body pre {
  font-family: inherit;
  white-space: pre-wrap;
}

.k {
  color: #d68c8c;
}

/* keyword */
.s {
  color: #c7b477;
}

/* string */
.c {
  color: #7a7066;
  font-style: italic;
}

/* comment */
.f {
  color: #e8dfc9;
}

/* function / identifier */
.n {
  color: #b59a6a;
}

/* number */
.cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1.1s steps(2) infinite;
  margin-left: 2px;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ──────── PACKAGES LIST ──────── */
.packages {
  padding: clamp(40px, 6vw, 72px) 0;
  border-top: 1px solid var(--paper-line);
  margin-top: clamp(40px, 6vw, 72px);
}

.pkg-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 30px;
}

.pkg-head h2 {
  margin: 0;
  max-width: 18ch;
}

.pkg-head .meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.pkg-list {
  list-style: none;
}

.pkg-list li {
  display: grid;
  grid-template-columns: 48px 1fr 2fr auto;
  gap: 18px;
  align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--paper-line);
  transition: background 240ms ease, padding 240ms ease;
}

.pkg-list li:last-child {
  border-bottom: 1px solid var(--paper-line);
}

.pkg-list li:hover {
  background: linear-gradient(to right, rgba(156, 43, 43, 0.04), transparent);
  padding-left: 8px;
}

.pkg-list li:hover .pkg-name {
  color: var(--accent);
}

.pkg-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}

.pkg-name {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  transition: color 240ms ease;
}

.pkg-desc {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.pkg-status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--paper-line);
  color: var(--ink-faint);
  white-space: nowrap;
  border-radius: 1px;
}

.pkg-status.drafting {
  border-color: var(--ochre);
  color: var(--ochre);
}

.pkg-status.alpha {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 720px) {
  .pkg-list li {
    grid-template-columns: 32px 1fr auto;
  }

  .pkg-desc {
    grid-column: 1 / -1;
    padding-left: 50px;
  }
}

/* ──────── CTA ──────── */
.cta {
  padding: clamp(50px, 7vw, 96px) 0;
  border-top: 1px solid var(--paper-line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: end;
}

@media (max-width: 800px) {
  .cta {
    grid-template-columns: 1fr;
  }
}

.cta h2 {
  font-size: clamp(32px, 4.5vw, 56px);
  max-width: 14ch;
  margin: 0;
}

.cta h2 em {
  font-style: italic;
  color: var(--accent);
}

.signup {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.signup-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.signup-row {
  display: flex;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 10px;
  gap: 12px;
  transition: border-color 200ms ease;
}

.signup-row:focus-within {
  border-color: var(--accent);
}

.signup input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
  padding: 4px 0;
}

.signup input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}

.signup button {
  background: var(--ink);
  color: var(--paper);
  border: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 10px 22px;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease;
}

.signup button:hover {
  background: var(--accent);
  transform: translateX(2px);
}

.signup-note {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

/* ──────── FOOTER ──────── */
footer {
  border-top: 2px solid var(--ink);
  padding: 24px 0 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

footer .seal {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-size: 20px;
  position: relative;
  transition: transform 400ms ease;
}

footer .seal::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px dashed var(--accent);
  opacity: 0.5;
  animation: rotate 30s linear infinite;
}

footer .seal:hover {
  transform: rotate(15deg);
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

footer .links {
  display: flex;
  gap: 20px;
  justify-content: flex-end;
}

footer a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 200ms ease;
  position: relative;
}

footer a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

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

footer a:hover::after {
  transform: scaleX(1);
}

@media (max-width: 720px) {
  footer {
    grid-template-columns: 1fr;
    text-align: center;
  }

  footer .seal {
    margin: 0 auto;
  }

  footer .links {
    justify-content: center;
  }
}

/* ──────── LOAD ANIMATION ──────── */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 900ms cubic-bezier(.2, .7, .2, 1) forwards;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.d1 {
  animation-delay: 100ms;
}

.d2 {
  animation-delay: 240ms;
}

.d3 {
  animation-delay: 380ms;
}

.d4 {
  animation-delay: 520ms;
}

.d5 {
  animation-delay: 660ms;
}

.d6 {
  animation-delay: 800ms;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}
