/*
Direction (unslop)
Product.   Production software for a screen-print and embroidery shop, quote to paid invoice.
Character. Inky, exact, shop-floor warm.
World.     Plastisol ink, mesh screens on aluminium frames, registration marks, job tickets on a board.
Moments.   (1) Hero: the Job Board is pulled onto a drawn screen frame by a squeegee, once.
           (2) Flow strip: seven stages as job-ticket chips in the app's own stage colours.
Signature. The registration mark (circle with crosshair): logo, frame corners, favicon. Nowhere else.
Rules.     Light only. Warm neutral ramp, one red accent. No gradients with hue, glows, glass, blobs.
           Weights 400-600, sentence case, 4px spacing scale, one easing curve, transform/opacity only.
*/
@property --n { syntax: '<integer>'; inherits: false; initial-value: 30; }

:root {
  --bg: #f7f4ee; --card: #fdfbf7; --raised: #efe9df;
  --ink: #1f1b16; --ink-2: #5e554a; --ink-3: #6a6155;
  --line: rgb(31 27 22 / 0.08); --frame: rgb(31 27 22 / 0.22);
  --accent: #b3261e; --accent-deep: #7d1a15;
  --art-bg: #fdf0b8; --art-ink: #5c4600;
  --blanks-bg: #dce9fb; --blanks-ink: #1d4a8a;
  --done-bg: #d5f0d8; --done-ink: #1b5e2c;
  --dtf-bg: #fde3d3; --dtf-ink: #7a3514;
  --ease: cubic-bezier(.2,.7,.2,1); --fast: 160ms; --enter: 600ms;
  --shadow: 0 1px 2px rgb(31 27 22 / .06), 0 12px 32px rgb(31 27 22 / .08);
  --sec: 128px;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, figure { margin: 0; }
ol { padding: 0; list-style: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* header */
.top { display: flex; align-items: center; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 20px; letter-spacing: -0.01em; margin-right: auto; }
.brand svg { width: 22px; height: 22px; color: var(--accent); }
.nav { display: flex; gap: 24px; font-size: 16px; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 0; transition: color var(--fast) var(--ease); }
.nav a:hover { color: var(--ink); }
.tlink { color: var(--ink-2); font-size: 16px; text-decoration: underline; text-decoration-color: var(--frame); text-underline-offset: 4px; display: inline-flex; align-items: center; min-height: 44px; transition: color var(--fast) var(--ease); }
.tlink:hover { color: var(--accent-deep); text-decoration-color: currentColor; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 10px; font: 500 16px/1 var(--sans); text-decoration: none; border: 1px solid var(--frame); background: transparent; color: var(--ink); transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease); }
.btn:hover { background: var(--raised); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.lg { min-height: 48px; padding: 0 24px; }

/* hero */
.hero { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: center; padding-top: 64px; }
.hero-text { grid-column: 1 / span 5; }
.hero-visual { grid-column: 6 / -1; }
h1 { font-weight: 500; font-size: clamp(36px, 4.6vw, 60px); line-height: 1.06; letter-spacing: -0.02em; text-wrap: balance; }
.lede { margin-top: 24px; color: var(--ink-2); max-width: 34em; }
.cta { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 40px; }
.alt { margin-top: 16px; font-size: 16px; color: var(--ink-2); }
.alt a { text-decoration-color: var(--frame); text-underline-offset: 4px; }
.alt a:hover { color: var(--accent-deep); }

/* screen-print frame */
.frame { position: relative; margin: 0; padding: 12px; border: 1px solid var(--frame); border-radius: 14px; box-shadow: var(--shadow);
  background-color: var(--raised);
  background-image: repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 6px), repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 6px); }
.shot { position: relative; overflow: hidden; border-radius: 10px; background: var(--card); }
.shot img { width: 100%; }
.frame figcaption { padding: 12px 4px 0; }
.reg { position: absolute; width: 20px; height: 20px; color: var(--ink-3); stroke-dasharray: 1; stroke-dashoffset: 0; background: var(--bg); border-radius: 50%; }
.reg.tl { top: -10px; left: -10px; } .reg.tr { top: -10px; right: -10px; }
.reg.bl { bottom: -10px; left: -10px; } .reg.br { bottom: -10px; right: -10px; }
.pull { display: none; }

/* sections */
.section { padding-top: var(--sec); }
h2 { font-weight: 500; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.12; letter-spacing: -0.015em; margin-bottom: 48px; text-wrap: balance; }
h3 { font-weight: 500; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }

