/* ==========================================================================
   CanvasAndCell — portfolio site
   Plain CSS. No build step, no imports, no external requests.
   Light + dark. Responsive from 390px up.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;

  --bg: #faf8f5;
  --bg-2: #f2eee7;
  --surface: #ffffff;
  --surface-2: #f6f2eb;
  --ink: #1c1a17;
  --ink-2: #3d382f;
  --muted: #5f594f;
  --faint: #857e71;
  --line: #e0d9cd;
  --line-strong: #cdc3b2;
  --accent: #8a5a12;
  --accent-hover: #6f4809;
  --accent-ink: #ffffff;
  --accent-wash: #f7efe0;
  --good: #2f6a3c;
  --good-wash: #eaf4ec;
  --bad: #9a2f26;
  --bad-wash: #fbeceb;

  --shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 6px 18px rgba(60, 45, 20, .07);
  --shadow-lift: 0 2px 6px rgba(60, 45, 20, .08), 0 18px 40px rgba(60, 45, 20, .12);
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1140px;
  --wrap-narrow: 760px;
}

html[data-theme="dark"] {
  --bg: #131210;
  --bg-2: #191713;
  --surface: #1d1a16;
  --surface-2: #24211b;
  --ink: #ece7dd;
  --ink-2: #d3ccbe;
  --muted: #a49b8b;
  --faint: #8a8171;
  --line: #322e27;
  --line-strong: #454036;
  --accent: #d9a441;
  --accent-hover: #ecbb60;
  --accent-ink: #1a1409;
  --accent-wash: #2a2318;
  --good: #7fbb8a;
  --good-wash: #1c2a1f;
  --bad: #e08a80;
  --bad-wash: #2c1c1a;

  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 6px 18px rgba(0, 0, 0, .4);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 40px rgba(0, 0, 0, .55);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #131210;
    --bg-2: #191713;
    --surface: #1d1a16;
    --surface-2: #24211b;
    --ink: #ece7dd;
    --ink-2: #d3ccbe;
    --muted: #a49b8b;
    --faint: #8a8171;
    --line: #322e27;
    --line-strong: #454036;
    --accent: #d9a441;
    --accent-hover: #ecbb60;
    --accent-ink: #1a1409;
    --accent-wash: #2a2318;
    --good: #7fbb8a;
    --good-wash: #1c2a1f;
    --bad: #e08a80;
    --bad-wash: #2c1c1a;

    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 6px 18px rgba(0, 0, 0, .4);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 40px rgba(0, 0, 0, .55);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0 0 .5em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 6.2vw, 3.45rem); }
h2 { font-size: clamp(1.6rem, 4.2vw, 2.3rem); }
h3 { font-size: clamp(1.18rem, 2.6vw, 1.4rem); }
h4 { font-size: 1.02rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

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

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

hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

code, kbd, samp { font-family: var(--mono); font-size: .89em; }

/* ---------------------------------------------------------------- layout */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: var(--wrap-narrow); }

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--tight { padding: clamp(2.2rem, 5vw, 3.5rem) 0; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--line); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 12px; color: var(--accent-ink); }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(2px)) { .site-header { background: var(--bg); } }

.site-header__inner {
  display: flex; align-items: center; gap: 12px;
  min-height: 62px; flex-wrap: wrap; padding-block: 8px;
}

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-size: 1.14rem; font-weight: 600;
  color: var(--ink); text-decoration: none; letter-spacing: -.01em;
  margin-right: auto;
}
.brand:hover { color: var(--ink); }
.brand__mark { flex: none; }
.brand__mark rect, .brand__mark path, .brand__mark line { vector-effect: non-scaling-stroke; }

.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav a {
  display: inline-block;
  padding: .42rem .62rem; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none;
  font-size: .95rem; font-weight: 550;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-wash); }

@media (max-width: 560px) {
  .site-header__inner { row-gap: 2px; padding-block: 6px; min-height: 0; }
  .brand { width: 100%; margin-right: 0; font-size: 1.06rem; }
  .nav { margin-right: auto; }
  .nav a { padding: .38rem .5rem; font-size: .92rem; }
}
@media (max-width: 380px) {
  .nav a { padding: .38rem .34rem; font-size: .88rem; }
}

.theme-toggle {
  flex: none; margin-left: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--ink-2); cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  html:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .72rem 1.25rem;
  font: inherit; font-size: .97rem; font-weight: 600;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  text-decoration: none; cursor: pointer; text-align: center;
  transition: background .14s, border-color .14s, color .14s;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--accent); }
.btn--small { padding: .5rem .85rem; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: default; }

.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

/* ---------------------------------------------------------------- type helpers */
.eyebrow {
  font-family: var(--sans); font-size: .78rem; font-weight: 700;
  letter-spacing: .11em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .9rem;
}
.lede { font-size: clamp(1.06rem, 2.2vw, 1.22rem); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }

.section-head { max-width: 68ch; margin-bottom: 2.4rem; }
.section-head p { color: var(--muted); }

/* ---------------------------------------------------------------- hero */
.hero { padding: clamp(2.8rem, 7vw, 5rem) 0 clamp(2rem, 4vw, 3rem); }
.hero h1 { max-width: 16ch; }
.hero .lede { margin-top: 1.1rem; }

.hero-facts {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.hero-facts li {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: .34rem .8rem;
  font-size: .87rem; color: var(--ink-2);
}

/* screenshot strip */
.shots {
  display: grid; gap: 16px; margin-top: 2.6rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.shot {
  margin: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow);
}
.shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top center; }
.shot figcaption {
  padding: .7rem .9rem .85rem; font-size: .86rem; color: var(--muted);
  border-top: 1px solid var(--line);
}
.shot figcaption b { color: var(--ink); font-weight: 650; }

