/* Inkleaf website. The page is laid out like a PDF open in Inkleaf:
   the green title bar, the desk behind the document, and white sheets
   with a page number at the foot of each. Colours and the typeface are
   the app's own. */

:root {
  --frame: #123b2f;
  --frame-ink: #f4f1ea;
  --frame-muted: #9dbbae;
  --leaf: #74d4a4;
  --desk: #e5e1d7;
  --paper: #ffffff;
  --ink: #14201b;
  --muted: #56635c;
  --line: #e1ddd3;
  --line-strong: #c2cbc5;
  --accent: #2b7356;
  --accent-hover: #225e46;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ea;
  --shadow: 0 1px 2px rgba(18, 59, 47, 0.14), 0 8px 24px rgba(18, 59, 47, 0.07);

  --pad: clamp(22px, 7vw, 88px);
  --measure: 38em;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --frame: #0d241d;
    --frame-ink: #dcebe4;
    --frame-muted: #8fae9f;
    --desk: #0b1814;
    --paper: #111c18;
    --ink: #e3ece7;
    --muted: #97a69e;
    --line: #26332e;
    --line-strong: #3a4540;
    --accent: #5cc49a;
    --accent-hover: #74d4a4;
    --accent-ink: #06261a;
    --accent-soft: #17302a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

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

html { scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }

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

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

/* ---- title bar ---------------------------------------------------------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
  padding: 0 clamp(16px, 3vw, 28px);
  background: var(--frame);
  color: var(--frame-ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--frame-ink);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
}
.brand:hover { color: var(--frame-ink); }

.bar nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 26px); }

.bar nav a {
  color: var(--frame-muted);
  font-size: 0.95rem;
  text-decoration: none;
}
.bar nav a:hover { color: var(--frame-ink); }

.bar nav .bar-download {
  color: var(--frame);
  background: var(--leaf);
  padding: 6px 14px;
  border-radius: 7px;
  font-weight: 600;
}
.bar nav .bar-download:hover { color: var(--frame); background: #8fe0b8; }

/* ---- sheets ------------------------------------------------------------- */

main { padding: clamp(16px, 4vw, 44px) clamp(10px, 3vw, 32px) 8px; }

.sheet {
  position: relative;
  max-width: 1000px;
  margin: 0 auto clamp(16px, 3vw, 32px);
  padding: var(--pad) var(--pad) calc(var(--pad) * 0.6);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.sheet > p,
.lead { max-width: var(--measure); }

h1, h2, h3 { margin: 0; font-weight: 600; }

h1 {
  font-size: clamp(2.35rem, 6.2vw, 4.25rem);
  font-stretch: 78%;
  font-variation-settings: "wdth" 78;
  line-height: 1.02;
  letter-spacing: -0.012em;
  max-width: 13.5em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.4rem);
  font-stretch: 84%;
  font-variation-settings: "wdth" 84;
  line-height: 1.1;
  margin-bottom: 0.7em;
}

h3 { font-size: 1.2rem; margin-bottom: 0.5em; }

p { margin: 0 0 1em; }

.lead { font-size: 1.2rem; color: var(--ink); }
.hero .lead { margin-top: 0; }

.folio {
  margin: clamp(32px, 6vw, 64px) auto 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

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

/* One line from a menu, shown the way Inkleaf shows a line being edited:
   a dashed box, and a typo that gets fixed when the page loads. */
.demo {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: 34rem;
  margin: clamp(26px, 4vw, 40px) 0 clamp(22px, 3vw, 32px);
  padding: 7px 10px;
  border: 1px dashed var(--accent);
  border-radius: 2px;
  font-family: Helvetica, Arial, sans-serif;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
}
.demo-line { overflow: hidden; text-overflow: ellipsis; }
.demo-price { color: var(--muted); }

.demo-word.typing::after {
  content: "";
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -0.15em;
  background: var(--ink);
  animation: caret 0.9s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 28px;
}

.button {
  display: inline-block;
  padding: 13px 22px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: var(--accent-hover); color: var(--accent-ink); }

.quiet-link { font-size: 1rem; }

.shot {
  position: relative;
  margin: clamp(36px, 6vw, 60px) 0 0;
}
.shot video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #e4e8e5;
}
.shot-toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  background: rgba(20, 32, 27, 0.75);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.shot:hover .shot-toggle,
.shot-toggle:focus-visible,
.shot-toggle[aria-pressed="true"] { opacity: 1; }
@media (hover: none) { .shot-toggle { opacity: 1; } }

/* ---- what it does ------------------------------------------------------- */

.tools {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, var(--measure));
  gap: 22px 40px;
  margin: 0;
}
.tools dt { font-weight: 600; }
.tools dd { margin: 0; color: var(--ink); }

