/* ---------------------------------------------------------------
   MUJICA.DEV
   Swiss grid · quiet terminal.
   --------------------------------------------------------------- */

:root {
  --bg:        #0a0a0a;
  --fg:        #e6e6e6;
  --fg-soft:   #9a9a9a;
  --dim:       #4e4e4e;
  --line:      #1c1c1c;
  --line-hi:   #262626;
  --accent:    #c8102e;

  --sans:  "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Instrument Serif", "Times New Roman", serif;

  --track:  0.14em;     /* uppercase letter-spacing */
  --col:    8rem;       /* key column for ledger / links */

  --pad-x: clamp(1rem, 3vw, 2.5rem);
  --pad-y: clamp(1rem, 2.5vw, 1.75rem);
}

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

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  min-height: 100vh;
  padding: var(--pad-y) var(--pad-x);
  display: grid;
  grid-template-rows: auto 1fr auto;
  row-gap: clamp(2.5rem, 6vw, 5rem);

  position: relative;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: inherit; text-decoration: none; }

/* --------------------------------------------------------------
   GRAIN
   -------------------------------------------------------------- */

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1   0 0 0 0 1   0 0 0 0 1   0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* --------------------------------------------------------------
   META (masthead + colophon share a base)
   -------------------------------------------------------------- */

.masthead,
.colophon {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.5rem;

  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--fg-soft);
}

.masthead {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.colophon {
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
}

.masthead .mark { color: var(--fg); }

.masthead .status,
.colophon .cursor { margin-left: auto; }

.status {
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.status i {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.cursor {
  color: var(--accent);
  animation: blink 1.05s steps(2, end) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* scroll progress */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: transparent;
  pointer-events: none;
}

.progress__fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}

/* --------------------------------------------------------------
   MAIN — horizontal filmstrip
   -------------------------------------------------------------- */

main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: clamp(2rem, 5vw, 4rem);

  overflow-x: auto;
  overflow-y: hidden;

  /* bleed to viewport edges */
  margin: 0 calc(var(--pad-x) * -1);
  padding: 0 var(--pad-x) 0.5rem;

  scrollbar-width: thin;
  scrollbar-color: var(--line-hi) transparent;
}

main::-webkit-scrollbar       { height: 6px; }
main::-webkit-scrollbar-track { background: transparent; }
main::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 3px; }

main > * {
  flex: 0 0 auto;
  width: min(82vw, 560px);
}

/* --------------------------------------------------------------
   HERO
   -------------------------------------------------------------- */

.hero {
  width: min(82vw, 520px);
  padding-top: clamp(0.5rem, 2vw, 1.5rem);
  opacity: 0;
  animation: fadeIn 0.9s ease 0.1s forwards;
}

.hero__title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(2.75rem, 8vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--fg);
}

.hero__dot { color: var(--accent); }

.hero__tagline {
  margin-top: clamp(1.5rem, 3vw, 2rem);
  max-width: 50ch;
  font-size: 0.95rem;
  color: var(--fg-soft);
}

.hero__tagline em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.25em;
  color: var(--fg);
  letter-spacing: -0.01em;
}


@keyframes fadeIn { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .hero, .cursor { opacity: 1; animation: none; }
}

/* --------------------------------------------------------------
   ROWS
   -------------------------------------------------------------- */

.row {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-left: clamp(1.25rem, 2.5vw, 2rem);
  padding-top: clamp(0.5rem, 2vw, 1.5rem);
  border-left: 1px solid var(--line);
}

.row__label {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.72rem;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--fg-soft);
}

.row__num { color: var(--dim); }
.row__name { color: var(--fg); }

.row__body { min-width: 0; }

.lede {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--fg);
  max-width: 52ch;
  margin-bottom: 1.1rem;
}

.row__body p {
  max-width: 62ch;
  margin-bottom: 1rem;
  color: var(--fg-soft);
}

.row__body p:last-child { margin-bottom: 0; }

.row__body p a,
.tinker li a {
  color: var(--fg);
  border-bottom: 1px solid var(--line-hi);
  transition: color 160ms ease, border-color 160ms ease;
}

.row__body p a:hover,
.row__body p a:focus-visible,
.tinker li a:hover,
.tinker li a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

/* tinkerings list */
.tinker {
  list-style: none;
  margin-top: 0.5rem;
}

.tinker li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.55;
}

.tinker li:first-child { border-top: 1px solid var(--line); }

.tinker__name { color: var(--fg); }
.tinker__note { color: var(--fg-soft); }

/* Serious description — hidden by default, shown only on touch (no hover) */
.tinker__caption {
  display: block;
  margin-top: 0.25rem;
  color: var(--dim);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------
   LEDGER
   -------------------------------------------------------------- */

.ledger { list-style: none; }

.ledger li {
  display: grid;
  grid-template-columns: var(--col) 1.2fr 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  align-items: baseline;
}

.ledger li:first-child { border-top: 1px solid var(--line); }

.ledger__date { color: var(--dim); }
.ledger__org  {
  color: var(--fg);
  font-weight: 500;
  transition: color 160ms ease;
}
.ledger__role { color: var(--fg-soft); }

.ledger__org:hover,
.ledger__org:focus-visible {
  color: var(--accent);
  outline: none;
}

/* --------------------------------------------------------------
   LINKS
   -------------------------------------------------------------- */

.links { list-style: none; }

.links li {
  display: grid;
  grid-template-columns: var(--col) 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  align-items: center;
}

.links li:first-child { border-top: 1px solid var(--line); }

.links__key {
  color: var(--dim);
  letter-spacing: var(--track);
  text-transform: uppercase;
  font-size: 0.72rem;
}

.links a {
  color: var(--fg);
  position: relative;
  transition: color 160ms ease;
}

.links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 240ms cubic-bezier(0.2, 0.9, 0.25, 1);
}

.links a:hover,
.links a:focus-visible { color: var(--accent); outline: none; }
.links a:hover::after,
.links a:focus-visible::after { width: 100%; }

/* --------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------- */

@media (max-width: 860px) {
  /* Flip the filmstrip — vertical stack on mobile */
  main {
    flex-direction: column;
    overflow-x: visible;
    overflow-y: visible;
    margin: 0;
    padding: 0;
    gap: clamp(2.5rem, 6vw, 3.5rem);
  }

  main > *,
  .hero { width: 100%; }

  .row {
    padding-left: 0;
    padding-top: 1.25rem;
    border-left: none;
    border-top: 1px solid var(--line);
  }

  /* No horizontal scroll, no progress bar */
  .progress { display: none; }

  .ledger li,
  .links li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding: 0.75rem 0;
    border-bottom: none;
  }

  .ledger li:first-child,
  .links li:first-child,
  .tinker li:first-child { border-top: none; }

  .tinker li { border-bottom: none; }
}

@media (max-width: 480px) {
  :root { --col: 6rem; }
  .hero__title { font-size: clamp(2.5rem, 13vw, 4rem); }
}