/* ---------------------------------------------------------------- cards */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .45rem; }
.card p { color: var(--muted); font-size: .96rem; }
.card__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-wash); color: var(--accent);
  font-family: var(--mono); font-size: .85rem; font-weight: 700;
  margin-bottom: .85rem;
}

.service-card { display: flex; flex-direction: column; }
.service-card ul { margin: .9rem 0 0; padding-left: 1.15em; color: var(--muted); font-size: .93rem; }
.service-card li { margin-bottom: .3rem; }
.service-card .btn { margin-top: auto; align-self: flex-start; }
.service-card > * + .btn { margin-top: 1.3rem; }

/* ---------------------------------------------------------------- work page */
.work-line { padding-top: clamp(2.4rem, 5vw, 3.6rem); }
.work-line + .work-line { border-top: 1px solid var(--line); }

.project {
  display: grid; gap: 22px; align-items: start;
  margin-bottom: 2.6rem;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.project--flip .project__media { order: 2; }
@media (max-width: 780px) {
  .project { grid-template-columns: 1fr; }
  .project--flip .project__media { order: 0; }
}

.project__media {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow);
}
.project__media img { width: 100%; }
.project__body h3 { margin-bottom: .3rem; }
.project__kind {
  font-size: .78rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .55rem;
}
.project__body p { font-size: .98rem; color: var(--ink-2); }
.project__hard {
  margin-top: 1rem; padding: .9rem 1rem;
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .93rem; color: var(--ink-2);
}
.project__hard b { color: var(--ink); }

.mini-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.mini {
  margin: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.mini img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top center; }
.mini figcaption { padding: .85rem 1rem 1rem; border-top: 1px solid var(--line); }
.mini figcaption strong { display: block; font-size: .98rem; margin-bottom: .2rem; }
.mini figcaption span { font-size: .88rem; color: var(--muted); }

/* video */
.clips { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.clip { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.clip video { width: 100%; background: #000; display: block; }
.clip figcaption { padding: .8rem 1rem .95rem; font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); }
.clip figcaption b { color: var(--ink); font-weight: 650; }

/* ---------------------------------------------------------------- demo callouts */
.demo-card {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.demo-card .tag {
  display: inline-block; align-self: flex-start;
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  background: var(--accent-wash); color: var(--accent);
  padding: .22rem .55rem; border-radius: 6px; margin-bottom: .9rem;
}
.demo-card p { color: var(--muted); font-size: .95rem; }
.demo-card .btn { margin-top: auto; align-self: flex-start; }
.demo-card > p + .btn { margin-top: 1.2rem; }

/* ---------------------------------------------------------------- lists */
.checks { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.checks li {
  position: relative; padding-left: 1.7rem; margin-bottom: .6rem;
  color: var(--ink-2); font-size: .97rem;
}
.checks li::before {
  content: ""; position: absolute; left: 0; top: .52em;
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--accent);
}

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li {
  counter-increment: s; position: relative;
  padding: 1.1rem 1.2rem 1.15rem 3.4rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.steps li::before {
  content: counter(s); position: absolute; left: 1.1rem; top: 1.1rem;
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--mono); font-size: .82rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps strong { display: block; margin-bottom: .2rem; }
.steps p { font-size: .94rem; color: var(--muted); margin: 0; }

/* definition-style price/faq list */
.faq { margin: 0; }
.faq dt { font-weight: 650; margin-top: 1.5rem; color: var(--ink); }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: .35rem 0 0; color: var(--muted); font-size: .97rem; }

/* ---------------------------------------------------------------- callout / placeholder */
.callout {
  background: var(--surface-2); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.25rem; font-size: .95rem; color: var(--ink-2);
}
.callout h3 { font-size: 1.05rem; font-family: var(--sans); font-weight: 700; margin-bottom: .35rem; }

.placeholder {
  font-family: var(--mono); font-size: .95em;
  background: var(--accent-wash); color: var(--accent);
  border: 1px dashed var(--accent); border-radius: 6px;
  padding: .1em .4em; word-break: break-all;
}

/* ---------------------------------------------------------------- forms */
.field { margin-bottom: 1.05rem; }
.field label, .field legend {
  display: block; font-size: .9rem; font-weight: 650;
  margin-bottom: .35rem; color: var(--ink);
}
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: .1rem; }

input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; font: inherit; font-size: .97rem;
  padding: .6rem .7rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
textarea { min-height: 110px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--accent); }

fieldset { border: 0; margin: 0 0 1.05rem; padding: 0; min-width: 0; }
legend { padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .48rem .75rem; font-size: .92rem; cursor: pointer;
  background: var(--surface); color: var(--ink-2);
}
.choice:hover { border-color: var(--accent); }
.choice input { accent-color: var(--accent); margin: 0; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 2.6rem 0 3rem;
  font-size: .92rem; color: var(--muted);
}
.site-footer__grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h4 { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: .6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .3rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer__base { margin-top: 2rem; padding-top: 1.3rem; border-top: 1px solid var(--line); font-size: .86rem; }

/* ---------------------------------------------------------------- CTA band */
.cta-band {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: clamp(1.6rem, 4vw, 2.6rem);
  box-shadow: var(--shadow);
}
.cta-band h2 { margin-bottom: .5rem; }
.cta-band p { color: var(--muted); max-width: 56ch; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; min-width: 460px; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 650; color: var(--ink); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- utilities */
.grid--top { align-items: start; }
.stack > * + * { margin-top: 1.1rem; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-0 { margin-bottom: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
