/* Arranger, Inc. — corporate site
   Palette and type are deliberately distinct from the two neighbouring brands:
   Akıllı Mutabakat (coral #f0544f / Plus Jakarta + DM Sans) and ERISA Radar
   (navy #1c4e80 / Source Serif + Inter). Nothing here borrows from either. */

/* ---------- fonts ---------- */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/instrument-serif-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/instrument-serif-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/instrument-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/instrument-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+A720-A7FF;
}
@font-face {
  font-family: "Martian Mono";
  font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/martian-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Martian Mono";
  font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/martian-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+A720-A7FF;
}

/* ---------- tokens ---------- */

:root {
  --felt: #1b1d2a;          /* page — indigo-black, the lining of an instrument case */
  --plate: #262a3b;         /* raised surfaces */
  --brass: #c79a54;         /* the machine parts */
  --brass-bright: #e0b978;
  --mint: #7fd1b9;          /* the human, and anything approved */
  --bone: #ece9e2;
  --slate: #8b92a8;
  --line: rgba(236, 233, 226, 0.11);
  --line-strong: rgba(236, 233, 226, 0.2);

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --shell: 68rem;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--felt);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--brass-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- shared type ---------- */

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
}

.lane-name {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}

.section-title {
  margin: 0.75rem 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--bone);
}

.section-lead {
  margin: 1rem 0 0;
  max-width: 62ch;
  color: var(--slate);
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.75rem var(--gutter) 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.mark { width: 1.75rem; height: 1.5rem; fill: var(--brass); flex: none; }
.mark-signatory { fill: var(--mint); }

.wordmark-text {
  font-family: var(--serif);
  font-size: 1.375rem;
  letter-spacing: 0.005em;
}

.masthead-link {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--slate);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.masthead-link:hover { color: var(--bone); border-bottom-color: var(--brass); }

/* ---------- hero ---------- */

.hero {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 7rem) var(--gutter) clamp(2.5rem, 5vw, 4rem);
}

.hero-title {
  margin: 1.25rem 0 0;
  max-width: 26ch;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 7.2vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -0.018em;
}

.lead {
  margin: 1.75rem 0 0;
  max-width: 56ch;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.58;
  color: #c3c6d2;
}

/* ---------- the arrangement (the signature element) ---------- */

.arrangement-section {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(3rem, 7vw, 5.5rem);
}

.arrangement-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding-bottom: 1rem;
}

.controls { display: inline-flex; align-items: center; gap: 1.25rem; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.25rem;
  background: none;
  border: 0;
  color: var(--bone);
  cursor: pointer;
  font: inherit;
}

.toggle-track {
  position: relative;
  width: 2.375rem;
  height: 1.25rem;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s, background 0.2s;
}

.toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 0.875rem; height: 0.875rem;
  border-radius: 999px;
  background: var(--slate);
  transition: transform 0.2s ease, background 0.2s;
}

.toggle[aria-pressed="true"] .toggle-track { border-color: rgba(127, 209, 185, 0.5); background: rgba(127, 209, 185, 0.14); }
.toggle[aria-pressed="true"] .toggle-knob { background: var(--mint); transform: translateX(1.125rem); }

.toggle-label {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.replay {
  background: none;
  border: 0;
  padding: 0.25rem 0;
  color: var(--slate);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 1px solid var(--line-strong);
}

.replay:hover { color: var(--bone); border-bottom-color: var(--brass); }

.arrangement-frame { position: relative; }

/* Shown only when the arrangement is wider than the screen: an edge fade that
   says there is more timeline to the right. The playhead scrolls the box itself
   as it plays, so a narrow screen still gets carried to the gate. */
.arrangement-frame::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0.5rem;
  width: 3rem;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(to right, rgba(27, 29, 42, 0), var(--felt));
  transition: opacity 0.3s;
}

.arrangement-frame.is-scrollable::after { opacity: 1; }

.arrangement-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  padding-bottom: 0.5rem;
}

.arrangement {
  position: relative;
  min-width: 46rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  /* right padding keeps the end of the timeline off the frame edge */
  padding: 1.25rem 0.75rem 1.25rem 0;
}

/* The axis sits behind the lanes: measure dividers, the gate, the playhead.
   Its left inset matches the lane-name column so 0% is the true start of time. */
.axis {
  position: absolute;
  top: 0; bottom: 0;
  left: 7.5rem; right: 0;
  pointer-events: none;
}

.measure { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(236, 233, 226, 0.07); }

.gate { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(199, 154, 84, 0.45); }

.gate-label {
  position: absolute;
  top: -0.25rem;
  left: 0.375rem;
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
}

.playhead {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--brass-bright);
  box-shadow: 0 0 12px rgba(224, 185, 120, 0.55);
  left: 0;
  opacity: 0;
}

