/* Chronocell Digital — compiled stylesheet.
   Clean IT-services template: white ground, near-navy ink, one CMS-editable
   accent (teal by default, to match the brand mark). Soft cards, gentle
   shadows, generous whitespace. Mobile-first. Honours prefers-reduced-motion.
   WCAG 2.2 AA contrast targets. */

:root {
  --bg: #ffffff;
  --bg-raised: #f8fafc;
  --bg-line: #e2e8f0;
  --fg: #0f172a;
  --fg-dim: #475569;
  --fg-faint: #94a3b8;
  --accent: #0f766e; /* overridden inline from Settings > accent colour */
  --accent-fg: #ffffff;
  --accent-soft: #f0fdfa;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 4px 8px rgba(15, 23, 42, 0.04), 0 16px 40px rgba(15, 23, 42, 0.1);
  --maxw: 1180px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
a.plain { text-decoration: none; color: inherit; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.18; margin: 0 0 0.5em; letter-spacing: -0.015em; color: var(--fg); }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; color: var(--fg-dim); max-width: 62ch; }
p.lede { font-size: 1.2rem; color: var(--fg-dim); max-width: 48ch; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-fg);
  padding: 10px 16px; z-index: 200; font-weight: 600; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 12px; top: 0; }

/* Visible focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.9); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--bg-line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.wordmark { display: flex; flex-direction: row; align-items: center; gap: 12px; line-height: 1; font-weight: 700; letter-spacing: 0.01em; }
.wordmark img.wordmark__logo { max-height: 32px; width: auto; }
.wordmark img.wordmark__icon { height: 30px; width: auto; border-radius: 8px; display: block; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.wordmark .main { font-size: 1.15rem; color: var(--fg); }
.wordmark .sub { font-size: 0.6rem; letter-spacing: 0.25em; color: var(--fg-faint); margin-top: 4px; }

.nav-toggle { display: inline-flex; background: var(--bg); border: 1px solid var(--bg-line); color: var(--fg); padding: 8px 10px; border-radius: var(--radius-sm); }
.primary-nav { display: none; }
.primary-nav.is-open { display: block; }
.primary-nav ul { list-style: none; margin: 0; padding: 16px 0; display: flex; flex-direction: column; gap: 4px; }
.primary-nav a { display: block; padding: 10px 0; text-decoration: none; color: var(--fg-dim); font-size: 0.95rem; font-weight: 500; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--fg); }
a.header-cta { display: none; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .primary-nav { display: block; }
  .primary-nav ul { flex-direction: row; gap: 30px; padding: 0; align-items: center; }
  .primary-nav a { padding: 4px 0; border-bottom: 2px solid transparent; }
  .primary-nav a:hover, .primary-nav a[aria-current="page"] { border-color: var(--accent); color: var(--fg); }
  a.header-cta { display: inline-flex; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--accent-fg); box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(0.92); }
.btn-ghost { border-color: var(--bg-line); color: var(--fg); background: var(--bg); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Hero */
.hero { position: relative; padding: 96px 0 64px; border-bottom: 1px solid var(--bg-line); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -220px; right: -160px; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 70%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero .kicker { color: var(--accent); font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 18px; display: block; font-weight: 600; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.trust-line { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--bg-line); color: var(--fg-faint); font-size: 0.85rem; }

/* Numbered blocks (services) */
.section { padding: 72px 0; border-bottom: 1px solid var(--bg-line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.services-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.service-block {
  background: var(--bg); border: 1px solid var(--bg-line); border-radius: var(--radius); padding: 30px;
  position: relative; box-shadow: var(--shadow-sm); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.service-block:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 30%, var(--bg-line)); }
.service-block .num {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700;
}
.service-block .sic { display: inline-block; margin-top: 14px; margin-left: 8px; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--fg-faint); border: 1px solid var(--bg-line); padding: 3px 9px; border-radius: 999px; }
.service-block h3 { margin-top: 16px; }
.service-block a.more { display: inline-block; margin-top: 14px; font-size: 0.88rem; color: var(--accent); text-decoration: none; font-weight: 600; }
.service-block a.more:hover { text-decoration: underline; }
@media (min-width: 700px) { .services-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .services-grid { grid-template-columns: 1fr 1fr 1fr; } }

/* Cards (work, insights) */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 700px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .card-grid { grid-template-columns: 1fr 1fr 1fr; } }
.card { border: 1px solid var(--bg-line); background: var(--bg); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card img { aspect-ratio: 16/10; object-fit: cover; background: var(--bg-raised); }
.card .body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.card .meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-faint); margin-bottom: 8px; }
.card h3 { font-size: 1.05rem; }
.card a.plain { text-decoration: none; }

/* Approach steps */
.steps { display: grid; gap: 20px; }
.step { counter-increment: step; background: var(--bg); border: 1px solid var(--bg-line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.steps { counter-reset: step; }
.step::before {
  content: counter(step, decimal-leading-zero); font-family: var(--font-mono); color: var(--accent-fg); font-size: 0.8rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); margin-bottom: 14px;
}
@media (min-width: 700px) { .steps { grid-template-columns: 1fr 1fr; } }

/* Product spotlight */
.spotlight { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--bg-line)); border-radius: var(--radius); padding: 48px; }

