:root {
  color-scheme: light;
  --paper: #e5e2da;
  --paper-raised: rgba(246, 244, 238, 0.62);
  --ink: #20211f;
  --ink-soft: #52534f;
  --ink-faint: #6b6c66;
  --line: rgba(32, 33, 31, 0.17);
  --line-strong: rgba(32, 33, 31, 0.29);
  --wood: #292421;
  --pink: #d51f62;
  --pink-bright: #e7447b;
  --pink-soft: rgba(213, 31, 98, 0.09);
  --green: #2f725a;
  --wood-image: url("./assets/materials/hinoki-charcoal.png");
  --stone-image: url("./assets/materials/limestone-pearl.png");
  --metal-image: url("./assets/materials/titanium-brushed.png");
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  background-color: var(--paper);
  background-image: linear-gradient(rgba(245, 243, 237, .16), rgba(216, 212, 202, .06)), var(--stone-image);
  background-size: cover;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.console-shell {
  display: grid;
  min-height: 100svh;
  grid-template-rows: 58px 38px minmax(0, 1fr) 25px;
}

.global-header {
  position: relative;
  display: grid;
  align-items: stretch;
  z-index: 2;
  border-bottom: 1px solid rgba(0,0,0,.72);
  background-color: var(--wood);
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.1)),
    var(--wood-image);
  background-size: cover;
  box-shadow: 0 2px 7px rgba(0,0,0,.22);
  grid-template-columns: 174px 1fr auto;
  opacity: 0;
  animation: register 540ms var(--ease) 40ms forwards;
}

.global-header::after {
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--pink) 36%, transparent 64%);
  content: "";
  opacity: .55;
}

.brand {
  display: flex;
  align-items: center;
  padding: 0 17px;
  border-right: 1px solid rgba(255,255,255,.07);
}

.brand img { display: block; width: 138px; height: auto; }

.global-header nav { display: flex; align-items: stretch; padding-left: 8px; }
.global-header nav a {
  position: relative;
  display: flex;
  min-width: 88px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  color: rgba(244,241,234,.7);
  font-size: 11px;
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(0,0,0,.72);
  transition: color 140ms, background 140ms, transform 55ms;
}