/* flow strip */
.flow { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.chip { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 10px; background: var(--raised); color: var(--ink); border: 1px solid var(--line); }
.chip .mono { color: inherit; }
.chip b { font-weight: 600; font-size: 18px; }
.chip span:last-child { font-size: 14px; line-height: 1.45; }
.chip.art { background: var(--art-bg); color: var(--art-ink); }
.chip.blanks { background: var(--blanks-bg); color: var(--blanks-ink); }
.chip.floor { background: var(--dtf-bg); color: var(--dtf-ink); }
.chip.done { background: var(--done-bg); color: var(--done-ink); }
.track { display: none; }

/* screens */
.row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: center; }
.row + .row { margin-top: 112px; }
.row .frame, .row .shot-wrap { grid-column: 1 / span 7; }
.row .copy { grid-column: 9 / -1; }
.row.flip .frame, .row.flip .shot-wrap { grid-column: 6 / -1; grid-row: 1; }
.row.flip .copy { grid-column: 1 / span 4; grid-row: 1; }
.row .copy p { margin-top: 16px; color: var(--ink-2); }
.row .copy .mono { margin-bottom: 12px; display: block; }
.shot-wrap { display: flex; justify-content: center; }
.frame.phone { width: 100%; max-width: 332px; }
.row .copy p.tally { display: flex; align-items: baseline; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink); }
.tally .n { font: 400 40px/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.tally .n::after { content: counter(n); counter-reset: n var(--n); }

/* two centers */
.doors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.door { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 32px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.door p { color: var(--ink-2); flex: 1; }
.door .btn { margin-top: 8px; }

/* built in calgary */
.built { max-width: 40em; }
.built p { color: var(--ink-2); }
.built p + p { margin-top: 16px; }

footer { margin-top: var(--sec); border-top: 1px solid var(--line); }
.foot { display: flex; flex-wrap: wrap; gap: 8px 32px; padding-top: 32px; padding-bottom: 32px; font-size: 14px; color: var(--ink-3); }
.foot nav { display: flex; gap: 24px; margin-left: auto; }
.foot a { color: var(--ink-2); }

/* tablet */
@media (max-width: 1099px) {
  .hero { padding-top: 40px; }
  .hero-text { grid-column: 1 / -1; }
  .hero-visual { grid-column: 1 / -1; margin-top: 24px; }
  .flow { grid-template-columns: repeat(4, 1fr); }
  .row .frame, .row .shot-wrap { grid-column: 1 / span 7; }
  .row .copy { grid-column: 8 / -1; }
  .row.flip .frame, .row.flip .shot-wrap { grid-column: 6 / -1; grid-row: 1; }
  .row.flip .copy { grid-column: 1 / span 5; grid-row: 1; }
}
/* phone */
@media (max-width: 767px) {
  :root { --sec: 64px; }
  body { font-size: 17px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .nav { display: none; }
  .top { gap: 8px; padding-top: 12px; padding-bottom: 4px; }
  .brand { font-size: 18px; }
  .hero { padding-top: 16px; }
  h1 { font-size: 36px; }
  .cta .btn.lg { width: 100%; }
  .btn.lg { padding: 0 20px; font-size: 16px; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .row { gap: 24px; }
  .row + .row { margin-top: 64px; }
  .row .frame, .row .shot-wrap, .row.flip .frame, .row.flip .shot-wrap { grid-column: 1 / -1; grid-row: 1; }
  .row .copy, .row.flip .copy { grid-column: 1 / -1; grid-row: 2; }
  h2 { margin-bottom: 32px; }
  .doors { grid-template-columns: 1fr; }
  .door { padding: 24px; }
  .foot nav { margin-left: 0; }
  .reg.tl, .reg.bl { left: -6px; } .reg.tr, .reg.br { right: -6px; }
}
@media (min-width: 1100px) {
  .flow { grid-template-columns: repeat(7, 1fr); }
  .track { display: block; position: relative; height: 10px; margin-top: 24px; overflow: hidden; }
  .track::before { content: ''; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: var(--frame); }
  .runner { position: absolute; inset: 0; }
  .runner::after { content: ''; position: absolute; right: calc(100% / 14 - 5px); top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
}

/* motion: everything here is optional; without it the page is in its final state */
@media (prefers-reduced-motion: no-preference) {
  .pull { display: block; position: absolute; inset: 0; z-index: 2; background: var(--raised); animation: pull 900ms var(--ease) 200ms both; }
  .pull::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--ink); }
  @keyframes pull { from { transform: translateX(0); } to { transform: translateX(101%); } }
  .hero .reg { animation: draw 500ms var(--ease) 1100ms backwards; }
  @keyframes draw { from { stroke-dashoffset: 1; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }

  @supports (animation-timeline: view()) {
    .rise { animation: rise var(--enter) var(--ease) both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
    @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
    .runner { animation: run linear both; animation-timeline: view(); animation-range: entry 10% cover 55%; }
    /* stops at the centre of each chip: translateX = (2i+1)/14 - 13/14 of the track width */
    @keyframes run {
      0%, 4%    { transform: translateX(-100%); }
      10%, 16%  { transform: translateX(-85.7%); }
      24%, 30%  { transform: translateX(-71.4%); }
      38%, 44%  { transform: translateX(-57.1%); }
      52%, 58%  { transform: translateX(-42.9%); }
      66%, 72%  { transform: translateX(-28.6%); }
      80%, 86%  { transform: translateX(-14.3%); }
      94%, 100% { transform: translateX(0); }
    }
    .tally .n { animation: count linear both; animation-timeline: view(); animation-range: entry 20% cover 45%; }
    @keyframes count { from { --n: 0; } to { --n: 30; } }
  }
}
