/* ==========================================================================
   Cobblewright — visual system
   Version 1.0 · September 2026
   This file is the reference implementation of the Cobblewright design
   language. The tokens below are intended to be reused in Cobblewright
   applications (web app shells, settings screens, help pages).
   ========================================================================== */

/* Inter — self-hosted (SIL Open Font License 1.1). No third-party requests. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
}

:root {
  /* Brand */
  --cw-teal:        #087C86;
  --cw-teal-deep:   #075C68;
  --cw-teal-dark:   #054A54;
  --cw-teal-tint:   #EEF5F6;

  /* Neutrals */
  --cw-charcoal:    #20272B;
  --cw-gray:        #626C72;
  --cw-gray-light:  #8A939A;
  --cw-soft:        #F5F7F8;
  --cw-white:       #FFFFFF;
  --cw-border:      #DDE3E6;
  --cw-border-soft: #E9EEF0;

  /* Status (used only for product status, never decoration) */
  --cw-status-bg:   #FBF2E3;
  --cw-status-fg:   #855417;
  --cw-status-line: #EBD8B6;

  /* Geometry */
  --cw-radius:      7px;
  --cw-radius-lg:   10px;
  --cw-maxw:        1120px;
  --cw-prose:       68ch;

  /* Type */
  --cw-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;
}

/* --------------------------------------------------------------- reset -- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cw-white);
  color: var(--cw-charcoal);
  font-family: var(--cw-font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.018em;
  color: var(--cw-charcoal);
}

h1 { font-size: clamp(2.05rem, 1.35rem + 2.5vw, 2.95rem); line-height: 1.14; }
h2 { font-size: clamp(1.55rem, 1.15rem + 1.4vw, 2.05rem); }
h3 { font-size: 1.14rem; letter-spacing: -0.01em; }
h4 { font-size: 1rem; letter-spacing: 0; }

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

a { color: var(--cw-teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

hr {
  border: 0;
  border-top: 1px solid var(--cw-border);
  margin: 40px 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--cw-teal-deep);
  color: #fff;
  padding: 12px 18px;
  z-index: 100;
  border-radius: 0 0 var(--cw-radius) 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------- layout --- */

