/* ----------------------------------------------------------
   ROOT / GLOBAL
----------------------------------------------------------- */

:root {
  --scratch-rail-top: 120px;
  --rail-width: 260px;          /* width of the scratch pad on large screens */
  --page-max-width: 1100px;
  --page-padding-x: 1.25rem;
  --bg-paper: #d6d1c7;
  --card-bg: #ebe4d6;
  --card-border: rgba(0, 0, 0, 0.12);
  --eggplant: #5e4a66;
  --bok-choy: #a8c77d;
}

/* Box sizing everywhere */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   BASE ELEMENTS
----------------------------------------------------------- */

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  color: #231f20;
  background-color: var(--bg-paper);
  background-image:
    linear-gradient(135deg, rgba(255,255,255,0.08) 0, rgba(255,255,255,0.08) 1px, transparent 1px, transparent 8px),
    linear-gradient(225deg, rgba(255,255,255,0.08) 0, rgba(255,255,255,0.08) 1px, transparent 1px, transparent 8px);
  background-size: 8px 8px;

  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden; /* safety for tiny rounding issues */
}

a {
  color: var(--eggplant);
  text-decoration: none;
}
a:hover,
a:focus {
  text-decoration: underline;
}

/* Utility container */
.container {
  width: 100%;
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding-x);
}

/* ----------------------------------------------------------
   HEADER / NAV
----------------------------------------------------------- */

.site-header {
  background: #171717;
  color: #f5f5f5;
  border-bottom: 2px solid var(--eggplant);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.6rem var(--page-padding-x);
  max-width: var(--page-max-width);
  margin: 0 auto;
}

.site-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.site-title {
  font-family: "Georgia", serif;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
}

.site-subtitle {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  opacity: 0.8;
}

/* Nav links */
.top-nav {
  margin-left: auto;
  font-size: 0.9rem;
  white-space: nowrap;
}

.top-nav a {
  color: #f5f5f5;
  font-weight: 500;
}
.top-nav a + a::before {
  content: " · ";
  color: #aaaaaa;
  padding: 0 0.35rem;
}

.top-nav a.active {
  color: var(--bok-choy);
}
.top-nav a:hover,
.top-nav a:focus {
  color: var(--bok-choy);
  text-decoration: none;
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid #444;
  border-radius: 4px;
  width: 30px;
  height: 24px;
  padding: 3px 4px;
  flex-direction: column;
  justify-content: space-between;
}
.menu-toggle .bar {
  width: 100%;
  height: 2px;
  background: #f5f5f5;
  display: block;
}

/* Header meta strip */
.header-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d1d1d1;
  padding: 0 1.25rem 0.5rem 1.25rem;
  max-width: var(--page-max-width);
  margin: 0 auto;
}

.header-status {
  font-family: "SF Mono", "Consolas", "Courier New", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: none;
  white-space: nowrap;
  opacity: 0.9;
}

.header-status-prefix {
  margin-right: 0.35rem;
  color: var(--bok-choy);
}

.header-status-line {
  color: #e0e0e0;
}

/* ----------------------------------------------------------
   SCRATCH RAIL (RIGHT PAD) – DESKTOP ONLY
----------------------------------------------------------- */

.scratch-rail {
  display: none; /* mobile-first: hidden everywhere by default */
}

/* Main panel – closer to main cards, just a bit denser */
.scratch-panel {
  position: relative;
  width: 100%;
  max-height: calc(100% - 1.25rem);
  margin-top: 0;

  background:
    linear-gradient(135deg, #f0e8da 0%, #e2d7c6 55%, #d6cbb8 100%);
  border-radius: 18px 0 0 18px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-left: 3px solid var(--bok-choy);

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 10px 24px rgba(0, 0, 0, 0.18);

  padding: 0.85rem 1.1rem 1.1rem;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;

  color: #352c23;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(168,199,125,0.7) rgba(215,208,195,0.5);
}

/* scrollbars (WebKit) */
.scratch-panel::-webkit-scrollbar {
  width: 6px;
}
.scratch-panel::-webkit-scrollbar-track {
  background: rgba(215,208,195,0.6);
}
.scratch-panel::-webkit-scrollbar-thumb {
  background: rgba(168,199,125,0.85);
  border-radius: 999px;
}

/* subtle brackets to mirror cards */
.scratch-panel::before,
.scratch-panel::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 2px;
}
.scratch-panel::before {
  top: 6px;
  right: 7px;
}
.scratch-panel::after {
  bottom: 6px;
  right: 7px;
}

/* header row */
.scratch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

/* chip label at top */
.scratch-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.6rem;
  padding: 0.22rem 0.7rem 0.18rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.18);
  background: #d4ccb8;
  color: #514338;
  box-shadow: 0 1px 0 rgba(255,255,255,0.85) inset;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* softer LED attached to the label */
.scratch-label::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: radial-gradient(circle, #dff8c6 0, #a5cf7c 55%, #57723e 100%);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.3),
    0 0 5px rgba(150,201,110,0.7);
}

