/* ============================================================
   GITCLONE design tokens - locked from assets/avatar.png + banner.png
   beige office wall, mint-teal polo, coffee stain, monitor grey, ink red
   ============================================================ */
:root {
  --bg: #DAD0BD;
  --bg-deep: #C6BB9E;
  --floor-line: #C0B497;
  --card: #F1EAD9;
  --card-edge: #E4DAC2;
  --ink: #211D1A;
  --shirt: #6FAA9A;
  --shirt-dark: #4F8577;
  --stain: #79663F;
  --monitor: #3A3A38;
  --desk: #A79A79;
  --mug: #8A6A4C;
  --stamp-red: #B23A2E;
  --stamp-red-deep: #8C2A20;
  --accent-blue: #5F8FBF;
  --paper: #F6F0E1;
  --muted: #6F6656;

  --font-sans: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --radius: 8px;
  --radius-lg: 14px;
  --gap: 18px;
  --motion: 260ms;
  --ease: cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  background-image:
    linear-gradient(var(--floor-line) 1px, transparent 1px);
  background-size: 100% 42px;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------------------------- topbar ---------------------------- */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap);
  padding-bottom: 16px;
  border-bottom: 3px solid var(--ink);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  border-radius: 6px;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  flex-shrink: 0;
}

.wordmark {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0.01em;
  font-weight: 700;
  line-height: 1.1;
}

.ticker {
  font-family: var(--font-mono);
  font-size: 0.42em;
  font-weight: 600;
  color: var(--muted);
  vertical-align: middle;
  margin-left: 4px;
}

.tagline {
  margin: 6px 0 0;
  max-width: 46ch;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.status-line {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--shirt-dark);
}

.status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--shirt);
  border: 1.5px solid var(--ink);
  display: inline-block;
  animation: pulse-dot 2.2s ease-in-out infinite;
}
.status-dot.is-full { background: var(--stamp-red); animation: none; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform var(--motion) var(--ease), box-shadow var(--motion) var(--ease);
  text-decoration: none;
}
.icon-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.icon-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.stamp-btn { background: var(--paper); border: none; padding: 0; }
.stamp-btn.is-stamping { animation: stamp-slam 340ms var(--ease); }

@keyframes stamp-slam {
  0% { transform: translate(0,-8px) rotate(-8deg) scale(1.06); }
  55% { transform: translate(2px,2px) rotate(2deg) scale(0.96); }
  100% { transform: translate(0,0) rotate(0) scale(1); }
}

/* ---------------------------- console ---------------------------- */
.console {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 22px;
  box-shadow: 4px 4px 0 var(--bg-deep);
}

.console-line {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: #B7E4C7;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed #4A463D;
}

.prompt { color: #E8C25B; font-weight: 700; }
.cmd { flex: 1; min-width: 0; }
.cursor {
  width: 8px; height: 15px;
  background: #B7E4C7;
  display: inline-block;
  animation: blink-cursor 1s step-end infinite;
}
@keyframes blink-cursor { 50% { opacity: 0; } }

.console-readout {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.readout-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.readout-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: #8B8677;
}
.readout-value {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 700;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.clone-btn {
  margin-left: auto;
  background: var(--shirt);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  box-shadow: 3px 3px 0 var(--stamp-red-deep);
  transition: transform var(--motion) var(--ease), box-shadow var(--motion) var(--ease), background var(--motion) var(--ease);
}
.clone-btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--stamp-red-deep);
  background: var(--shirt-dark);
}
.clone-btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--stamp-red-deep);
}
.clone-btn:disabled {
  cursor: not-allowed;
  background: var(--desk);
  box-shadow: 3px 3px 0 var(--ink);
  opacity: 0.85;
}