.container {
  width: 100%;
  max-width: var(--cw-maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 76px 0; }
.section--tight { padding: 56px 0; }
.section--soft { background: var(--cw-soft); border-block: 1px solid var(--cw-border-soft); }
.section--teal { background: var(--cw-teal-deep); color: #fff; }
.section--teal h2, .section--teal h3 { color: #fff; }

.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head p {
  margin-top: 14px;
  color: var(--cw-gray);
  font-size: 1.06rem;
}
.section-head p:last-child { margin-bottom: 0; }

.lead {
  font-size: 1.13rem;
  color: var(--cw-gray);
  max-width: 60ch;
}

.rule {
  width: 44px;
  height: 3px;
  background: var(--cw-teal);
  border-radius: 2px;
  margin-bottom: 22px;
}

/* ---------------------------------------------------------- brand bar --- */

.topbar { height: 4px; background: var(--cw-teal); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--cw-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--cw-charcoal);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }

.nav { display: flex; align-items: center; gap: 6px; }

.nav a {
  display: inline-block;
  padding: 9px 13px;
  border-radius: var(--cw-radius);
  color: var(--cw-gray);
  font-size: 0.97rem;
  font-weight: 500;
}
.nav a:hover { color: var(--cw-charcoal); background: var(--cw-soft); text-decoration: none; }
.nav a.is-current {
  color: var(--cw-teal-deep);
  background: var(--cw-teal-tint);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  background: var(--cw-white);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  color: var(--cw-charcoal);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 8px 13px;
  cursor: pointer;
}
.nav-toggle svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: var(--cw-radius);
  border: 1px solid transparent;
  font-size: 0.99rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--cw-teal); color: #fff; }
.btn--primary:hover { background: var(--cw-teal-dark); }

.btn--secondary {
  background: var(--cw-white);
  border-color: var(--cw-border);
  color: var(--cw-charcoal);
}
.btn--secondary:hover { border-color: var(--cw-gray-light); background: var(--cw-soft); }

.btn--onteal { background: #fff; color: var(--cw-teal-deep); }
.btn--onteal:hover { background: #EAF3F4; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  color: var(--cw-teal-deep);
}
.textlink svg { width: 15px; height: 15px; }

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

.hero { padding: 84px 0 76px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.hero h1 { max-width: 16ch; }
.hero .lead { margin-top: 22px; font-size: 1.17rem; }

/* Company facts panel — real information, not decoration */
.facts {
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  overflow: hidden;
  background: var(--cw-white);
}
.facts-head {
  background: var(--cw-teal-deep);
  color: #fff;
  padding: 15px 22px;
  font-size: 0.99rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.facts dl { margin: 0; padding: 6px 22px 18px; }
.facts dt {
  margin-top: 15px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--cw-gray);
}
.facts dd {
  margin: 2px 0 0;
  font-size: 0.99rem;
  color: var(--cw-charcoal);
}
.facts dd a { color: var(--cw-teal-deep); }

/* --------------------------------------------------------------- grid --- */

.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--cw-white);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  padding: 28px 26px;
}
.card p {
  margin-top: 12px;
  color: var(--cw-gray);
  font-size: 0.99rem;
}
.card-icon {
  width: 28px;
  height: 28px;
  color: var(--cw-teal);
  margin-bottom: 16px;
}

/* Product cards */
.product {
  display: flex;
  flex-direction: column;
  background: var(--cw-white);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  padding: 28px 26px;
}
/* Status sits above the product name so it can never be missed
   and never competes with a wrapping title. */
.product-top {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 13px;
}
.product p {
  margin-top: 12px;
  color: var(--cw-gray);
  font-size: 0.99rem;
}
.product-meta {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--cw-border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.88rem;
  color: var(--cw-gray);
}
.product-meta span { display: inline-flex; gap: 6px; }
.product-meta b { font-weight: 500; color: var(--cw-charcoal); }
.product-foot { margin-top: auto; padding-top: 20px; }

.badge {
  flex: none;
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.badge--dev {
  background: var(--cw-status-bg);
  color: var(--cw-status-fg);
  border: 1px solid var(--cw-status-line);
}
.badge--available {
  background: var(--cw-teal-tint);
  color: var(--cw-teal-deep);
  border: 1px solid #C9DFE2;
}

/* Principles: a short definition list, not numbered steps */
.principles { display: grid; gap: 30px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.principle { border-top: 3px solid var(--cw-teal); padding-top: 18px; }
.principle p { margin-top: 10px; color: var(--cw-gray); font-size: 0.99rem; }

/* Statement block (institutional paragraphs) */
.statement {
  background: var(--cw-white);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  padding: 44px 46px;
  max-width: 74ch;
}
.statement p { color: var(--cw-gray); }
.statement p:first-of-type {
  color: var(--cw-charcoal);
  font-size: 1.1rem;
}

/* Closing band */
.band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  flex-wrap: wrap;
}
.band-inner p { color: #D3E6E9; margin-top: 12px; max-width: 56ch; }

/* ---------------------------------------------------------- page head --- */

.pagehead {
  background: var(--cw-soft);
  border-bottom: 1px solid var(--cw-border-soft);
  padding: 64px 0 60px;
}
.pagehead .lead { margin-top: 18px; }

/* -------------------------------------------------------------- prose --- */

.prose { max-width: var(--cw-prose); }
.prose h2 {
  font-size: 1.3rem;
  margin-top: 46px;
  margin-bottom: 14px;
  padding-top: 4px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 30px; margin-bottom: 8px; font-size: 1.04rem; }
.prose p, .prose li { color: var(--cw-gray); }
.prose strong { color: var(--cw-charcoal); font-weight: 600; }
.prose ul { margin: 0 0 1.15em; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.meta-note {
  font-size: 0.92rem;
  color: var(--cw-gray);
  border: 1px solid var(--cw-border);
  border-left: 3px solid var(--cw-teal);
  border-radius: 0 var(--cw-radius) var(--cw-radius) 0;
  background: var(--cw-soft);
  padding: 16px 20px;
  margin-bottom: 34px;
}

/* Contact / info blocks */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  padding: 10px 30px 28px;
  max-width: 760px;
}
.info-grid dt {
  margin-top: 20px;
  font-size: 0.84rem;
  color: var(--cw-gray);
  font-weight: 500;
}
.info-grid dd { margin: 3px 0 0; font-size: 1rem; }

.contact-card {
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  overflow: hidden;
  max-width: 640px;
}
.contact-card-head {
  background: var(--cw-teal-deep);
  color: #fff;
  padding: 16px 26px;
  font-weight: 600;
}
.contact-card-body { padding: 26px; }
.contact-email {
  display: inline-block;
  font-size: 1.24rem;
  font-weight: 600;
  color: var(--cw-teal-deep);
  letter-spacing: -0.01em;
  word-break: break-word;
}
.contact-card-body p { margin-top: 14px; color: var(--cw-gray); font-size: 0.99rem; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 11px;
  color: var(--cw-gray);
  font-size: 0.99rem;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--cw-teal);
}

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

.site-footer {
  background: var(--cw-charcoal);
  color: #C2CACF;
  padding: 60px 0 30px;
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.3fr;
  gap: 40px;
}
.site-footer h4 {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.site-footer a { color: #C2CACF; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer address { font-style: normal; line-height: 1.7; }

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}
.footer-brand svg { width: 28px; height: 28px; }
.footer-tag { margin-top: 14px; max-width: 30ch; color: #A7B1B7; }

.footer-bottom {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid #39434A;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: #97A2A9;
  font-size: 0.88rem;
}

/* --------------------------------------------------------- responsive --- */

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { max-width: 22ch; }
  .grid--3, .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 34px; }
  .statement { padding: 34px 30px; }
}

@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .section { padding: 58px 0; }
  .hero { padding: 56px 0 52px; }
  .nav-toggle { display: inline-flex; }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--cw-white);
    border-bottom: 1px solid var(--cw-border);
    padding: 10px 24px 18px;
    box-shadow: 0 12px 20px -14px rgba(32, 39, 43, 0.28);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 1rem; }
  .site-header { position: relative; }
}

