/* Pattern Studio website. Same look as the landing page: a green cutting mat for headers, tracing paper below. */
:root {
  --mat: #1d4f44; --mat-line: rgba(232, 244, 236, 0.13); --mat-line-strong: rgba(232, 244, 236, 0.26);
  --paper: #f5f7f3; --surface: #ffffff; --ink: #14211d; --muted: #52615b; --rule: #d7ded9; --field: #ffffff;
  --chalk: #f2c94c; --chalk-ink: #1d1a08; --seam: #d0532e; --on-mat: #eef6f0; --on-mat-muted: #b4cbc1;
  --ok: #1f7a4d; --ok-bg: #e3f3ea; --bad: #b3261e; --bad-bg: #fbe9e7; --info-bg: #eef3f8;
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --f-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #111816; --surface: #18211e; --ink: #e6eeea; --muted: #9db0a8; --rule: #2a3733; --mat: #163f36; --field: #121a17;
  --ok: #6fd3a0; --ok-bg: #12301f; --bad: #ff8a80; --bad-bg: #3a1714; --info-bg: #17232b; color-scheme: dark;
} }
:root[data-theme="dark"] { --paper: #111816; --surface: #18211e; --ink: #e6eeea; --muted: #9db0a8; --rule: #2a3733; --mat: #163f36; --field: #121a17;
  --ok: #6fd3a0; --ok-bg: #12301f; --bad: #ff8a80; --bad-bg: #3a1714; --info-bg: #17232b; color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--f-body); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; }
img, svg { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap.narrow { max-width: 760px; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; line-height: 1.12; }
.label { font: 500 12px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
:focus-visible { outline: 2px solid var(--chalk); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--chalk); color: var(--chalk-ink); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* Mat header */
.mat { background-color: var(--mat); color: var(--on-mat);
  background-image: linear-gradient(var(--mat-line-strong) 1px, transparent 1px), linear-gradient(90deg, var(--mat-line-strong) 1px, transparent 1px),
    linear-gradient(var(--mat-line) 1px, transparent 1px), linear-gradient(90deg, var(--mat-line) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px; background-position: -1px -1px; }
nav.top { display: flex; align-items: center; gap: 16px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 19px/1 var(--f-display); text-decoration: none; white-space: nowrap; }
.brand svg, .brand img { width: 28px; height: 28px; flex: none; }
nav.top .links { margin-left: auto; display: flex; gap: 18px; align-items: center; font-size: 14.5px; }
nav.top .links > a:not(.btn) { text-decoration: none; color: var(--on-mat); font-weight: 600; }
nav.top .links > a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }
nav.top .links > a:not(.btn):hover, nav.top .links > a[aria-current="page"] { color: var(--on-mat); }
.page-head { padding-block: 28px 40px; }
.page-head h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -0.02em; }
.page-head p { color: var(--on-mat-muted); margin: 12px 0 0; max-width: 40em; font-size: 17.5px; }

/* Account menu in the header */
.acct { position: relative; }
.acct > button { display: inline-flex; align-items: center; gap: 8px; background: rgba(238, 246, 240, 0.12); color: var(--on-mat); border: 2px solid rgba(238, 246, 240, 0.7); border-radius: 999px; padding: 4px 12px 4px 4px; font: 600 14px/1 var(--f-body); cursor: pointer; }
.acct .av { width: 26px; height: 26px; border-radius: 50%; background: var(--chalk); color: var(--chalk-ink); display: grid; place-items: center; font: 700 13px/1 var(--f-display); }
.acct .pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 6px; z-index: 40; }
.acct .pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; font-size: 13.5px; }
.acct .pop .who b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; }
.acct .pop a, .acct .pop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; text-decoration: none; background: none; border: 0; color: inherit; font: 14.5px var(--f-body); cursor: pointer; }
.acct .pop a:hover, .acct .pop button:hover { background: var(--paper); }
.plan-badge { display: inline-block; font: 600 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; padding: 4px 7px; border-radius: 4px; background: var(--chalk); color: var(--chalk-ink); vertical-align: middle; }
.plan-badge.free { background: var(--rule); color: var(--ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 6px; padding: 10px 18px; font: 600 15px/1.1 var(--f-body); text-decoration: none; border: 1.5px solid transparent; cursor: pointer; background: none; color: inherit; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.chalk { background: var(--chalk); color: var(--chalk-ink); }
.btn.chalk:hover:not(:disabled) { filter: brightness(1.05); }
.btn.ink { background: var(--ink); color: var(--paper); }
.btn.line { border-color: var(--rule); color: var(--ink); background: var(--surface); }
.btn.line:hover:not(:disabled) { border-color: var(--muted); }
.btn.ghost { border: 2px solid rgba(238, 246, 240, 0.85); color: var(--on-mat); background: rgba(238, 246, 240, 0.1); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); }
.btn.ghost:hover { border-color: var(--on-mat); background: rgba(238, 246, 240, 0.2); }
.btn.light { background: var(--on-mat); color: var(--mat); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22); }
.btn.light:hover:not(:disabled) { background: #fff; }
.btn.chalk { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

/* Content */
section.band { padding-block: 56px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 24px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.prose { max-width: 46em; }
.prose h2 { font-size: 24px; margin: 36px 0 10px; }
.prose h3 { font-size: 18px; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.prose .muted { color: var(--muted); }

/* Forms */
.auth { display: grid; place-items: start center; padding-block: 48px 72px; }
.auth .card { width: 100%; max-width: 440px; padding: 32px; }
.auth h1 { font-size: 30px; margin-bottom: 6px; }
.auth .sub { color: var(--muted); margin: 0 0 22px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: 14px; }
.field small { color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; font: 16px var(--f-body); color: var(--ink); background: var(--field); border: 1.5px solid var(--rule); border-radius: 8px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
textarea { min-height: 140px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; margin-bottom: 12px; }
.check input { margin-top: 4px; width: 16px; height: 16px; flex: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.alt { margin-top: 18px; font-size: 14.5px; color: var(--muted); text-align: center; }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; font: 600 13px var(--f-body); color: var(--muted); cursor: pointer; padding: 6px; }
.meter { height: 4px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.msg { border-radius: 8px; padding: 12px 14px; font-size: 14.5px; margin-bottom: 16px; }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.bad { background: var(--bad-bg); color: var(--bad); }
.msg.info { background: var(--info-bg); }

/* Pricing */
.toggle { display: inline-flex; border: 1.5px solid var(--rule); border-radius: 999px; padding: 3px; background: var(--surface); }
.toggle button { border: 0; background: none; padding: 8px 16px; border-radius: 999px; font: 600 14px var(--f-body); color: var(--muted); cursor: pointer; }
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.save { font: 500 12px var(--f-mono); color: var(--seam); margin-left: 6px; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.plan { border: 1px solid var(--rule); border-radius: 12px; padding: 28px; background: var(--surface); display: grid; gap: 14px; align-content: start; position: relative; }
.plan.featured { border: 2px solid var(--ink); }
.plan .tag { position: absolute; top: -12px; left: 24px; background: var(--chalk); color: var(--chalk-ink); font: 600 12px/1 var(--f-mono); padding: 6px 8px; border-radius: 4px; }
.plan h3 { font-size: 22px; }
.plan .price { font: 700 42px/1 var(--f-display); }
.plan .price small { font: 400 15px var(--f-body); color: var(--muted); }
.plan .per { font-size: 13.5px; color: var(--muted); min-height: 1.4em; }
.plan ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; color: var(--ink); font-size: 15px; }
.plan li { display: flex; gap: 8px; }
.plan li::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 5px; border-radius: 50%; background: var(--ok-bg); box-shadow: inset 0 0 0 4px var(--ok); }
table.compare { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
table.compare th, table.compare td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: center; }
table.compare th:first-child, table.compare td:first-child { text-align: left; }
table.compare thead th { font-family: var(--f-display); font-size: 16px; }
.yes { color: var(--ok); font-weight: 700; }
.tablewrap { overflow-x: auto; }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 18px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.proj { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; display: grid; }
.proj .thumb { aspect-ratio: 4 / 3; background: var(--paper); display: grid; place-items: center; border-bottom: 1px solid var(--rule); text-decoration: none; }
.proj .thumb img { width: 100%; height: 100%; object-fit: cover; }
.proj .thumb svg { width: 40%; opacity: .5; }
.proj .body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.proj .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj .meta { font-size: 13px; color: var(--muted); }
.proj .acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.usage { display: grid; gap: 6px; min-width: 220px; }
.usage .bar { height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.usage .bar i { display: block; height: 100%; background: var(--ink); }
.empty { text-align: center; padding: 48px 16px; border: 1.5px dashed var(--rule); border-radius: 12px; color: var(--muted); }

/* Account */
.acc-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.acc-nav { position: sticky; top: 16px; display: grid; gap: 2px; }
.acc-nav a { padding: 8px 12px; border-radius: 6px; text-decoration: none; color: var(--muted); }
.acc-nav a:hover { background: var(--surface); color: var(--ink); }
.acc-sec { scroll-margin-top: 16px; }
.acc-sec h2 { font-size: 22px; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 16px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.danger-zone { border-color: var(--bad); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(10, 16, 14, .55); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal .card { width: 100%; max-width: 440px; }
.modal h2 { font-size: 22px; margin-bottom: 8px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; font-size: 14.5px; z-index: 70; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }

/* Cookie note */
.cookie { position: fixed; right: 16px; bottom: 16px; max-width: 360px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; font-size: 14px; z-index: 55; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.cookie p { margin: 0 0 10px; }

/* Footer */
footer.site { border-top: 1px solid var(--rule); padding-block: 36px 28px; font-size: 14px; color: var(--muted); margin-top: 32px; }
footer.site .cols { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 24px; }
footer.site h4 { font: 600 13px var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin: 0 0 10px; }
footer.site ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
footer.site a { text-decoration: none; }
footer.site a:hover { color: var(--ink); text-decoration: underline; }
footer.site .base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--rule); }
.theme-btn { background: none; border: 1px solid var(--rule); border-radius: 6px; padding: 4px 10px; color: inherit; font: 13px var(--f-body); cursor: pointer; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

@media (max-width: 900px) {
  .plans { grid-template-columns: 1fr; }
  .acc-grid { grid-template-columns: 1fr; }
  .acc-nav { position: static; display: flex; flex-wrap: wrap; }
  footer.site .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  nav.top .links .hide-sm { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 8px; }
  .auth .card { padding: 22px; }
}