.clone-btn-main {
  font-weight: 700;
  font-size: 15.5px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.clone-btn-sub {
  font-size: 10.5px;
  color: var(--ink);
  opacity: 0.7;
}

/* ---------------------------- office grid ---------------------------- */
.office {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  background: var(--bg-deep);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 4px 4px 0 var(--ink);
  margin-bottom: 16px;
  transition: filter var(--motion) var(--ease);
}
.office.is-full { filter: saturate(0.75); }

.desk-card {
  position: relative;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 8px 8px 30px;
  box-shadow: 2px 2px 0 var(--card-edge);
  /* not overflow:hidden: the art clips itself (below), and the ID badge on
     card 2 needs to hang slightly above this box like a real clipped badge */
}

.desk-card-art {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
}

.desk-card-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-outline {
  filter: grayscale(1) brightness(2) contrast(0.35);
  opacity: 0.55;
}

.art-color {
  clip-path: inset(0 0 0 0);
}

.desk-card:not(.is-settled) .art-color {
  clip-path: inset(100% 0 0 0);
}

.desk-card.is-pasting {
  animation: paste-halo 620ms ease-out;
}
@keyframes paste-halo {
  0% { box-shadow: 0 0 0 0 rgba(95,143,191,0.9), 2px 2px 0 var(--card-edge); }
  100% { box-shadow: 0 0 0 14px rgba(95,143,191,0), 2px 2px 0 var(--card-edge); }
}

.clone-progress {
  position: absolute;
  left: 8px; right: 8px; bottom: 8px;
  height: 18px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  overflow: hidden;
  transition: opacity var(--motion) var(--ease), visibility var(--motion);
}
.clone-progress-bar {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--shirt);
  border-right: 1.5px solid var(--ink);
}
.clone-progress-label {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 18px;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.desk-card.is-progress-done .clone-progress {
  opacity: 0;
  visibility: hidden;
}

.desk-card-tag {
  position: absolute;
  left: 8px; right: 8px; bottom: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  color: var(--muted);
  opacity: 0;
  transition: opacity var(--motion) var(--ease);
}
.desk-card.is-progress-done .desk-card-tag,
.desk-card.is-original .desk-card-tag {
  opacity: 1;
}
.desk-card.is-original .clone-progress { display: none; }

/* ---------------------------- ID badge (CA), first clone only ---------------------------- */
.id-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  width: calc(100% - 18px);
  z-index: 3;
  filter: drop-shadow(0 3px 0 rgba(33,29,26,0.35));
  opacity: 0;
  transition: opacity var(--motion) var(--ease), transform var(--motion) var(--ease);
  pointer-events: none;
}
.desk-card.is-progress-done .id-badge {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) rotate(-3deg);
}

.id-badge-clip {
  display: block;
  width: 22px;
  height: 10px;
  margin: 0 auto -3px;
  background: var(--desk);
  border: 1.5px solid var(--ink);
  border-radius: 3px 3px 0 0;
}

.id-badge-body {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: 5px 6px 6px;
  text-align: center;
  box-shadow: 2px 2px 0 var(--ink);
}

.id-badge-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.id-badge-ca {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  padding: 2px 0;
  margin: 1px 0;
}
.id-badge-ca code {
  display: block;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--stamp-red-deep);
  word-break: break-all;
  line-height: 1.25;
}

.id-badge-state {
  display: block;
  font-family: var(--font-mono);
  font-size: 6.8px;
  color: var(--shirt-dark);
  letter-spacing: 0.05em;
}

.id-badge.is-stamping .ink-stamp,
.ink-stamp.is-visible {
  animation: ink-pop 1.5s var(--ease) forwards;
}
.ink-stamp {
  position: absolute;
  top: 18%;
  right: -8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  color: var(--stamp-red);
  border: 2px solid var(--stamp-red);
  border-radius: 4px;
  padding: 2px 5px;
  transform: rotate(14deg) scale(0);
  opacity: 0;
  background: rgba(241,234,217,0.85);
}
@keyframes ink-pop {
  0% { transform: rotate(14deg) scale(0); opacity: 0; }
  25% { transform: rotate(10deg) scale(1.15); opacity: 1; }
  40% { transform: rotate(12deg) scale(1); opacity: 1; }
  80% { transform: rotate(12deg) scale(1); opacity: 1; }
  100% { transform: rotate(12deg) scale(1); opacity: 0; }
}

/* ---------------------------- office full banner ---------------------------- */
.office-full-banner {
  background: var(--stamp-red);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 3px 3px 0 var(--ink);
  animation: shake-in 420ms var(--ease);
}
.office-full-banner[hidden] { display: none; }
.office-full-banner strong {
  font-size: 16px;
  letter-spacing: 0.03em;
}
.office-full-banner span {
  font-size: 12.5px;
  opacity: 0.9;
}
@keyframes shake-in {
  0% { transform: translateX(-6px); opacity: 0; }
  40% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
  100% { transform: translateX(0); opacity: 1; }
}

