/* Cloudcraft Solutions — shared stylesheet
   Single source of truth for the site's visual system. Linked from every page.
   See AI_HANDOFF.md for design intent: dark navy, serious, "trustworthy senior finance leader". */

:root {
  --bg:        #0f1a2e;
  --bg-elev:  #182841;
  --surface:  #1b2a44;
  --border:   #2a3b5c;
  --text:     #e6ecf5;
  --text-dim: #a3b1c6;
  --accent:   #6db5ff;
  --accent-strong: #8cc4ff;
  --danger:   #ff8a8a;
  --success:  #7fe0a0;

  --max-w: 1080px;
  --gap:   1.5rem;
  --radius: 6px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
                "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
a:hover, a:focus { color: var(--accent-strong); border-bottom-color: currentColor; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1.1em; }
p.lead { font-size: 1.2rem; color: var(--text); max-width: 60ch; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  background: rgba(15, 26, 46, 0.85);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-bottom: none;
}
.brand:hover { color: var(--text); }
.brand img, .brand svg { height: 28px; width: auto; display: block; }

.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--text-dim);
  font-size: 0.95rem;
  border-bottom: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text); }

/* ---------- Main / sections ---------- */
main { display: block; }

.section {
  padding: 4rem 0;
}
.section + .section { border-top: 1px solid var(--border); }

.hero {
  padding: 6rem 0 4rem;
}
.hero .eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  margin-bottom: 0.8rem;
}
.hero h1 { max-width: 22ch; }
.hero .subhead {
  color: var(--text-dim);
  font-size: 1.25rem;
  max-width: 60ch;
  margin-bottom: 1.5rem;
}

.prose { max-width: 65ch; }
.prose p { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn-primary {
  background: var(--accent);
  color: #0a1322;
  border-color: var(--accent);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #0a1322;
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover,
.btn-secondary:focus {
  border-color: var(--accent);
  color: var(--accent-strong);
}
a.btn { border-bottom: none; }
a.btn:hover, a.btn:focus { border-bottom: none; }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--gap);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

a.card-link {
  display: block;
  color: var(--text);
  border-bottom: none;
  transition: border-color 120ms ease;
}
a.card-link:hover, a.card-link:focus {
  border-color: var(--accent);
  color: var(--text);
  border-bottom: none;
}
a.card-link h3 { color: var(--accent); }
a.card-link:hover h3 { color: var(--accent-strong); }

/* ---------- Portfolio list (lightweight sampler, distinct from cards) ---------- */
.portfolio {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem 2.5rem;
}
.portfolio > li {
  padding: 0.25rem 0;
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
}
.portfolio h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text);
}
.portfolio p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-dim);
}

/* ---------- Forms ---------- */
.form { max-width: 560px; }
.form .field { margin-bottom: 1.25rem; }
.form label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.form input[type="text"],
.form input[type="email"],
.form textarea {
  display: block;
  width: 100%;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 120ms ease;
}
.form input:focus,
.form textarea:focus { border-color: var(--accent); }
.form textarea { min-height: 160px; resize: vertical; }

/* honeypot — visually & semantically hidden from humans, present in DOM for bots */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.95rem;
  min-height: 1.4em;
}
.form-status.is-error { color: var(--danger); }
.form-status.is-success { color: var(--success); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 4rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
}
.site-footer p { margin: 0; }
.footer-tagline {
  flex-basis: 100%;
  color: var(--text);
  font-size: 0.95rem;
  margin: 0 0 1.25rem !important;
}
.footer-company { font-weight: 600; color: var(--text); }
.footer-legal { text-align: right; }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.muted { color: var(--text-dim); }
.spacer-l { height: 2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 3.5rem 0 2.5rem; }
  .section { padding: 3rem 0; }
  .site-header .container { flex-direction: row; flex-wrap: wrap; }
  .site-nav ul { gap: 0.9rem; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
  .footer-legal { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