/* body */
.scratch-body {
  font-family: "Georgia", serif;
  line-height: 1.45;
  color: #3c3228;
  font-size: 0.86rem;
}

/* "now tinkering" line – terminal-ish link */
.scratch-subtitle {
  margin: 0 0 0.45rem 0;
  font-family: "SF Mono", "Consolas", "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7b6f8a;
}

.scratch-subtitle a {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: none;
  color: #35512d;
  text-decoration: none;
  border-bottom: 1px dotted rgba(53,81,45,0.6);
}
.scratch-subtitle a:hover,
.scratch-subtitle a:focus {
  color: #23351f;
  border-bottom-style: solid;
}

/* status list box */
.scratch-status-list {
  list-style: none;
  margin: 0.3rem 0 0.45rem 0;
  padding: 0.45rem 0.65rem 0.4rem;
  border-radius: 10px;
  background: #f7f3ea;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.8) inset,
    0 0 0 1px rgba(0,0,0,0.05);
}

.scratch-status-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.5rem;
  margin-bottom: 0.2rem;
  font-size: 0.76rem;
  align-items: baseline;
}

/* keys: quiet labels */
.scratch-status-list .scratch-key {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.58rem;
  color: #7b6f8a;
}

/* values: pop a bit more */
.scratch-status-list .scratch-value {
  font-family: "SF Mono", "Consolas", "Courier New", monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2e4a34;      /* default green-ish */
  max-width: 100%;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* optional emphasis via extra classes */
.scratch-status-list li.is-warn .scratch-value {
  color: #b57a2b;      /* amber */
}
.scratch-status-list li.is-bad .scratch-value {
  color: #b3403d;      /* muted red */
}

/* free-form single line (if you ever need it) */
.scratch-line {
  margin: 0.15rem 0 0.35rem 0;
  font-family: "SF Mono", "Consolas", "Courier New", monospace;
  font-size: 0.78rem;
  color: #5a4c3e;
}

/* generic key/value outside the box */
.scratch-key {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.58rem;
  color: var(--eggplant);
  margin-right: 0.25rem;
}

.scratch-value {
  font-weight: 500;
  font-size: 0.72rem;
}

/* “task queue” link – point to /data/tasks.txt or a tasks page */
.scratch-tasks-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  font-family: "SF Mono", "Consolas", "Courier New", monospace;
  font-size: 0.78rem;
  color: #35512d;
  text-decoration: none;
  border-bottom: 1px dotted rgba(53,81,45,0.6);
}
.scratch-tasks-link::before {
  content: "↳";
  font-size: 0.78rem;
  opacity: 0.9;
}
.scratch-tasks-link:hover,
.scratch-tasks-link:focus {
  color: #23351f;
  border-bottom-style: solid;
}

/* lower section – little note / console log */
.scratch-footnote {
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(153,139,115,0.9);

  font-family: "Georgia", serif;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #6b5b47;
  font-style: italic;
}
.scratch-footnote a {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
}
.scratch-footnote a:hover,
.scratch-footnote a:focus {
  color: #4d4033;
}



/* ----------------------------------------------------------
   PAGE LAYOUT
----------------------------------------------------------- */

/* Body: no layout padding, just acts as shell */
body.page {
  margin: 0;
  padding: 0;
}

/* Main content area: owns the vertical spacing under the header */
main.page {
  flex: 1 0 auto;
  padding: 1.6rem 0 3rem 0;  /* 1.6rem gap from header to first card */
}



.page-inner {
  width: 100%;
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding-x) 2rem;
}

/* content grid: one column by default */
.page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: flex-start;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ----------------------------------------------------------
   CARDS / PANELS
----------------------------------------------------------- */

.section {
  position: relative;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
  position: relative;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  width: 100%;
}

/* hover */
.card:hover {
  border-color: rgba(94, 74, 102, 0.25);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1px rgba(168, 199, 125, 0.25);
}

/* corner brackets */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 2px;
}
.card::before {
  top: 6px;
  left: 8px;
}
.card::after {
  bottom: 6px;
  right: 8px;
}

/* top trim groups */
.hero-card,
.console-card {
  border-top: 3px solid var(--eggplant);
}
.updates-card,
.bio-card,
.quick-links-card,
.ship-card {
  border-top: 3px solid var(--bok-choy);
}

/* label chip */
.card-label {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--eggplant);
  background: #d4ccb8;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  margin-bottom: 0.55rem;
}

/* hero / bio headings */
.hero-card h1 {
  margin: 0 0 0.5rem 0;
  font-family: "Georgia", serif;
  font-size: 1.6rem;
  color: #3a3042;
}

.bio-card h2 {
  margin-top: 0.2rem;
  font-family: "Georgia", serif;
  font-size: 1.2rem;
}

/* prompt block styling */
.prompt-block {
  background: #f7f3ea;
  border: 1px dashed rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #1f1a14;
  white-space: pre-wrap;
  overflow: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-height: 280px;
}