/* ---------------------------- footer ---------------------------- */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.uptime { letter-spacing: 0.04em; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* ---------------------------- scroll-depth doc panels ---------------------------- */
.doc-panel {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 22px;
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
}

.doc-tabbar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--bg-deep);
  border-bottom: 2px solid var(--ink);
}
.doc-tabbar.mono { background: var(--ink); }

.doc-tab {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  padding: 2px 4px;
  border-bottom: 2px solid transparent;
}
.doc-tabbar.mono .doc-tab { color: #B7E4C7; }
.doc-tab.is-active { border-bottom-color: var(--shirt); }
.doc-tabbar.mono .doc-tab.is-active { border-bottom-color: #B7E4C7; }

.doc-prompt {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #E8C25B;
}

.doc-tab-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.doc-tabbar.mono .doc-tab-meta { color: #8B8677; }

/* handbook */
.handbook-list {
  list-style: none;
  margin: 0;
  padding: 6px 18px 18px;
  counter-reset: none;
}
.handbook-list li {
  padding: 12px 0;
  border-top: 1px dashed var(--card-edge);
}
.handbook-list li:first-child { border-top: none; }
.handbook-list h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}
.clause-no {
  font-family: var(--font-mono);
  color: var(--shirt-dark);
  margin-right: 4px;
}
.handbook-list p {
  margin: 0;
  max-width: 62ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* faq */
.faq-list {
  margin: 0;
  padding: 10px 18px 18px;
  display: grid;
  gap: 14px;
}
.faq-item { padding-top: 10px; border-top: 1px dashed var(--card-edge); }
.faq-item:first-child { padding-top: 0; border-top: none; }
.faq-item dt {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--stamp-red-deep);
  margin-bottom: 4px;
}
.faq-item dd {
  margin: 0;
  max-width: 62ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
}

/* culture commit log */
.commit-list {
  list-style: none;
  margin: 0;
  padding: 10px 18px 18px;
  display: grid;
  gap: 9px;
}
.commit-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.commit-hash {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--shirt-dark);
  background: var(--bg);
  border: 1px solid var(--card-edge);
  border-radius: 3px;
  padding: 1px 5px;
}
.commit-msg { color: var(--ink); }
.commit-msg b { color: var(--stamp-red-deep); font-weight: 700; }

/* reviews thread */
.review-thread {
  list-style: none;
  margin: 0;
  padding: 14px 18px 18px;
  display: grid;
  gap: 14px;
}
.review-comment {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.review-avatar {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--desk);
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--card);
}
.review-body {
  background: var(--bg);
  border: 1.5px solid var(--card-edge);
  border-radius: var(--radius);
  padding: 8px 12px;
  flex: 1;
  min-width: 0;
}
.review-byline {
  margin: 0 0 4px;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.review-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--ink);
}
.review-tag.is-approved { background: var(--shirt); color: var(--ink); }
.review-tag.is-changes { background: var(--stamp-red); color: var(--paper); }
.review-tag.is-comment { background: var(--paper); color: var(--muted); }
.review-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
}

.nojs {
  max-width: 640px;
  margin: 40px auto;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
}

/* ---------------------------- motion & accessibility ---------------------------- */
@media (prefers-reduced-motion: reduce) {
  .status-dot,
  .desk-card.is-pasting,
  .stamp-btn.is-stamping,
  .cursor,
  .office-full-banner,
  .ink-stamp.is-visible {
    animation: none !important;
  }
  .icon-btn, .clone-btn { transition: none !important; }
}

/* ---------------------------- responsive ---------------------------- */
@media (max-width: 620px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .tools { align-self: flex-end; }
  .console-readout { gap: 14px; }
  .clone-btn { margin-left: 0; width: 100%; align-items: center; }
  .office { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; padding: 12px; }
  .wordmark { font-size: 22px; }
  .ticker { display: block; margin-left: 0; margin-top: 2px; }
  .doc-tab-meta { margin-left: 0; order: 3; flex-basis: 100%; }
  .review-comment { gap: 8px; }
  .review-avatar { width: 28px; height: 28px; font-size: 10.5px; }
}

@media (min-width: 920px) {
  .office { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
}
