/* SaveLoop: tool-first layout. One memorable element: the paste "slot". */

:root {
  --ink: #141a2e;
  --muted: #566080;
  --paper: #f4f6fb;
  --card: #ffffff;
  --line: #d6dbea;
  --blue: #2c4bff;
  --blue-deep: #1b34c9;
  --ok: #0b7a55;
  --err: #b3261e;
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
}

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

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

/* ---------- header ---------- */
.top {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.top-link { color: var(--muted); text-decoration: none; font-weight: 600; }
.top-link:hover { color: var(--ink); }

/* ---------- main column ---------- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.tool { padding: 2.5rem 0 2rem; }

h1 {
  margin: 0 0 0.75rem;
  max-width: 16ch;
  font-size: clamp(2.2rem, 6.5vw, 3.9rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.lede {
  margin: 0 0 2rem;
  max-width: 46ch;
  font-size: 1.125rem;
  color: var(--muted);
}

/* ---------- the paste slot ---------- */
.slot {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--ink);
}

.slot input {
  width: 100%;
  min-width: 0;
  padding: 0.9rem 0.75rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
}
.slot input::placeholder { color: #8a93ae; }
.slot input:focus-visible { outline-offset: 0; }

.slot-actions { display: flex; gap: 0.5rem; }

.slot button {
  font: inherit;
  font-weight: 700;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  cursor: pointer;
}
.btn-paste {
  flex: 0 0 auto;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
}
.btn-paste:hover { border-color: var(--ink); }
.btn-go {
  flex: 1 1 auto;
  color: #fff;
  background: var(--blue);
  border: 2px solid var(--blue);
}
.btn-go:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn-go[disabled] { opacity: 0.65; cursor: progress; }

@media (min-width: 640px) {
  .slot { flex-direction: row; align-items: center; padding: 0.6rem 0.6rem 0.6rem 1rem; }
  .slot input { flex: 1 1 auto; }
  .slot-actions { flex: 0 0 auto; }
}

/* ---------- status + results ---------- */
.status { min-height: 1.6em; margin: 1.25rem 0 0; font-weight: 600; color: var(--muted); }
.status.is-error { color: var(--err); }
.status.is-ok { color: var(--ok); }

.result { margin-top: 1rem; }

.result-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.items {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.item {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.item-media {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #e6e9f3;
}
.item-body { padding: 0.75rem; display: grid; gap: 0.6rem; }
.item-label { margin: 0; font-weight: 700; }
.item-save {
  display: block;
  padding: 0.7rem 1rem;
  text-align: center;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  border-radius: 10px;
  text-decoration: none;
}
.item-save:hover { background: var(--blue-deep); }

/* ---------- content blocks ---------- */
.block { padding: 2.5rem 0 0; }

h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.steps {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: 0 0 0 3.25rem;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 2.25rem; height: 2.25rem;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
}
.steps h3 { margin: 0 0 0.15rem; font-size: 1.1rem; }
.steps p { margin: 0; max-width: 52ch; color: var(--muted); }

@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}

.kinds { display: grid; gap: 0.75rem; margin: 0; }
.kinds > div {
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}
.kinds dt { font-weight: 700; }
.kinds dd { margin: 0.15rem 0 0; color: var(--muted); }
@media (min-width: 760px) {
  .kinds { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- FAQ ---------- */
details { border-bottom: 2px solid var(--line); }
details:first-of-type { border-top: 2px solid var(--line); }
summary {
  padding: 1rem 0;
  font-weight: 700;
  cursor: pointer;
}
details p { margin: 0 0 1rem; max-width: 62ch; color: var(--muted); }

/* ---------- footer ---------- */
.foot {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 2px solid var(--line);
}
.foot p { max-width: 62ch; margin: 0 0 1rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ---------- legal and text pages ---------- */
.doc { max-width: 720px; padding: 2.5rem 0 1rem; }
.doc h1 { max-width: none; font-size: clamp(1.9rem, 5vw, 2.8rem); }
.doc h2 { margin: 2rem 0 0.5rem; font-size: 1.25rem; letter-spacing: -0.01em; }
.doc p, .doc li { max-width: 68ch; }
.doc ul { padding-left: 1.25rem; }
.doc li { margin-bottom: 0.35rem; }
.doc .updated { margin: 0 0 1.5rem; color: var(--muted); }
.doc .note {
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}