@media (max-width: 720px) {
  .prompt-block {
    font-size: 0.9rem;
    padding: 0.85rem 0.95rem;
  }
}

/* ----------------------------------------------------------
   LATEST UPDATES
----------------------------------------------------------- */

.update-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.update-list li {
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}

.update-tag {
  display: inline-block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #c8d9aa;
  color: #28301a;
  margin-right: 0.4rem;
  text-decoration: none;
}

a.update-tag {
  color: #28301a;
}
a.update-tag:hover,
a.update-tag:focus {
  filter: brightness(0.96);
}

/* one-line truncation (desktop/tablet) */
.update-text {
  display: inline-block;
  max-width: calc(100% - 8rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.update-empty {
  font-size: 0.85rem;
  color: #766f63;
  opacity: 0.9;
}

/* ----------------------------------------------------------
   SIDE COLUMN: CONSOLE / LINKS / SHIP
----------------------------------------------------------- */

.console-card {
  background: #e0dacb;
}

.console-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: "SF Mono", "Consolas", "Courier New", monospace;
  font-size: 0.8rem;
}

.console-list li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.console-key {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #4a4330;
}

.console-value {
  padding-left: 0.75rem;
  color: #222;
}
.console-ok {
  color: #2f6b33;
}
.console-warn {
  color: #8b3f2e;
}

.ship-card {
  background: #e2dbcd;
}

.ship-screen {
  font-family: "SF Mono", "Consolas", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.4;
}
.ship-line + .ship-line {
  margin-top: 0.15rem;
}

.quick-links {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}
.quick-links li {
  margin-bottom: 0.4rem;
}

.quick-links a {
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.4);
}
.quick-links a:hover {
  border-bottom-style: solid;
}

/* ----------------------------------------------------------
   FOOTER
----------------------------------------------------------- */

.site-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  background: #cfc9bd;
  padding: 0.75rem 0;
  font-size: 0.8rem;
  margin-top: auto;
  position: relative;
  z-index: 1000;
}

.footer-inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding-x);
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
  align-items: center;
  color: #474139;
}

/* ----------------------------------------------------------
   BREAKPOINTS
----------------------------------------------------------- */

/* Tablet: two-column layout, still no scratch rail */
@media (min-width: 900px) {
  .page-grid {
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.2fr);
    gap: 1.5rem;
  }
}

/* Desktop: enable scratch rail and offset content */
@media (min-width: 1200px) {
  .page-inner {
    max-width: 1400px;
    padding-right: calc(var(--page-padding-x) + var(--rail-width));
  }
  .page-grid {
    grid-template-columns: minmax(0, 3.4fr) minmax(0, 1.5fr);
    gap: 1.5rem;
  }
  .footer-inner {
    max-width: 1400px;
    padding-right: calc(var(--page-padding-x) + var(--rail-width));
  }

  .scratch-rail {
    display: flex;
    position: fixed;
    top: var(--scratch-rail-top);
    right: 0;
    bottom: 60px;
    width: var(--rail-width);
    align-items: stretch;
    padding-right: 0;
    z-index: 900;
  }
}

/* Small screens: mobile nav + stacked header/meta */
@media (max-width: 768px) {
  .header-inner {
    padding: 0.55rem 1rem;
    gap: 1rem;
  }

  .site-title {
    font-size: 1.25rem;
  }

  .top-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #171717;
    padding: 0.5rem 1.1rem 0.8rem;
    border-bottom: 1px solid var(--eggplant);
    white-space: normal;
  }

  .top-nav a {
    display: inline-block;
    margin: 0.2rem 0.3rem 0.2rem 0;
  }

  .top-nav a + a::before {
    content: "";
  }

  .menu-toggle {
    display: flex;
  }

  .site-header.nav-open .top-nav {
    display: block;
  }

  .header-meta {
    padding: 0.25rem 1rem 0.6rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .header-status {
    font-size: 0.65rem;
    white-space: normal;
  }

  .page-inner {
    padding: 0 0.85rem 2rem;
  }

  .card {
    padding: 1rem 1.05rem;
  }

  .card-label {
    font-size: 0.6rem;
  }

  .hero-card h1 {
    font-size: 1.35rem;
  }

  .bio-card h2 {
    font-size: 1.05rem;
  }

  .footer-inner {
    padding: 0 1rem;
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }
}

/* ----------------------------------------------------------
   MOBILE CARD LAYOUT FIX
   Make cards truly centered with equal side margins
----------------------------------------------------------- */

@media (max-width: 820px) {
  /* Container: full width, equal padding */
  .page-inner {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
  }

  /* Single-column grid, no weird side offsets */
  .page-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    margin: 0;
  }

  /* Cards: don’t extend wider than the container, center them */
  .card {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem 1.05rem;
    box-sizing: border-box;
  }

  /* Let update text wrap instead of fake “cut off” look */
  .update-text {
    display: inline;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}