.compare { margin: clamp(36px, 6vw, 56px) 0 0; max-width: 780px; }

.compare-frame {
  --pos: 50%;
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.compare-frame img { width: 100%; pointer-events: none; }
.compare-frame:has(.compare-range:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

.compare-before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.compare-before img { height: 100%; object-fit: cover; }

.compare-tag {
  position: absolute;
  top: 12px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(20, 32, 27, 0.72);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.15s;
}
.compare-tag-before { left: 12px; }
.compare-tag-after { right: 12px; }
.compare-frame.near-left .compare-tag-before,
.compare-frame.near-right .compare-tag-after { opacity: 0; }

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 3px;
  margin-left: -1.5px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(20, 32, 27, 0.25), 0 0 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.compare-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: #fff;
  color: #2b7356;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.compare-frame:hover .compare-knob { transform: scale(1.08); }
.compare-frame.dragging .compare-knob { transform: scale(1.15); background: #2b7356; color: #fff; }

/* the real control: an invisible slider over the whole picture, so you can
   grab the handle (or anywhere) and drag, and use the arrow keys */
.compare-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  touch-action: pan-y;
}
.compare-range::-webkit-slider-thumb { -webkit-appearance: none; width: 56px; height: 100%; cursor: grab; }
.compare-range::-moz-range-thumb { width: 56px; height: 100%; border: 0; cursor: grab; }
.compare-range:active::-webkit-slider-thumb { cursor: grabbing; }

.compare figcaption { margin-top: 10px; font-size: 0.95rem; color: var(--muted); }

/* ---- tables ------------------------------------------------------------- */

.table-wrap { overflow-x: auto; margin: 8px 0 28px; }

table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  vertical-align: top;
  padding: 14px 18px 14px 0;
  border-top: 1px solid var(--line);
}
tbody tr:last-child th,
tbody tr:last-child td { border-bottom: 1px solid var(--line); }

thead th {
  border-top: 0;
  padding-top: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.sends td:first-child { width: 36%; font-weight: 600; }

.downloads th { width: 30%; font-weight: 600; }
.downloads td { padding-right: 0; }

.downloads tr.yours th,
.downloads tr.yours td { background: var(--accent-soft); }
.downloads tr.yours th { padding-left: 14px; }
.downloads tr.yours th::after {
  content: "This device";
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}

.dl {
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
}
.dl:hover { border-color: var(--accent); color: var(--accent); }

.note { margin: 2px 0 0; font-size: 0.95rem; color: var(--muted); max-width: 34em; }

.later th, .later .note { color: var(--muted); font-weight: 500; }

/* ---- who makes it ------------------------------------------------------- */

.note-from { max-width: var(--measure); font-size: 1.2rem; }

.signing {
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  color: var(--muted);
}
.signing h3 { color: var(--ink); }
.signing p { max-width: 42em; }

.roles {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 20px;
  margin: 0 0 1em;
}
.roles dd { margin: 0; }

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

.foot {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px clamp(22px, 4vw, 32px) 40px;
  font-size: 0.95rem;
  color: var(--muted);
}
.foot p { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }

/* ---- small screens ------------------------------------------------------ */

@media (max-width: 720px) {
  body { font-size: 1.0625rem; }
  .wide-only { display: none; }
  .lead, .note-from { font-size: 1.1rem; }
  .tools { grid-template-columns: 1fr; gap: 4px; }
  .tools dd { margin-bottom: 18px; }
  .sends td:first-child { width: 42%; }
  .downloads th, .downloads td { display: block; width: auto; border: 0; padding: 0; }
  .downloads tr { display: block; padding: 16px 0; border-top: 1px solid var(--line); }
  .downloads tr:last-child { border-bottom: 1px solid var(--line); }
  .downloads th { margin-bottom: 8px; }
  .downloads tr.yours { padding: 16px 14px; margin: 0 -14px; background: var(--accent-soft); }
  .downloads tr.yours th, .downloads tr.yours td { background: none; padding-left: 0; }
  .shot video { border-radius: 6px; }
}

@media (max-width: 440px) {
  .demo-price { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-word.typing::after { animation: none; }
  html { scroll-behavior: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
