/* Canal Dry - design tokens, locked off the approved art + brief.
   palette pulled from avatar.png: brick #7a3616, mustard bed #c07e19,
   cream sky #dab777, ironwork near-black #1c1811, lime accent #ccff00
   (accent only, per Robinhood Chain rule - never a page fill).
   type: Oswald (condensed municipal-plate display) + IBM Plex Mono (readouts, CA).
   corner radius: 0 everywhere - this is cast iron and stamped paper, not software.
   motion: one idiom - the gate leaves swing on a real hinge transform. */

@font-face {
  font-family: 'Oswald';
  src: url('assets/fonts/oswald-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Oswald';
  src: url('assets/fonts/oswald-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Oswald';
  src: url('assets/fonts/oswald-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --brick: #7a3616;
  --brick-dark: #3a1a0a;
  --mustard: #c9852a;
  --cream: #e4c896;
  --iron: #1c1811;
  --iron-light: #2c261a;
  --lime: #ccff00;
  --paper: #ede2c8;
  --ground: #120d08;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ground);
  color: var(--paper);
  font-family: 'Oswald', sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 40px;
}

main {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---- hero: the chamber ---- */

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

.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--iron-light);
  background: var(--brick-dark);
}

.scene-base,
.recess img,
.leaf img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recess {
  position: absolute;
  left: 25.5%;
  top: 22.0%;
  width: 47.3%;
  height: 40.2%;
  overflow: hidden;
}
.recess img { object-fit: fill; }

.leaf {
  position: absolute;
  z-index: 2;
  transition: transform 900ms cubic-bezier(.65,.05,.36,1);
  will-change: transform;
}

.leaf-left {
  left: 25.5%;
  top: 23.9%;
  width: 23.5%;
  height: 38.3%;
  transform-origin: left center;
}
.leaf-right {
  left: 49.1%;
  top: 22.0%;
  width: 23.7%;
  height: 39.6%;
  transform-origin: right center;
}
.leaf img { object-fit: fill; }

.scene.gates-open .leaf-left {
  transform: perspective(600px) rotateY(-72deg) scaleX(.94);
}
.scene.gates-open .leaf-right {
  transform: perspective(600px) rotateY(72deg) scaleX(.94);
}

.gauge {
  position: absolute;
  left: 4%;
  top: 6%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(18, 13, 8, .72);
  border: 1px solid rgba(228, 200, 150, .35);
  padding: 5px 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .04em;
  z-index: 3;
}
.gauge-label { color: var(--cream); opacity: .8; }
.gauge-reading { color: var(--lime); }

.ca-plate {
  position: absolute;
  left: 6%;
  bottom: 5%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  background: linear-gradient(180deg, #3a3225, #221c13);
  border: 1px solid #59503b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 4px rgba(0,0,0,.5);
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
  transform: rotate(-.6deg);
}
.ca-label {
  font-family: 'Oswald', sans-serif;
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--mustard);
  font-weight: 600;
}
.ca-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--paper);
  letter-spacing: .02em;
}
.ca-plate.copied .ca-value::after {
  content: ' - copied';
  color: var(--lime);
}

.control-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--cream);
  opacity: .75;
}

.lever-btn {
  appearance: none;
  border: 1px solid #5a4f36;
  background: linear-gradient(180deg, var(--mustard), #8f5c17);
  color: var(--iron);
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .06em;
  padding: 12px 22px;
  cursor: pointer;
  box-shadow: 0 3px 0 #4c3410, inset 0 1px 0 rgba(255,255,255,.35);
}
.lever-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #4c3410, inset 0 1px 0 rgba(255,255,255,.35);
}
.lever-btn:disabled {
  opacity: .55;
  cursor: default;
}

.cycle-counter,
.time-record {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--cream);
  letter-spacing: .04em;
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.cycle-counter-value {
  font-size: 15px;
  color: var(--lime);
  font-weight: 600;
}
.time-record { opacity: .7; margin-left: auto; }

/* ---- maintenance log block ---- */

.log-block {
  border-top: 1px solid var(--iron-light);
  border-bottom: 1px solid var(--iron-light);
  padding: 18px 4px;
}

.log-block h2 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--mustard);
}

.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
}
.log-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(228, 200, 150, .18);
  padding-bottom: 6px;
}
.log-tag { color: var(--paper); opacity: .85; }
.log-status { color: var(--cream); }
.log-status.pass { color: var(--lime); }

.log-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--cream);
  opacity: .75;
}

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

.chrome {
  display: flex;
  gap: 18px;
  padding: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}
.chrome a {
  color: var(--cream);
  text-decoration: none;
  border: 1px solid var(--iron-light);
  padding: 6px 12px;
}
.chrome a:hover { border-color: var(--mustard); color: var(--mustard); }

@media (max-width: 480px) {
  .ca-value { font-size: 11px; }
  .lever-btn { font-size: 13px; padding: 10px 16px; }
  .time-record { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .leaf { transition: none; }
}
