* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #16202E;
  --muted: #59657A;
  --faint: #9AA4B2;
  --bg: #F1F3F7;
  --accent: #2E6FD6;
  --body: #3A4453;
  --line: rgba(60,90,150,0.16);
  --structure: #707C8E;
  --gold: #C9A86A;
}

::selection { background: rgba(46,111,214,0.16); color: var(--ink); }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(60% 55% at 50% 36%, rgba(46,111,214,0.10), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: 'Inter Tight', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(ellipse 130% 95% at 50% 40%, transparent 62%, rgba(150,165,195,0.14) 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

header, main, footer { position: relative; z-index: 1; }

a { color: inherit; }
a:focus-visible {
  outline: 1px solid var(--muted);
  outline-offset: 4px;
  border-radius: 2px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(15px, 2.25vw, 24px) clamp(20px, 5vw, 56px);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background-color: transparent;
  border-bottom: 0.5px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
header.is-floating {
  background-color: rgba(241,243,247,0.70);   /* --bg (#F1F3F7) at 70% — scrolling down */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}
header.is-floating.is-translucent {
  background-color: rgba(241,243,247,0.40);    /* 40% — more transparent while scrolling up */
}

@media (prefers-reduced-motion: reduce) {
  header { transition: none; }
}

.wordmark {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-logo {
  height: 18px;
  width: auto;
  display: block;
}

.nav-contact {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
  transition: color 0.3s ease;
}
.nav-contact::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-contact:hover { color: var(--ink); }
.nav-contact:hover::after { width: 100%; }

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

.nav-item { position: relative; }
.blog-trigger {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  transition: color 0.3s ease;
}
.blog-trigger .caret { font-size: 12px; transition: transform 0.25s ease; }
.blog-trigger::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.3s ease;
}
.blog-trigger:hover { color: var(--ink); }
.blog-trigger:focus-visible { outline: 1px solid var(--muted); outline-offset: 4px; border-radius: 2px; }
.nav-item:hover .blog-trigger,
.nav-item.open .blog-trigger { color: var(--ink); }
.nav-item:hover .blog-trigger::after,
.nav-item.open .blog-trigger::after { width: 100%; }
.nav-item.open .blog-trigger .caret { transform: rotate(180deg); }

.blog-menu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 300px;
  max-width: calc(100vw - 40px);
  background: rgba(241,243,247,0.7);   /* flat fill = no-backdrop-filter fallback */
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border: 0.5px solid rgba(255,255,255,0.4);
  border-radius: 12px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 20;
  box-shadow: 0 14px 44px -18px rgba(20,26,36,0.45);
}
.blog-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 32px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid rgba(248,250,252,0.92);   /* lighter/opaque to match the frosted panel's apparent color */
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.nav-item:hover .blog-menu,
.nav-item.open .blog-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.blog-item {
  display: block;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 8px;
  transition: background 0.18s ease;
}
.blog-item:hover { background: var(--bg); }
.blog-cat {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.blog-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  margin: 4px 0 3px;
}
.blog-date { font-size: 11.5px; color: var(--muted); }

.section-label {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(24px, 4vh, 36px);
}

footer {
  border-top: 0.5px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vh, 44px);
  padding: clamp(40px, 6vh, 64px) clamp(24px, 5vw, 56px) clamp(26px, 4vh, 36px);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 3vw, 34px);
}
.footer-links a {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-links a:hover { color: var(--ink); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-bottom span {
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.2em;
}