/* Forms */
form .field { margin-bottom: 20px; }
label { display: block; font-size: 0.85rem; color: var(--fg-dim); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=email], input[type=tel], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--bg-line); color: var(--fg);
  padding: 12px 14px; border-radius: var(--radius-sm); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { min-height: 140px; resize: vertical; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input { margin-top: 4px; }
.checkbox-row label { margin: 0; color: var(--fg-dim); font-weight: 400; }
.hp-field { position: absolute; left: -9999px; top: -9999px; }
.form-note { font-size: 0.82rem; color: var(--fg-faint); }
.form-success { border: 1px solid var(--accent); background: var(--accent-soft); padding: 20px; border-radius: var(--radius); color: var(--fg); }
.form-error { border: 1px solid #fecaca; background: #fef2f2; color: #b91c1c; padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; }

/* Footer */
.site-footer { padding: 56px 0 40px; background: var(--bg-raised); border-top: 1px solid var(--bg-line); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-grid h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-faint); margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--fg-dim); text-decoration: none; font-size: 0.92rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--bg-line); display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; color: var(--fg-faint); font-size: 0.8rem; }

/* Misc */
.eyebrow { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.breadcrumb { font-size: 0.82rem; color: var(--fg-faint); margin-bottom: 24px; }
.breadcrumb a { color: var(--fg-faint); }
hr.rule { border: none; border-top: 1px solid var(--bg-line); margin: 40px 0; }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { color: var(--fg-dim); padding-left: 1.2em; }
.prose img { border-radius: var(--radius); margin: 1.5em 0; }
table { width: 100%; border-collapse: collapse; }
table th, table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--bg-line); }
.pill { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: 0.72rem; padding: 4px 10px; border-radius: 999px; font-family: var(--font-mono); font-weight: 600; }
.error-page { padding: 120px 0; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .service-block, .card, .btn { transition: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .site-header, a, .btn { transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, filter 0.15s ease; }
}

/* ---- Admin (shared shell, same design language, lighter density) ---- */
.admin-body { background: var(--bg-raised); color: var(--fg); font-family: var(--font-sans); margin: 0; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; flex-shrink: 0; background: var(--bg); border-right: 1px solid var(--bg-line); padding: 24px 0; }
.admin-sidebar .brand { padding: 0 20px 20px; border-bottom: 1px solid var(--bg-line); margin-bottom: 12px; font-weight: 700; }
.admin-sidebar nav a { display: block; padding: 9px 20px; color: var(--fg-dim); text-decoration: none; font-size: 0.9rem; border-left: 3px solid transparent; }
.admin-sidebar nav a:hover { background: var(--bg-raised); color: var(--fg); }
.admin-sidebar nav a.active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.admin-main { flex: 1; padding: 28px 32px; max-width: 1100px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-card { background: var(--bg); border: 1px solid var(--bg-line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--bg-line); font-size: 0.9rem; }
.admin-table th { color: var(--fg-faint); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--bg-line); color: var(--fg-faint); }
.badge.ok { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.badge.warn { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.alert { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; border: 1px solid var(--bg-line); }
.alert.success { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }
.alert.error { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg-raised); }
.login-card { width: 100%; max-width: 380px; background: var(--bg); border: 1px solid var(--bg-line); padding: 36px; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.stat-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; margin-bottom: 24px; }
@media (min-width: 760px) { .stat-row { grid-template-columns: repeat(4,1fr); } }
.stat { background: var(--bg); border: 1px solid var(--bg-line); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat .n { font-size: 1.8rem; font-weight: 700; color: var(--fg); }
.stat .l { color: var(--fg-faint); font-size: 0.8rem; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; border: 1px solid var(--bg-line); border-bottom: none; padding: 6px; background: var(--bg-raised); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.rte-toolbar button { background: var(--bg); border: 1px solid var(--bg-line); color: var(--fg-dim); padding: 5px 10px; font-size: 0.78rem; border-radius: 6px; cursor: pointer; }
.rte-toolbar button:hover { color: var(--accent); border-color: var(--accent); }
.rte-editable { min-height: 260px; border: 1px solid var(--bg-line); padding: 14px 16px; background: var(--bg); color: var(--fg); overflow-y: auto; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.rte-editable:focus { outline: none; border-color: var(--accent); }
.rte-editable h2, .rte-editable h3 { margin-top: 0.6em; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.media-item { border: 1px solid var(--bg-line); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); box-shadow: var(--shadow-sm); }
.media-item img { width: 100%; height: 100px; object-fit: cover; background: var(--bg-raised); }
.media-item .mi-body { padding: 8px; font-size: 0.72rem; }
.media-item input { font-size: 0.72rem; padding: 5px 6px; margin-top: 4px; }
