:root {
  --cream:     #eee8d4;
  --paper:     #e8e0c8;
  --warm:      #f2ece0;
  --fog:       #c8c0a8;
  --stone:     #908070;
  --soil:      #261e0e;
  --moss:      #3e5030;
  --fern:      #527840;
  --sage:      #6e9050;
  --meadow:    #9ab878;

  --violet:    #7a5a9e;
  --blue:      #486ea8;
  --pink:      #b05e90;
  --gold:      #b09030;
  --teal:      #388070;
  --lavender:  #8870a8;
  --rust:      #985030;
  --mint:      #409870;

  --hb:        rgba(82,120,64,0.45);
  --scan:      rgba(60,80,40,0.035);

  --td: #201808;
  --tm: #504030;
  --tl: #807060;

  --cut: 22px;
  --rad: 10px;
}

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

body {
  font-family: 'DM Mono', monospace;
  background: var(--cream);
  color: var(--td);
  min-height: 100vh;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, var(--scan) 2px, var(--scan) 3px),
    radial-gradient(ellipse 65% 45% at 8%  8%,  rgba(122,90,158,0.08) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 92% 92%, rgba(72,110,168,0.08) 0%, transparent 55%),
    radial-gradient(ellipse 45% 35% at 55% 48%, rgba(56,128,112,0.05) 0%, transparent 50%);
}

body::after {
  content: '';
  position: fixed; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 999;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.6rem 6rem;
  position: relative; z-index: 1;
}

/* ═══════════════════════════════════
   CHAMFERED BOX — border follows cut
   Uses inline SVG border technique:
   we use outline + a masking pseudo
   OR we use a wrapper+inner approach.

   Approach: .chamfer-wrap holds a 2px
   border using an SVG polygon as
   background on a wrapper div, and the
   inner content sits on top.
═══════════════════════════════════ */

/*
  We use the "double element" trick:
  - outer element: clipped, draws the border colour as background
  - inner element: clipped slightly smaller, draws the card bg
  This gives a clean border all the way round the diagonal.
*/

.cham {
  position: relative;
  /* background = border colour */
  background: var(--border-c, var(--hb));
  border-radius: var(--rad) var(--rad) var(--rad) var(--rad);
  clip-path: polygon(
    0% var(--rad),
    var(--rad) 0%,
    calc(100% - var(--rad)) 0%,
    100% var(--rad),
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    var(--rad) 100%,
    0% calc(100% - var(--rad))
  );
  padding: 2px; /* this 2px IS the border */
  transition: background 0.2s ease;
}

.cham-inner {
  background: var(--bg, var(--paper));
  border-radius: calc(var(--rad) - 1px) calc(var(--rad) - 1px) calc(var(--rad) - 1px) calc(var(--rad) - 1px);
  clip-path: polygon(
    0% var(--rad),
    var(--rad) 0%,
    calc(100% - var(--rad)) 0%,
    100% var(--rad),
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    var(--rad) 100%,
    0% calc(100% - var(--rad))
  );
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ── PILL: fully rounded, no cut — for tags and small labels ── */
.pill {
  display: inline-flex;
  align-items: center;
  background: var(--border-c, var(--hb));
  border-radius: 20px;
  padding: 2px;
}

.pill-inner {
  background: var(--bg, var(--paper));
  border-radius: 18px;
  padding: 0.18rem 0.65rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.44rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c, var(--fern));
  white-space: nowrap;
  line-height: 1.6;
}

/* ═══════════════════════════════════
   SYSTEM BAR
═══════════════════════════════════ */
.sysbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  animation: fadeUp 0.4s ease both;
}

.sysbar-line {
  flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, var(--fern) 30%, var(--fern) 70%, transparent);
  opacity: 0.45;
}

.sysbar-chip {
  --border-c: var(--hb);
  --bg: var(--warm);
}

.sysbar-chip .cham-inner {
  font-family: 'Orbitron', sans-serif !important;
  font-size: 0.48rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fern);
  padding: 0.25rem 1rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* ═══════════════════════════════════
   HEADER
═══════════════════════════════════ */
header {
  margin-bottom: 1rem;
  animation: fadeUp 0.5s ease both 0.05s;
}

.header-cham {
  --border-c: var(--hb);
  --bg: var(--paper);
}

.header-content {
  padding: 1.4rem 1.8rem 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.5rem, 3.8vw, 2.5rem);
  font-weight: 700;
  color: var(--soil);
  letter-spacing: 0.1em;
  line-height: 1;
}

