/* ──────────────────────────────────────────────────────────────
   W.A. Hutton — shared styles (used by new pages only)
   Existing pages keep their inline CSS untouched.
   ────────────────────────────────────────────────────────────── */

:root {
  --bg:         #0C0C11;
  --surface:    #13131C;
  --elevated:   #1A1A26;
  --floating:   #212130;
  --blue:       #2D80CA;
  --blue-l:     #4A9EDB;
  --blue-dark:  #1B5E94;
  --blue-glow:  rgba(45,128,202,0.18);
  --slate:      #6B7A8F;
  --text:       #F0F0F8;
  --muted:      #8893A8;
  --border:     rgba(255,255,255,0.07);
  --border-b:   rgba(255,255,255,0.12);
  --nav-bg:     rgba(12,12,17,0.82);
  --mob-nav-bg: rgba(13,13,20,0.98);
}

[data-theme="light"] {
  --bg:         #F4F6FC;
  --surface:    #FFFFFF;
  --elevated:   #EDF0F8;
  --floating:   #E4E9F5;
  --blue:       #2D80CA;
  --blue-l:     #1A6AB0;
  --blue-glow:  rgba(45,128,202,0.10);
  --slate:      #5A6880;
  --text:       #1A1A2E;
  --muted:      #6B7A8F;
  --border:     rgba(0,0,0,0.08);
  --border-b:   rgba(0,0,0,0.14);
  --nav-bg:     rgba(244,246,252,0.88);
  --mob-nav-bg: rgba(248,249,252,0.98);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; letter-spacing: -0.03em; }
a { color: inherit; }

/* Grain texture */
.grain { position: relative; }
.grain::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 180px;
  pointer-events: none; z-index: 1; opacity: 0.45;
}
[data-theme="light"] .grain::before { opacity: 0.15; }

/* Nav */
#nav { position: fixed; top: 0; left: 0; right: 0; z-index: 200; background: var(--nav-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); transition: box-shadow 0.3s ease; }
#nav.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
[data-theme="light"] #nav.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; height: 68px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; text-decoration: none; font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 1.35rem; letter-spacing: -0.02em; }
.logo .wa { color: var(--slate); }
.logo .hutton { color: var(--blue); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-link { color: var(--muted); text-decoration: none; font-size: 0.875rem; font-weight: 500; transition: color 0.2s ease; padding: 0.25rem 0; position: relative; }
.nav-link::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px; background: var(--blue); transition: width 0.2s ease; }
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--blue); }
.nav-link.active::after { width: 100%; }
.nav-right { display: flex; align-items: center; gap: 0.6rem; }
.btn-nav { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--blue); color: #fff; padding: 0.5rem 1.25rem; border-radius: 6px; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 0.8rem; text-decoration: none; transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease; box-shadow: 0 2px 16px rgba(45,128,202,0.4); }
.btn-nav:hover { background: var(--blue-l); transform: translateY(-1px); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--elevated); border: 1px solid var(--border-b); color: var(--muted); cursor: pointer; transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease; flex-shrink: 0; }
.theme-toggle:hover { background: var(--floating); color: var(--text); transform: scale(1.08); }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; transition: transform 0.25s ease, opacity 0.25s ease; }

/* Mobile nav */
#mobile-nav { display: none; position: fixed; top: 68px; left: 0; right: 0; z-index: 190; background: var(--mob-nav-bg); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); padding: 1.5rem; }
#mobile-nav.open { display: block; }
#mobile-nav a { display: block; padding: 0.75rem 0; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--border); transition: color 0.2s ease; }
#mobile-nav a:last-child { border-bottom: none; }
#mobile-nav a:hover { color: var(--text); }

/* Buttons */
.btn-primary { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--blue); color: #fff; padding: 0.9rem 2rem; border-radius: 8px; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 0.9rem; text-decoration: none; cursor: pointer; border: none; transition: background 0.2s ease, transform 0.15s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s ease; box-shadow: 0 4px 24px rgba(45,128,202,0.4), 0 2px 8px rgba(0,0,0,0.3); }
.btn-primary:hover { background: var(--blue-l); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(45,128,202,0.5), 0 4px 12px rgba(0,0,0,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-outline { display: inline-flex; align-items: center; gap: 0.5rem; background: transparent; color: var(--text); padding: 0.9rem 2rem; border-radius: 8px; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 0.9rem; text-decoration: none; border: 1px solid var(--border-b); transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s cubic-bezier(0.34,1.56,0.64,1); }
.btn-outline:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.25); transform: translateY(-2px); }
[data-theme="light"] .btn-outline:hover { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.18); }

/* Label */
.label { display: inline-block; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); margin-bottom: 0.75rem; }