.global-header nav a:hover { color: #fff; background: rgba(255,255,255,.035); }
.global-header nav a:active { transform: translateY(1px); }
.global-header nav a.active { color: #fff; background: rgba(0,0,0,.24); box-shadow: inset 0 -2px var(--pink), inset 0 1px rgba(255,255,255,.04); }

.header-tools { display: flex; align-items: center; gap: 7px; padding-right: 13px; }
.tool-button,
.account-button {
  display: flex;
  height: 35px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 2px;
  background: rgba(0,0,0,.2);
  color: rgba(242,239,232,.68);
  font-family: "SF Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 7px;
  letter-spacing: .09em;
}
.tool-button { padding: 0 11px; }
.account-button { gap: 7px; padding: 0 9px 0 4px; }
.account-button i { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: linear-gradient(145deg, var(--pink-bright), #871039); color: #fff; font-family: Georgia, serif; font-style: normal; }
.account-button b { font-size: 7px; font-weight: 500; }

.context-rail {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding-left: 16px;
  border-bottom: 1px solid var(--line-strong);
  background-color: #bfc1be;
  background-image: linear-gradient(180deg, rgba(255,255,255,.38), rgba(80,82,82,.05)), var(--metal-image);
  background-size: auto, cover;
  box-shadow: inset 0 1px rgba(255,255,255,.48), 0 2px 5px rgba(40,40,38,.12);
  opacity: 0;
  animation: register 540ms var(--ease) 90ms forwards;
}

.context-rail > strong {
  display: flex;
  min-width: 92px;
  align-items: center;
  padding: 0 10px;
  box-shadow: inset 0 -2px var(--pink);
  font-size: 10px;
  font-weight: 500;
}

.rail-status { display: flex; align-items: center; }
.rail-status span { display: flex; height: 100%; align-items: center; gap: 5px; padding: 0 12px; border-left: 1px solid rgba(32,33,31,.11); color: var(--ink-faint); font-family: "SF Mono", "SFMono-Regular", Consolas, monospace; font-size: 6px; letter-spacing: .06em; }
.rail-status b { color: var(--ink); font-weight: 600; }
.rail-status .live { color: var(--pink); }
.rail-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 5px rgba(213,31,98,.42); }

main {
  min-width: 0;
  padding: 14px 18px 24px;
  opacity: 0;
  animation: register 540ms var(--ease) 140ms forwards;
}

.instrument-strip {
  display: grid;
  margin-bottom: 10px;
  border: 1px solid rgba(32,33,31,.13);
  background: rgba(245,243,237,.42);
  box-shadow: inset 0 1px rgba(255,255,255,.54), 0 2px 6px rgba(31,31,29,.06);
  grid-template-columns: repeat(4, 1fr);
}

.instrument-strip > div {
  min-width: 0;
  padding: 9px 12px 8px;
  border-left: 1px solid var(--line);
}
.instrument-strip > div:first-child { border-left: 0; }
.instrument-strip span { display: block; color: var(--ink-faint); font-family: "SF Mono", "SFMono-Regular", Consolas, monospace; font-size: 7px; letter-spacing: .08em; }
.instrument-strip b { display: block; margin: 3px 0 2px; font-size: 16px; font-weight: 650; letter-spacing: -.035em; }
.instrument-strip small { display: block; overflow: hidden; color: var(--ink-soft); font-size: 7px; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.instrument-strip .attention { box-shadow: inset 2px 0 var(--pink); }
.instrument-strip .attention b { color: #9f1546; }

.console-panel {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: rgba(235,232,224,.48);
  box-shadow: inset 0 1px rgba(255,255,255,.52), 0 5px 15px rgba(28,28,26,.08);
}

.console-toolbar {
  display: grid;
  min-height: 36px;
  align-items: center;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line-strong);
  background-color: #b9bbb8;
  background-image: linear-gradient(180deg, rgba(255,255,255,.33), rgba(80,82,82,.04)), var(--metal-image);
  background-size: auto, cover;
  grid-template-columns: 1fr auto;
}

.console-search { display: flex; height: 25px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid rgba(32,33,31,.23); background: rgba(249,248,244,.56); box-shadow: inset 0 1px 2px rgba(40,40,38,.1); color: var(--ink-soft); font-size: 9px; }
.console-search svg { width: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.console-count { padding: 0 10px; color: var(--ink-faint); font-size: 8px; }
.console-count b { color: var(--ink); }

.hero-record {
  position: relative;
  display: grid;
  min-height: clamp(188px, 28vh, 270px);
  align-items: center;
  padding: 28px 30px;
  border-bottom: 1px solid var(--line-strong);
  background:
    linear-gradient(105deg, rgba(213,31,98,.075), transparent 39%),
    linear-gradient(90deg, rgba(247,245,239,.58), rgba(224,220,211,.34));
  grid-template-columns: minmax(0, 1fr) auto;
}

.hero-record::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--pink);
  content: "";
}

.hero-copy { max-width: 760px; }
.hero-copy p { margin: 0 0 13px; color: #8c1240; font-family: "SF Mono", "SFMono-Regular", Consolas, monospace; font-size: 8px; letter-spacing: .1em; }
.hero-copy h1 { margin: 0; font-size: clamp(30px, 4.1vw, 58px); font-weight: 640; letter-spacing: -.057em; line-height: .98; }
.hero-copy > span { display: block; margin-top: 16px; color: var(--ink-soft); font-size: 13px; }

.primary-action {
  display: flex;
  width: 210px;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  margin-left: 34px;
  padding: 0 14px 0 17px;
  border: 1px solid rgba(106,12,48,.42);
  background: linear-gradient(145deg, var(--pink-bright), var(--pink));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(89,9,37,.32);
  box-shadow: inset 0 1px rgba(255,255,255,.3), 0 2px 5px rgba(79,13,38,.14);
  transition: filter 140ms, transform 55ms, box-shadow 140ms;
}
.primary-action:hover { filter: brightness(1.04); box-shadow: inset 0 1px rgba(255,255,255,.3), 0 4px 10px rgba(79,13,38,.2); }
.primary-action:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(57,7,26,.28); }

.record-head,
.records article {
  display: grid;
  grid-template-columns: 72px 34px 92px minmax(280px, 1fr) 150px 95px;
}

.record-head { min-height: 29px; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--ink-faint); font-family: "SF Mono", "SFMono-Regular", Consolas, monospace; font-size: 6px; font-weight: 600; letter-spacing: .1em; }

.records article { min-height: 54px; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.records article:last-child { border-bottom: 0; }
.records article:nth-child(2) { background: rgba(47,114,90,.045); box-shadow: inset 2px 0 #3c7b64; }
.records article.pending { background: var(--pink-soft); box-shadow: inset 2px 0 var(--pink); }
.records time { font-family: "SF Mono", "SFMono-Regular", Consolas, monospace; font-size: 8px; }
.records > article > i { color: var(--green); font-style: normal; font-weight: 700; }
.records article.pending > i { color: var(--pink); }
.records > article > b { font-size: 8px; letter-spacing: .08em; }
.records p { min-width: 0; margin: 0; padding-right: 20px; }
.records p strong { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.records p span { display: block; overflow: hidden; margin-top: 3px; color: var(--ink-faint); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.records code { overflow: hidden; color: var(--ink-soft); font-family: "SF Mono", "SFMono-Regular", Consolas, monospace; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.records em { color: var(--green); font-size: 8px; font-style: normal; font-weight: 700; letter-spacing: .06em; }
.records article.pending em { color: #9f1546; }

.statusbar {
  display: grid;
  align-items: center;
  border-top: 1px solid var(--line-strong);
  background-color: #bfc1be;
  background-image: linear-gradient(180deg, rgba(255,255,255,.35), rgba(80,82,82,.06)), var(--metal-image);
  background-size: auto, cover;
  color: var(--ink-faint);
  font-family: "SF Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 6px;
  letter-spacing: .06em;
  grid-template-columns: 1fr auto auto auto;
}
.statusbar span { height: 100%; padding: 8px 10px 0; border-left: 1px solid rgba(32,33,31,.12); }
.statusbar span:first-child { border-left: 0; }
.statusbar i { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: var(--pink); }
.statusbar b { color: var(--ink); }

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

@keyframes register { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 820px) {
  .global-header { grid-template-columns: 154px 1fr auto; }
  .brand { padding: 0 12px; }
  .brand img { width: 128px; }
  .global-header nav a { min-width: 70px; padding: 0 10px; }
  .header-tools .tool-button { display: none; }
  .instrument-strip { grid-template-columns: repeat(2, 1fr); }
  .instrument-strip > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .instrument-strip > div:nth-child(4) { border-top: 1px solid var(--line); }
  .hero-record { align-items: start; grid-template-columns: 1fr; }
  .primary-action { margin: 25px 0 0; }
  .record-head { display: none; }
  .records article { display: grid; gap: 5px; padding: 12px 14px; grid-template-columns: 50px 22px 1fr auto; }
  .records p { grid-column: 1 / -1; grid-row: 2; padding: 0; }
  .records code { grid-column: 3; }
  .records em { grid-column: 4; grid-row: 1; }
}

@media (max-width: 590px) {
  .console-shell { grid-template-rows: 56px 36px minmax(0, 1fr) 25px; }
  .global-header { grid-template-columns: 142px 1fr; }
  .global-header nav { justify-content: flex-end; padding: 0; }
  .global-header nav a { display: none; }
  .global-header nav a.active { display: flex; min-width: auto; padding: 0 15px; }
  .header-tools { display: none; }
  .rail-status span { display: none; }
  .rail-status .live { display: flex; }
  main { padding: 10px 9px 18px; }
  .instrument-strip { grid-template-columns: 1fr 1fr; }
  .instrument-strip b { font-size: 13px; }
  .instrument-strip small { font-size: 6px; }
  .console-toolbar { grid-template-columns: 1fr; }
  .console-count { display: none; }
  .hero-record { padding: 25px 20px; }
  .hero-copy h1 { font-size: 36px; }
  .hero-copy > span { font-size: 11px; line-height: 1.45; }
  .primary-action { width: 100%; }
  .records article { grid-template-columns: 44px 18px 1fr auto; }
  .records code { display: none; }
  .statusbar { grid-template-columns: 1fr auto; }
  .statusbar span:nth-child(2), .statusbar span:nth-child(3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