h1 .acc { color: var(--fern); }

.tagline {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--tl);
  margin-top: 0.6rem;
  line-height: 1.6;
}

.readouts { display: flex; gap: 0.9rem; }

.readout {
  width: 76px; height: 76px;
  border-radius: 50%;
  border: 2px solid var(--hb);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  position: relative;
}

.readout::before {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(82,120,64,0.22);
  animation: spin 20s linear infinite;
}

.readout::after {
  content: '';
  position: absolute; inset: -11px;
  border-radius: 50%;
  border: 1px dashed rgba(82,120,64,0.10);
  animation: spin 38s linear infinite reverse;
}

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

.r-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.15rem; font-weight: 700;
  color: var(--moss); line-height: 1;
}

.r-lbl {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.36rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--stone);
  margin-top: 0.22rem;
}

/* leaf watermark */
.leaf-bg {
  position: absolute; right: 1.8rem; top: 50%;
  transform: translateY(-50%);
  opacity: 0.08; pointer-events: none;
}

.statusbar {
  display: flex; align-items: center;
  gap: 1.4rem; padding: 0.55rem 1.8rem;
  margin-top: 1.2rem;
  border-top: 1px dashed rgba(82,120,64,0.25);
  flex-wrap: wrap;
}

.s-item {
  display: flex; align-items: center; gap: 0.4rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.44rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--stone);
}

.s-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--sage);
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

.s-right { margin-left: auto; }

.data-stream {
  font-size: 0.42rem; color: rgba(82,120,64,0.3);
  letter-spacing: 0.08em;
}

/* ═══════════════════════════════════
   SECTION LABEL
═══════════════════════════════════ */
.sec-row {
  display: flex; align-items: center;
  gap: 0.7rem; margin: 1.2rem 0 0.8rem;
}

.sec-tag {
  --border-c: var(--hb);
  --bg: var(--warm);
  --c: var(--fern);
}

.sec-rule {
  flex: 1; height: 1px;
  background: linear-gradient(to right, var(--hb), transparent);
}

.sec-count {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.44rem; letter-spacing: 0.12em;
  color: var(--stone);
}

/* ═══════════════════════════════════
   TOOL GRID
═══════════════════════════════════ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.9rem;
}

/* ═══════════════════════════════════
   TOOL CARD
═══════════════════════════════════ */
.card-wrap {
  --border-c: var(--hb);
  --bg: var(--paper);
  display: block;
  text-decoration: none;
  color: inherit;
  animation: fadeUp 0.5s ease both;
  transition: transform 0.2s ease;
}

.card-wrap:hover {
  transform: translateY(-4px);
  --border-c: var(--c, var(--sage));
}

.card-wrap:hover .cham {
  box-shadow: 0 8px 26px rgba(0,0,0,0.10);
}

/* top accent bar */
.card-bar {
  height: 2.5px;
  background: var(--c, var(--sage));
  opacity: 0.65;
  transition: opacity 0.2s;
  margin: 0;
}

.card-wrap:hover .card-bar { opacity: 1; }

/* TL bracket */
.card-tl {
  position: absolute;
  top: 7px; left: 7px;
  width: 11px; height: 11px;
  border-top: 1.5px solid var(--c, var(--sage));
  border-left: 1.5px solid var(--c, var(--sage));
  opacity: 0.45;
  transition: opacity 0.2s, width 0.2s, height 0.2s;
  pointer-events: none;
  border-radius: 2px 0 0 0;
}

.card-wrap:hover .card-tl {
  opacity: 1; width: 17px; height: 17px;
}

/* accent line on the diagonal cut — visible inside cham-inner */
.card-cut-line {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 28px; height: 1.5px;
  background: var(--c, var(--sage));
  transform: rotate(-45deg);
  transform-origin: right bottom;
  opacity: 0.5;
  transition: opacity 0.2s;
  pointer-events: none;
}

.card-wrap:hover .card-cut-line { opacity: 1; }

.card-body {
  padding: 0.9rem 1.1rem 0.8rem;
  display: flex; flex-direction: column;
  gap: 0.4rem; flex: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.48rem; letter-spacing: 0.18em;
  color: var(--stone);
}

.card-glyph {
  font-size: 1.3rem; line-height: 1;
  filter: saturate(0.7);
}

.card-name {
  font-family: 'Lora', serif;
  font-size: 0.98rem; font-weight: 600;
  color: var(--soil); line-height: 1.25;
}