/* Card */
.card { background: var(--elevated); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease, border-color 0.25s ease; }
.card:hover { transform: translateY(-5px); border-color: rgba(45,128,202,0.3); box-shadow: 0 20px 60px rgba(45,128,202,0.10), 0 8px 24px rgba(0,0,0,0.5); }
[data-theme="light"] .card:hover { box-shadow: 0 16px 48px rgba(45,128,202,0.10), 0 4px 16px rgba(0,0,0,0.06); }
.icon-box { width: 48px; height: 48px; border-radius: 12px; background: var(--blue-glow); border: 1px solid rgba(45,128,202,0.25); display: flex; align-items: center; justify-content: center; margin-bottom: 1.25rem; }

/* Reveal */
.reveal   { opacity: 0; transform: translateY(24px);  transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal-l { opacity: 0; transform: translateX(-24px); transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal-r { opacity: 0; transform: translateX(24px);  transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal.in, .reveal-l.in, .reveal-r.in { opacity: 1; transform: none; }

/* Page-level layout helpers */
.section { padding: 6rem 1.5rem; position: relative; overflow: hidden; }
.container { max-width: 1100px; margin: 0 auto; position: relative; z-index: 1; }
.container-narrow { max-width: 800px; margin: 0 auto; position: relative; z-index: 1; }
.page-hero { padding: 9rem 1.5rem 4rem; position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 900; line-height: 1.1; margin-bottom: 1.25rem; }
.page-hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 640px; margin-bottom: 2rem; line-height: 1.7; }

/* Article / blog body */
.article { padding: 7rem 1.5rem 5rem; }
.article h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 900; margin-bottom: 1rem; line-height: 1.15; }
.article .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 3rem; max-width: 1100px; margin: 0 auto; align-items: start; }
.article-body p { margin-bottom: 1.25rem; color: var(--text); font-size: 1.02rem; line-height: 1.8; }
.article-body h2 { font-size: 1.5rem; font-weight: 800; margin: 2.5rem 0 1rem; color: var(--text); }
.article-body h3 { font-size: 1.2rem; font-weight: 800; margin: 2rem 0 0.75rem; color: var(--text); }
.article-body ul, .article-body ol { margin: 1rem 0 1.5rem 1.5rem; }
.article-body li { margin-bottom: 0.5rem; line-height: 1.75; }
.article-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--blue-l); }
.article-body strong { color: var(--text); font-weight: 700; }
.article-body blockquote { border-left: 3px solid var(--blue); padding: 0.5rem 0 0.5rem 1.5rem; margin: 1.5rem 0; color: var(--muted); font-style: italic; }
.article-sidebar { position: sticky; top: 100px; }
.sidebar-card { background: var(--elevated); border: 1px solid var(--border); border-radius: 14px; padding: 1.75rem; margin-bottom: 1.5rem; }
.sidebar-card h4 { font-size: 0.95rem; font-weight: 800; margin-bottom: 0.75rem; }
.sidebar-card p { font-size: 0.875rem; color: var(--muted); margin-bottom: 1.25rem; line-height: 1.6; }
.breadcrumb { font-size: 0.8rem; color: var(--muted); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb .sep { margin: 0 0.5rem; opacity: 0.5; }

/* Blog index card */
.post-card { background: var(--elevated); border: 1px solid var(--border); border-radius: 14px; padding: 1.75rem; transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), border-color 0.25s ease, box-shadow 0.25s ease; display: flex; flex-direction: column; height: 100%; }
.post-card:hover { transform: translateY(-4px); border-color: rgba(45,128,202,0.3); box-shadow: 0 12px 36px rgba(45,128,202,0.08), 0 4px 12px rgba(0,0,0,0.3); }
.post-card .date { font-size: 0.75rem; color: var(--muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.75rem; }
.post-card h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 0.75rem; line-height: 1.3; }
.post-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.25rem; flex: 1; }
.post-card .read-more { color: var(--blue); font-weight: 700; font-size: 0.85rem; text-decoration: none; }
.post-card .read-more:hover { color: var(--blue-l); }

/* Footer */
footer { background: var(--bg); border-top: 1px solid var(--border); padding: 3rem 1.5rem 2rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-grid h4 { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a, .footer-links span { color: var(--muted); text-decoration: none; font-size: 0.875rem; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-bottom p { color: var(--muted); font-size: 0.8rem; }

/* Responsive */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .article-grid { grid-template-columns: 1fr; gap: 2rem; }
  .article-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 2rem !important; }
  .section { padding: 4rem 1.5rem; }
}
@media (max-width: 480px) {
  .btn-nav-label { display: none; }
  .footer-grid { grid-template-columns: 1fr !important; }
}
