/* 2way user manual. Colours and type follow the 2way brandbook (2way orange):
   Afacad Flux 400/500/700, primary #FF6A00, text #1A1A1A, canvas #F1F1F1. */

@font-face {
  font-family: "Afacad Flux";
  src: url("fonts/afacad-flux-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 1000;
  font-display: swap;
  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: "Afacad Flux";
  src: url("fonts/afacad-flux-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 1000;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --primary: #ff6a00;
  --primary-light: #ffe9d9;
  --text: #1a1a1a;
  --text-2: #666666;
  --border: #dddddd;
  --canvas: #f1f1f1;
  --surface: #ffffff;
  --success: #22c55e;
  --success-light: #dcfce7;
  --success-dark: #15803d;
  --danger-light: #ffeded;
  --danger-dark: #cc3232;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: "Afacad Flux", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.5;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
b { font-weight: 600; }

h1, h2, h3 { font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(34px, 5vw, 52px); }
h2 { font-size: 28px; margin: 48px 0 14px; scroll-margin-top: 90px; }
h3 { font-size: 20px; margin-bottom: 6px; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 6px; }
li::marker { color: var(--primary); font-weight: 700; }

/* Highlight: the brandbook's orange block behind one key word. */
mark {
  background: var(--primary);
  color: var(--text);
  padding: 0 0.12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.lead { font-size: 22px; color: var(--text); max-width: 760px; margin-top: 16px; }
.eyebrow { color: var(--primary); font-weight: 700; font-size: 18px; letter-spacing: 0.08em; margin: 0 0 8px; }
.logo { width: 92px; height: auto; display: block; }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.top__title { font-weight: 500; color: var(--text-2); border-left: 1px solid var(--border); padding-left: 16px; }
.top__links { margin-left: auto; display: flex; gap: 20px; font-weight: 500; }
.top__links a { text-decoration: none; }
.top__links a:hover { color: var(--primary); }

/* Index */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.hero { padding: 72px 0 40px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; padding-bottom: 72px; }
.topic-card {
  display: block; text-decoration: none;
  background: var(--surface); border-radius: var(--radius); padding: 24px 24px 20px;
  border: 1px solid transparent; transition: border-color .15s, transform .15s;
}
.topic-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.topic-card__n { color: var(--primary); font-weight: 700; }
.topic-card h2 { font-size: 24px; margin: 6px 0 8px; }
.topic-card p { color: var(--text-2); margin: 0; font-size: 17px; }

.choose { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.choose__logo .logo { width: 160px; }
.choose__links { display: flex; gap: 14px; }
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 10px;
  background: var(--primary); color: #fff; font-weight: 600; text-decoration: none;
}

/* Topic page */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 48px; max-width: 1280px; margin: 0 auto; padding: 0 28px; }
.side { position: sticky; top: 70px; align-self: start; padding: 40px 0; max-height: calc(100vh - 70px); overflow: auto; }
.side ol { list-style: none; padding: 0; margin: 0; counter-reset: t; }
.side li { counter-increment: t; margin: 0; }
.side a {
  display: flex; gap: 10px; padding: 8px 12px; border-radius: 10px;
  text-decoration: none; color: var(--text-2); font-size: 16px; line-height: 1.3;
}
.side a::before { content: counter(t, decimal-leading-zero); color: var(--primary); font-weight: 700; }
.side a:hover { background: var(--surface); color: var(--text); }
.side .is-current a { background: var(--surface); color: var(--text); font-weight: 600; }

.article { padding: 48px 0 72px; min-width: 0; max-width: 900px; }
.toc {
  margin: 28px 0 8px; padding: 18px 22px;
  background: var(--surface); border-radius: var(--radius);
}
.toc b { display: block; color: var(--text-2); font-weight: 500; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.toc li { margin: 0; }
.toc a { text-decoration: none; border-bottom: 2px solid var(--primary-light); }
.toc a:hover { border-color: var(--primary); }

/* Action flow: numbered step boxes joined by arrows. */
.flow {
  list-style: none; padding: 0; margin: 20px 0 26px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
  counter-reset: none;
}
.flow__step {
  position: relative; margin: 0;
  background: var(--surface); border-radius: 12px; padding: 14px 14px 12px;
  border-top: 4px solid var(--primary);
  display: flex; flex-direction: column; gap: 8px;
}
.flow__step:not(:last-child)::after {
  content: ""; position: absolute; right: -11px; top: 22px; z-index: 1;
  width: 10px; height: 10px; border-top: 3px solid var(--primary); border-right: 3px solid var(--primary);
  transform: rotate(45deg);
}
.flow__n {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}
.flow__step b { display: block; font-size: 17px; line-height: 1.2; }
.flow__step p { margin: 4px 0 0; font-size: 15px; color: var(--text-2); line-height: 1.35; }

/* Screenshots */
.shot { margin: 22px 0 28px; }
.shot img { border-radius: 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 10px 30px rgba(26,26,26,.07); }
.shot figcaption { font-size: 15px; color: var(--text-2); margin-top: 8px; }

/* Callouts */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 20px 0; padding: 16px 18px; border-radius: 12px;
}
.callout p { margin: 0; }
.callout__label {
  flex: none; font-weight: 700; font-size: 13px; letter-spacing: .06em;
  border-radius: 6px; padding: 3px 8px; margin-top: 2px;
}
.callout--tip { background: var(--primary-light); }
.callout--tip .callout__label { background: var(--primary); color: #fff; }
.callout--note { background: var(--surface); border: 1px solid var(--border); }
.callout--note .callout__label { background: var(--text); color: #fff; min-width: 24px; text-align: center; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 18px 0 24px; }
.card { background: var(--surface); border-radius: 12px; padding: 18px; }
.card h3 { font-size: 19px; }
.card h3::before { content: ""; display: block; width: 26px; height: 4px; background: var(--primary); border-radius: 2px; margin-bottom: 10px; }
.card p { margin: 0; color: var(--text-2); font-size: 16px; }

/* Tables */
.table { overflow-x: auto; margin: 16px 0 24px; background: var(--surface); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 17px; }
th { text-align: left; font-weight: 500; color: var(--text-2); font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--canvas); vertical-align: top; }
tr:last-child td { border-bottom: 0; }

/* Pager and footer */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; }
.pager a {
  flex: 1; max-width: 48%; text-decoration: none; background: var(--surface); border-radius: 12px; padding: 14px 18px;
  font-weight: 600; border: 1px solid transparent;
}
.pager a:hover { border-color: var(--primary); }
.pager small { display: block; color: var(--text-2); font-weight: 400; }
.pager__next { margin-left: auto; text-align: right; }
.foot { text-align: center; color: var(--text-2); font-size: 14px; padding: 28px; border-top: 1px solid var(--border); background: var(--surface); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .side { display: none; }
  .top { padding: 12px 16px; flex-wrap: wrap; }
  .top__title { display: none; }
  .top__links { gap: 14px; font-size: 16px; }
  .wrap, .layout { padding: 0 16px; }
  .flow__step:not(:last-child)::after { display: none; }
  body { font-size: 17px; }
}

/* ---------------------------------------------------------------- print (PDF) */
@page { size: A4; margin: 16mm 15mm 18mm; }
body.print { background: #fff; font-size: 11.5pt; }
.print h1 { font-size: 30pt; }
.print h2 { font-size: 17pt; margin: 22px 0 8px; break-after: avoid; }
.print .lead { font-size: 13.5pt; }
.print .chapter { break-before: page; }
.print .flow, .print .shot, .print .callout, .print .cards, .print .table, .print tr { break-inside: avoid; }
.print .flow { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 9px; }
.print .flow__step { background: var(--canvas); padding: 10px 10px 9px; }
.print .flow__step b { font-size: 11pt; }
.print .flow__step p { font-size: 9.5pt; }
.print .flow__step:not(:last-child)::after { right: -8px; top: 18px; width: 7px; height: 7px; border-width: 2px; }
.print .flow__n { width: 22px; height: 22px; font-size: 10pt; }
.print .shot { margin: 14px 0 18px; }
.print .shot img { box-shadow: none; max-height: 120mm; width: auto; margin: 0 auto; }
.print .shot figcaption { font-size: 9.5pt; text-align: center; }
.print .card, .print .table, .print .callout--note { background: var(--canvas); border: 0; }
.print table { font-size: 10.5pt; }
.print th, .print td { padding: 7px 10px; border-bottom-color: #fff; }
.print .card p { font-size: 10pt; }
.print .card h3 { font-size: 12pt; }

@page :first { margin: 0; }
.cover {
  height: 296mm; break-after: page; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--canvas); padding: 24mm 22mm;
}
.cover__logo .logo { width: 150px; }
.cover h1 { font-size: 54pt; }
.cover .lead { font-size: 18pt; max-width: 140mm; }
.cover__meta { color: var(--text-2); font-size: 11pt; margin: 0; }
.ptoc h1 { margin-bottom: 18px; }
.ptoc ol { list-style: none; padding: 0; }
.ptoc li { display: flex; gap: 16px; font-size: 15pt; padding: 9px 0; border-bottom: 1px solid var(--border); }
.ptoc a { text-decoration: none; }
.ptoc__n { color: var(--primary); font-weight: 700; width: 28px; }

/* 404 */
.notfound { padding-top: 72px; padding-bottom: 72px; }
.notfound__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 36px; }
.notfound .card ol { margin: 10px 0 0; padding-left: 26px; }
.notfound .card li { margin-bottom: 4px; }
.notfound .card a { text-decoration: none; }
.notfound .card a:hover { color: var(--primary); }
