/* Instagram Transcript — one stylesheet, system fonts, no dependencies */

:root {
  --ink: #14110f;
  --ink-2: #4a4340;
  --ink-3: #7a716c;
  --paper: #fbf9f6;
  --card: #ffffff;
  --line: #e7e0d8;
  --line-strong: #d6cdc2;
  --accent: #d1331f;
  --accent-ink: #a82a1a;
  --accent-soft: #fbe9e5;
  --ok: #1f7a4d;
  --err: #b3261e;
  --err-soft: #fdecea;
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 1px 2px rgba(20, 17, 15, .05), 0 12px 32px -12px rgba(20, 17, 15, .14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4efea;
    --ink-2: #c3b9b1;
    --ink-3: #948a83;
    --paper: #131110;
    --card: #1b1817;
    --line: #2b2624;
    --line-strong: #3a3330;
    --accent: #ff6a4d;
    --accent-ink: #ff8a72;
    --accent-soft: #2c1b17;
    --ok: #63c893;
    --err: #ff8a80;
    --err-soft: #2a1715;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(880px, 100% - 40px); margin-inline: auto; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

/* ---------- top bar ---------- */

.topbar {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.topbar__in {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 56px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; letter-spacing: -.01em;
}
.brand__mark { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.6; }
.brand__mark .dot { fill: var(--ink); stroke: none; }
.topbar__note { font-size: 12.5px; color: var(--ink-3); letter-spacing: .01em; }

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

.hero { padding: 56px 0 40px; }

h1 {
  margin: 0 0 10px;
  font-size: clamp(2.1rem, 6.4vw, 3.05rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 640;
}
.lede {
  margin: 0 0 30px;
  max-width: 56ch;
  color: var(--ink-2);
  font-size: clamp(1rem, 2.4vw, 1.08rem);
  line-height: 1.55;
}

.console {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.console__field {
  display: flex; gap: 10px; align-items: stretch;
}

#url {
  flex: 1 1 auto; min-width: 0;
  height: 52px;
  padding: 0 16px;
  font: inherit; font-size: 15.5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
#url::placeholder { color: var(--ink-3); }
#url { font-variant-numeric: tabular-nums; }
#url:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  background: var(--card);
}
#url[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 16%, transparent); }

.btn {
  --btn-bg: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px;
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: -.005em;
  color: #fff; background: var(--btn-bg);
  border: 0; border-radius: 10px; cursor: pointer;
  transition: transform .1s ease, filter .14s ease, opacity .14s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px) scale(.995); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn[disabled] { opacity: .6; cursor: progress; }

.btn__spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  display: none;
}
.btn.is-busy .btn__spin { display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn--ghost {
  height: 34px; padding: 0 12px;
  font-size: 13px; font-weight: 600;
  color: var(--ink); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 8px;
  text-decoration: none;
}
.btn--ghost:hover { background: var(--paper); filter: none; }
.btn--ghost.is-done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }

.hint {
  margin: 10px 2px 0;
  font-size: 13px; color: var(--ink-3);
}
.hint code, .spec code, .prose code {
  font-family: var(--mono); font-size: .92em;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  padding: 1px 5px; border-radius: 4px;
}
.hint.is-bad { color: var(--err); }

.note-line {
  margin: 12px 2px 0; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2); line-height: 1.5;
}

.alert {
  margin: 16px 0 0; padding: 12px 14px;
  background: var(--err-soft); color: var(--err);
  border: 1px solid color-mix(in srgb, var(--err) 30%, transparent);
  border-radius: 10px; font-size: 14px;
}

/* ---------- result ---------- */

.result {
  margin-top: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise .34s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.result__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 60%, var(--card));
}
.result__meta, .result__acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em;
  padding: 3px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  text-transform: uppercase;
}
.chip--quiet { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink-2); }

.lines {
  list-style: none; margin: 0; padding: 6px 0;
  max-height: min(58vh, 560px); overflow: auto;
  counter-reset: line;
}
.lines li {
  display: grid; grid-template-columns: 62px 1fr; gap: 12px;
  padding: 7px 18px;
  font-size: 15px; line-height: 1.55;
  transition: background .12s ease;
}
.lines li:hover { background: color-mix(in srgb, var(--ink) 3.5%, transparent); }
.lines time {
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-3); padding-top: 3px; text-align: right;
}
.lines .say { color: var(--ink); }

.empty {
  margin: 22px 2px 0; font-size: 13.5px; color: var(--ink-3);
}

/* ---------- prose ---------- */

.rule { border: 0; border-top: 1px solid var(--line); margin: 16px auto 0; }

.prose { padding: 44px 0 24px; max-width: 880px; }
.prose h2 {
  margin: 40px 0 12px;
  font-size: clamp(1.18rem, 3vw, 1.35rem);
  letter-spacing: -.02em; font-weight: 640;
}
.prose h2:first-child { margin-top: 0; }
.prose p {
  margin: 0 0 14px; max-width: 68ch;
  color: var(--ink-2); line-height: 1.7;
}

.spec {
  width: 100%; border-collapse: collapse; margin: 4px 0 8px;
  font-size: 14px;
}
.spec th, .spec td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; }
.spec td:first-child { width: 34%; color: var(--ink); font-weight: 500; }
.spec td:last-child { color: var(--ink-2); }

.steps { margin: 4px 0 8px; padding-left: 0; list-style: none; counter-reset: s; }
.steps li {
  counter-increment: s; position: relative;
  padding: 0 0 16px 42px; color: var(--ink-2); max-width: 64ch;
}
.steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: -1px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.steps strong { color: var(--ink); }

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 2px; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.faq summary::after {
  content: ""; width: 8px; height: 8px; flex: none;
  border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .16s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq p { margin: 0 0 16px; padding-right: 24px; }

.foot {
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
  padding: 26px 0 48px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3);
}

/* ---------- phones ---------- */

@media (max-width: 620px) {
  .wrap { width: min(880px, 100% - 32px); }
  .hero { padding: 34px 0 28px; }
  .topbar__note { display: none; }
  .console { padding: 12px; }
  .console__field { flex-direction: column; }
  #url { height: 50px; font-size: 16px; } /* 16px keeps iOS from zooming */
  .btn--go { width: 100%; height: 50px; }
  .result__bar { flex-direction: column; align-items: flex-start; }
  .result__acts { width: 100%; }
  .result__acts .btn--ghost { flex: 1 1 0; height: 36px; }
  .lines li { grid-template-columns: 52px 1fr; gap: 10px; padding: 7px 14px; font-size: 14.5px; }
  .spec { display: block; overflow-x: auto; }
  .spec td:first-child { width: auto; }
  .prose { padding-top: 32px; }
  .foot { padding-bottom: 32px; }
}

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