.card-fi {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem; color: var(--tl);
  letter-spacing: 0.07em;
}

.card-desc {
  font-family: 'Lora', serif;
  font-style: italic; font-size: 0.76rem;
  color: var(--tm); line-height: 1.55;
  margin-top: auto; padding-top: 0.35rem;
}

.card-foot {
  border-top: 1px solid rgba(82,120,64,0.15);
  padding: 0.38rem 1.1rem;
  display: flex; align-items: center;
  justify-content: space-between;
}

/* card-tag now uses .pill — no cut corner, just rounded */
.card-tag {
  opacity: 0.72;
  transition: opacity 0.2s;
}

.card-wrap:hover .card-tag { opacity: 1; }

.card-arrow {
  font-size: 0.65rem;
  color: var(--c, var(--sage));
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.2s, transform 0.2s;
}

.card-wrap:hover .card-arrow {
  opacity: 0.7; transform: translateX(0);
}

/* colours + stagger */
.card-wrap:nth-child(1) { --c:var(--fern);     animation-delay:0.06s; }
.card-wrap:nth-child(2) { --c:var(--violet);   animation-delay:0.12s; }
.card-wrap:nth-child(3) { --c:var(--blue);     animation-delay:0.18s; }
.card-wrap:nth-child(4) { --c:var(--gold);     animation-delay:0.24s; }
.card-wrap:nth-child(5) { --c:var(--pink);     animation-delay:0.30s; }
.card-wrap:nth-child(6) { --c:var(--teal);     animation-delay:0.36s; }
.card-wrap:nth-child(7) { --c:var(--rust);     animation-delay:0.42s; }
.card-wrap:nth-child(8) { --c:var(--lavender); animation-delay:0.48s; }
.card-wrap:nth-child(9) { --c:var(--mint);     animation-delay:0.54s; }

/* ═══════════════════════════════════
   FUTURE SECTION
═══════════════════════════════════ */
.future-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.9rem;
  margin-bottom: 2.5rem;
}

.future-card {
  background: var(--warm);
  border: 1.5px dashed var(--fog);
  border-radius: var(--rad) var(--rad) var(--rad) var(--rad);
  clip-path: polygon(
    0% var(--rad),
    var(--rad) 0%,
    calc(100% - var(--rad)) 0%,
    100% var(--rad),
    100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%,
    var(--rad) 100%,
    0% calc(100% - var(--rad))
  );
  padding: 0.9rem 1.1rem;
  display: flex; align-items: center;
  gap: 0.85rem; min-height: 68px;
}

.future-pip {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px dashed var(--stone); flex-shrink: 0;
  animation: pulse 3.5s ease-in-out infinite;
}

.future-card:nth-child(1) .future-pip { animation-delay: 0s; }
.future-card:nth-child(2) .future-pip { animation-delay: 1.15s; }
.future-card:nth-child(3) .future-pip { animation-delay: 2.3s; }

@keyframes pulse {
  0%,100% { opacity:0.2; transform:scale(1); }
  50%      { opacity:0.9; transform:scale(1.25); }
}

.future-text {
  font-family: 'Lora', serif; font-style: italic;
  font-size: 0.74rem; color: var(--stone); line-height: 1.5;
}

.future-text strong {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.42rem; font-style: normal; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fog); display: block; margin-bottom: 0.22rem;
}

/* ═══════════════════════════════════
   FOOTER
═══════════════════════════════════ */
footer {
  border-top: 1px solid var(--fog);
  padding-top: 1.2rem;
  display: flex; justify-content: space-between;
  align-items: flex-end; flex-wrap: wrap; gap: 0.8rem;
}

.foot-note {
  font-size: 0.58rem; color: var(--stone);
  letter-spacing: 0.06em; line-height: 1.9;
}

.foot-note a { color: var(--fern); text-decoration: none; }
.foot-note a:hover { text-decoration: underline; }

.foot-mark {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.42rem; letter-spacing: 0.24em;
  color: var(--meadow); text-transform: uppercase;
}

/* ═══════════════════════════════════
   ANIMATION
═══════════════════════════════════ */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(14px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ═══════════════════════════════════
   RESPONSIVE
═══════════════════════════════════ */
@media (max-width:600px) {
  .header-content { grid-template-columns:1fr; gap:1rem; }
  .readouts { justify-content:flex-start; }
  .wrap { padding:1.4rem 0.9rem 4rem; }
  h1 { font-size:1.4rem; }
  .statusbar { gap:0.8rem; }
  .s-right { margin-left:0; }
}