@media (max-width: 620px) {
  .grid--3, .grid--2, .principles { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; padding: 6px 22px 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .btn { width: 100%; }
  .btn-row { gap: 10px; }
  .statement { padding: 28px 22px; }
  .contact-card-body { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media print {
  .site-header, .topbar, .btn-row, .section--teal { display: none; }
  body { font-size: 12pt; }
}

/* ==========================================================================
   Product pages, pricing and purchase components
   ========================================================================== */

.product-hero {
  background: var(--cw-soft);
  border-bottom: 1px solid var(--cw-border-soft);
  padding: 60px 0 58px;
}
.product-hero .badge { margin-bottom: 20px; }
.product-hero h1 { max-width: 18ch; }
.product-hero .lead { margin-top: 18px; }

.spec-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 44px;
  max-width: 820px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--cw-border);
}
.spec-row div { font-size: 0.99rem; color: var(--cw-charcoal); }
.spec-row b {
  display: block;
  margin-bottom: 2px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--cw-gray);
}

/* Pricing */
.plans { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 780px; }
.plan {
  display: flex;
  flex-direction: column;
  background: var(--cw-white);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  padding: 30px 28px;
}
.plan--featured { border-color: var(--cw-teal); }
.plan-name { font-size: 1.02rem; font-weight: 600; }
.plan-tag {
  display: inline-block;
  margin-left: 9px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #C9DFE2;
  background: var(--cw-teal-tint);
  color: var(--cw-teal-deep);
  font-size: 0.76rem;
  font-weight: 600;
  vertical-align: 1px;
}
.plan-price {
  margin-top: 12px;
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.plan-price span { font-size: 0.98rem; font-weight: 400; color: var(--cw-gray); letter-spacing: 0; }
.plan-note { margin-top: 9px; color: var(--cw-gray); font-size: 0.94rem; }
.plan .checklist { margin-top: 20px; }
.plan-cta { margin-top: auto; padding-top: 26px; }
.plan-cta .btn { width: 100%; }

.pricing-foot {
  margin-top: 26px;
  max-width: 74ch;
  color: var(--cw-gray);
  font-size: 0.94rem;
}

/* Availability notice, used where a product cannot yet be bought */
.notice {
  max-width: 74ch;
  background: var(--cw-white);
  border: 1px solid var(--cw-border);
  border-left: 3px solid var(--cw-teal);
  border-radius: 0 var(--cw-radius) var(--cw-radius) 0;
  padding: 22px 26px;
}
.notice h3 { font-size: 1.02rem; }
.notice p { margin-top: 9px; color: var(--cw-gray); font-size: 0.97rem; }

.download-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.app-list { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.app-item { border-top: 1px solid var(--cw-border); padding-top: 15px; }
.app-item h4 { font-size: 0.99rem; }
.app-item p { margin-top: 6px; color: var(--cw-gray); font-size: 0.93rem; }

@media (max-width: 940px) {
  .app-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .plans, .app-list { grid-template-columns: 1fr; }
  .spec-row { gap: 16px 28px; }
}