.arrangement.is-playing .playhead, .arrangement.is-held .playhead { opacity: 1; }

.lane {
  position: relative;
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  align-items: center;
  min-height: 2.75rem;
}

/* Sticky so the part names stay legible while a narrow screen scrolls the
   timeline; the opaque ground hides events passing underneath. */
.lane .lane-name,
.outbound .lane-name {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  align-self: stretch;
  padding-right: 1rem;
  background: var(--felt);
}

.track {
  position: relative;
  height: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.event {
  position: absolute;
  top: 0;
  height: 1.75rem;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  border: 1px solid;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.lane-input .event { border-color: rgba(236, 233, 226, 0.16); color: rgba(139, 146, 168, 0.9); }
.lane-input .event.is-lit { border-color: rgba(236, 233, 226, 0.4); background: rgba(236, 233, 226, 0.07); color: var(--bone); }

.lane-machine .event { border-color: rgba(199, 154, 84, 0.22); color: rgba(199, 154, 84, 0.75); }
.lane-machine .event.is-lit { border-color: rgba(199, 154, 84, 0.6); background: rgba(199, 154, 84, 0.15); color: var(--brass-bright); }

.lane-human .event { border-color: rgba(127, 209, 185, 0.25); color: rgba(127, 209, 185, 0.75); }
.lane-human .event.is-lit { border-color: rgba(127, 209, 185, 0.65); background: rgba(127, 209, 185, 0.16); color: var(--mint); }

/* Signatory switched off: the lane is visibly absent, not merely inactive. */
.lane-human.is-off .lane-name { color: rgba(139, 146, 168, 0.45); }
.lane-human.is-off .event {
  border-style: dashed;
  border-color: rgba(236, 233, 226, 0.16);
  background: none;
  color: rgba(139, 146, 168, 0.5);
}

.outbound {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  align-items: baseline;
  padding-top: 1rem;
}

/* Right-aligned: outbound is what happens at the end of the timeline, so the
   state belongs under the end of it, not under the start. */
.outbound-state {
  margin: 0;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  color: var(--slate);
  transition: color 0.25s;
}

.outbound-state.is-sent { color: var(--mint); }
.outbound-state.is-held { color: var(--bone); }

.arrangement-note {
  margin: 1.5rem 0 0;
  max-width: 52ch;
  font-size: 0.9375rem;
  color: var(--slate);
}

/* Legend for the four lanes. A short gloss rather than its own section — the
   drawing needs "Instrument" explained, not a chapter about it. */
.legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  margin: clamp(2rem, 4vw, 2.75rem) 0 0;
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--line);
}

.legend-item dt { margin-bottom: 0.5rem; }

.legend-item dd {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--slate);
}

/* ---------- section divider: the mark, reused ---------- */

.rule {
  display: block;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mark-rule { width: 1.5rem; height: 1.3125rem; opacity: 0.5; }

/* ---------- the parts ---------- */

.parts, .working {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
}

.section-head { max-width: 40rem; }

.part-list { margin: clamp(2rem, 4vw, 3rem) 0 0; }

.part {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 0.75rem 3rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}

.part:last-child { border-bottom: 1px solid var(--line); }

.part dt { display: flex; flex-direction: column; gap: 0.625rem; }

.part-title {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  line-height: 1.18;
  color: var(--bone);
}

.part dd { margin: 0; color: var(--slate); max-width: 56ch; }

/* ---------- working together ---------- */

.terms { margin: clamp(2rem, 4vw, 3rem) 0 0; }

.term {
  display: grid;
  grid-template-columns: minmax(0, 10rem) minmax(0, 1fr);
  gap: 0.375rem 3rem;
  padding: 1.125rem 0;
  border-top: 1px solid var(--line);
}

.term:last-child { border-bottom: 1px solid var(--line); }

.term dt {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
  padding-top: 0.25rem;
}

.term dd { margin: 0; color: var(--slate); max-width: 56ch; }

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.cta-line {
  margin: 0;
  max-width: 30ch;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1.2;
}

.button {
  display: inline-block;
  flex: none;
  padding: 0.8125rem 1.375rem;
  background: var(--brass);
  color: #1b1d2a;
  text-decoration: none;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.2s;
}

.button:hover { background: var(--brass-bright); }

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

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.05em;
  color: var(--slate);
}

.footer p { margin: 0; }
.footer a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.footer a:hover { color: var(--bone); border-bottom-color: var(--brass); }

/* ---------- narrow screens ---------- */

@media (max-width: 62rem) {
  .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 46rem) {
  .part { grid-template-columns: 1fr; gap: 0.75rem; }
  .term { grid-template-columns: 1fr; gap: 0.25rem; }
  .cta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 34rem) {
  .legend { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
