/* Chip Castle Dot Com — redesign
   Design language: technical-manual paper + terminal amber.
   Two families from the IBM Plex superfamily: Mono carries
   display/labels (the "terminal" voice), Sans carries reading text. */

:root {
  --paper: #E7E4DA;      /* punch-card / printer-paper beige */
  --paper-raised: #F1EFE6;
  --ink: #201F1B;        /* body text on paper */
  --ink-soft: #55524A;   /* secondary text on paper */
  --panel: #191D22;      /* deep ink-navy, used for header/footer bands */
  --panel-text: #E9E6DC;
  --panel-text-soft: #9FA6AC;
  --amber: #B9812E;      /* CRT-amber accent */
  --amber-deep: #8F621F;
  --teal: #4F7A6B;        /* secondary accent, terminal-cursor green-teal */
  --rule: #CFC9B8;        /* hairline rule on paper */
  --rule-dark: #33383F;   /* hairline rule on panel */
  --radius: 3px;
  --measure: 40rem;
  --wide-measure: 56rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

h1, h2, h3 {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.5em;
}

a {
  color: var(--amber-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--amber); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

p { margin: 0 0 1em; color: var(--ink); }
p:last-child { margin-bottom: 0; }

.wrap {
  max-width: var(--wide-measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.measure { max-width: var(--measure); }

/* ---------- header ---------- */

.site-header {
  background: var(--panel);
  color: var(--panel-text);
  border-bottom: 1px solid var(--rule-dark);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--panel-text);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.brand:hover { color: var(--panel-text); }

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: block;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--panel-text-soft);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--amber);
}

/* ---------- hero ---------- */

.hero {
  padding: 4.5rem 0 4rem;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.hero-logo {
  flex: none;
  width: 256px;
  height: 256px;
  max-width: 32vw;
  height: auto;
}

.hero-content { flex: 1; min-width: 0; }

@media (max-width: 700px) {
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .hero-logo { max-width: 40vw; }
}

.prompt-line {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.prompt-line .sigil { color: var(--teal); }

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--ink-soft);
  margin-left: 2px;
  vertical-align: -2px;
  animation: blink 1.1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 1; }
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  line-height: 1.15;
  max-width: 18ch;
}

.hero .lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 42ch;
  margin-bottom: 2rem;
}

.btn-row {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  padding: 0.65em 1.1em;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--panel);
  color: var(--panel-text);
}
.btn-primary:hover { background: #232830; color: var(--amber); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover { border-color: var(--amber-deep); color: var(--amber-deep); }

/* ---------- section labels ---------- */

.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--rule);
}

.section-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  color: var(--teal);
  margin-bottom: 1.75rem;
}
.section-label .sigil { color: var(--ink-soft); margin-right: 0.4em; }

/* ---------- history / timeline ---------- */

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.history-item {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.history-date {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding-top: 0.2em;
}

.history-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.history-title a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.history-title a:hover { color: var(--amber-deep); border-color: var(--amber-deep); }

.history-desc {
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 0.6rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
}

.tag {
  color: var(--amber-deep);
}
.tag::before { content: "["; color: var(--ink-soft); }
.tag::after { content: "]"; color: var(--ink-soft); }

@media (max-width: 640px) {
  .history-item { grid-template-columns: 1fr; gap: 0.35rem; }
}

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 16rem;
  gap: 3rem;
}

.about-facts {
  border-left: 1px solid var(--rule);
  padding-left: 1.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.about-facts dt { color: var(--ink); margin-top: 1rem; }
.about-facts dt:first-child { margin-top: 0; }
.about-facts dd { margin: 0.15rem 0 0; }

@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-facts { border-left: none; border-top: 1px solid var(--rule); padding-left: 0; padding-top: 1.5rem; }
}

/* ---------- terminal window chrome (screenshots) ---------- */

.term-window {
  border: 1px solid var(--rule-dark);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}

.term-titlebar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule-dark);
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4b525b;
}

.term-window img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- software page ---------- */

.product-hero {
  padding: 3.5rem 0 2.5rem;
}

.badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 2rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
}

.badge {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.3em 0.85em;
  color: var(--ink);
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.feature-pane {
  background: var(--paper-raised);
  padding: 1.75rem;
}

.feature-pane h3 {
  font-size: 0.95rem;
  color: var(--teal);
  margin-bottom: 1rem;
}
.feature-pane h3 .sigil { color: var(--ink-soft); }

.feature-pane ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.feature-pane li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.feature-pane li:last-child { margin-bottom: 0; }
.feature-pane li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--amber-deep);
}

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

.gumroad-cta {
  display: inline-block;
}
.gumroad-cta img { display: block; height: 44px; width: auto; }

/* directory listing ($ ls software/) */

.dir-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.dir-item {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
}

.dir-item a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.dir-item a:hover { color: var(--amber-deep); border-color: var(--amber-deep); }

.dir-desc {
  color: var(--ink-soft);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.95rem;
}

@media (max-width: 560px) {
  .dir-item { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* individual product sections */

.product-block {
  padding: 3.5rem 0;
  border-top: 1px solid var(--rule);
}

.product-block h2 {
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.product-tagline {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 42ch;
  margin-bottom: 1.25rem;
}

.price-tag { color: var(--teal); }

.plain-shot {
  border: 1px solid var(--rule-dark);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 2rem;
  max-width: 26rem;
}
.plain-shot img { display: block; width: 100%; height: auto; }

.feature-list-single {
  columns: 2;
  column-gap: 2.5rem;
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  max-width: var(--wide-measure);
}
.feature-list-single li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.65rem;
  break-inside: avoid;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.feature-list-single li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--amber-deep);
}
@media (max-width: 640px) {
  .feature-list-single { columns: 1; }
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--panel);
  color: var(--panel-text-soft);
  border-top: 1px solid var(--rule-dark);
  margin-top: 3.5rem;
}

.site-footer .wrap {
  padding: 2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.site-footer a { color: var(--panel-text-soft); }
.site-footer a:hover { color: var(--amber); }

.footer-links {
  display: flex;
  gap: 1.5rem;
}
