/*
 * Boniface Labs — Modern Theme
 * Dark, sleek, minimalist.
 */

/* ============================================================
   Custom Properties
   ============================================================ */
:root {
  --bg:             #0b0d12;
  --surface:        #13161e;
  --surface-2:      #1c2030;
  --border:         rgba(255, 255, 255, 0.07);
  --border-strong:  rgba(255, 255, 255, 0.13);

  --text:           #dde2f0;   /* 14.5:1 — AAA */
  --text-muted:     #a0a9c8;   /*  8.0:1 — AAA */
  --text-subtle:    #9ba4bf;   /*  7.5:1 — AAA */

  --accent:         #96c0ce;
  --accent-hover:   #afd5de;
  --accent-glow:    rgba(150, 192, 206, 0.18);
  --accent-dim:     rgba(150, 192, 206, 0.10);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  --mono: "SF Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;

  --nav-h:  60px;
  --max-w:  1080px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

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

/* Custom scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }


/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.nav.is-scrolled {
  background: rgba(11, 13, 18, 0.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 1px 0 var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none !important;
}

.nav-brand-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  opacity: 0.82;
  transition: opacity 0.2s;
}

.nav-brand:hover .nav-brand-icon { opacity: 1; }

.nav-brand-wordmark {
  height: 17px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.82;
  transition: opacity 0.2s;
}

.nav-brand:hover .nav-brand-wordmark { opacity: 1; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
  text-decoration: none !important;
}

.nav-link:hover { color: var(--text); }

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease, background 0.15s;
}

.nav-toggle-bar:nth-child(2) { margin: 5px 0; }

.nav-toggle:hover .nav-toggle-bar { background: var(--text); }

/* Animate to × when drawer is open */
.nav.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ============================================================
   Hero Section
   ============================================================ */
.hero {
  min-height: 100svh;
  min-height: 100vh; /* fallback */
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

/* Subtle grid */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(150, 192, 206, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 192, 206, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  pointer-events: none;
}

/* Radial accent glow from top */
.hero::after {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 700px;
  background: radial-gradient(
    ellipse at 50% 20%,
    rgba(150, 192, 206, 0.07) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 5rem) 2rem 4rem;
  position: relative;
  z-index: 1;
}

.hero-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 2.5rem;
  filter: brightness(0) invert(0.88);
  animation: icon-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes icon-in {
  from { opacity: 0; transform: scale(0.82) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.hero-wordmark {
  width: min(400px, 70vw);
  height: auto;
  filter: brightness(0) invert(0.92);
  margin: 0 auto 1.5rem;
  animation: fade-up 0.8s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-sub {
  font-size: clamp(1.125rem, 2.5vw, 1.3rem);
  color: var(--text-muted);
  max-width: 460px;
  line-height: 1.65;
  margin-bottom: 2.75rem;
  animation: fade-up 0.8s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-ctas {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: fade-up 0.8s 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}



/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease,
              border-color 0.2s ease, color 0.2s ease,
              transform 0.15s ease;
  text-decoration: none !important;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0b0d12;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 28px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}


/* ============================================================
   Content Feed (Homepage sections)
   ============================================================ */
.content-feed {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5.5rem 2rem 7rem;
}

.content-post {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.content-post:first-child { padding-top: 0; }
.content-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Section that leads into a project list — remove bottom border, keep natural gap */
.content-post.is-section-lead {
  border-bottom: none;
  padding-bottom: 2rem;
}

/* Section that follows a project list — match project item spacing */
.project-list + .content-post {
  padding-top: 2.5rem;
}


/* ============================================================
   Project List + Items
   ============================================================ */
.project-list {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.project-item {
  display: grid;
  grid-template-columns: 2fr 3fr;
  grid-template-areas: "image body";
  gap: 2.5rem;
  align-items: start;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.project-item.is-right {
  grid-template-columns: 3fr 2fr;
  grid-template-areas: "body image";
}

.project-image {
  grid-area: image;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.project-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.project-body {
  grid-area: body;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.project-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.project-title a:hover,
.project-item:hover .project-title a {
  color: var(--accent);
  text-decoration: none;
}

.project-desc {
  font-size: 1.0625rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1rem;
}

.project-body-text {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.project-body-text p { margin-bottom: 0.875rem; }
.project-body-text p:last-child { margin-bottom: 0; }
.project-body-text a { color: var(--accent); }

@media (max-width: 700px) {
  .project-item,
  .project-item.is-right {
    grid-template-columns: 1fr;
    grid-template-areas: "image" "body";
  }
}

/* Animate in via JS */
.js-animate {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js-animate.is-visible {
  opacity: 1;
  transform: none;
}

.content-post-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.content-post-desc {
  font-size: 1.125rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.content-post-body {}

.content-post-body p {
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.content-post-body p:last-child { margin-bottom: 0; }

.content-post-body a { color: var(--accent); }
.content-post-body a:hover { text-decoration: underline; }


/* ============================================================
   Single Page
   ============================================================ */
.page-single {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 4.5rem) 2rem 7rem;
}

.page-single-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.page-single-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.page-single-desc {
  font-size: 1.225rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Full-width hero image on single/detail pages */
.page-single-image {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 2.5rem;
}

.page-single-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Snip divider — separates homepage preview from extended detail content */
.content-snip {
  margin: 2.5rem 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-strong) 20%,
    var(--border-strong) 80%,
    transparent
  );
}

.page-single-content {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.page-single-content p { margin-bottom: 1.25rem; }
.page-single-content p:last-child { margin-bottom: 0; }

.page-single-content h1,
.page-single-content h2,
.page-single-content h3,
.page-single-content h4 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 2.5rem 0 0.875rem;
}

.page-single-content h1 { font-size: 1.875rem; }
.page-single-content h2 { font-size: 1.5rem; }
.page-single-content h3 { font-size: 1.25rem; }
.page-single-content h4 { font-size: 1.1rem; }

.page-single-content a { color: var(--accent); }

.page-single-content code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface-2);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  color: var(--accent);
}

.page-single-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.75rem 0;
}

.page-single-content pre code {
  background: none;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text);
}

.page-single-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.page-single-content ul,
.page-single-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.page-single-content li { margin-bottom: 0.3rem; }

.page-single-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.page-single-content strong { color: var(--text); font-weight: 600; }


/* ============================================================
   List Page
   ============================================================ */
.page-list {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 4rem) 2rem 7rem;
}

.page-list-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-list-empty {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.page-list-items { display: flex; flex-direction: column; }

.page-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none !important;
  transition: background 0.15s ease;
  border-radius: 4px;
}

.page-list-item:last-child { border-bottom: none; }

.page-list-item-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: color 0.15s;
}

.page-list-item:hover .page-list-item-title { color: var(--accent); }

.page-list-item-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.5;
}

.page-list-item-arrow {
  color: var(--text-subtle);
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: transform 0.2s, color 0.15s;
  align-self: center;
}

.page-list-item:hover .page-list-item-arrow {
  transform: translateX(4px);
  color: var(--accent);
}


/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 3.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  text-align: center;
  background: var(--surface);
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.footer-brand-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  opacity: 0.35;
}

.footer-brand-wordmark {
  height: 13px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.35;
}

.footer-links {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color 0.15s;
  text-decoration: none !important;
}

.footer-link:hover { color: var(--text); }

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-subtle);
  max-width: 480px;
  line-height: 1.6;
}


/* ============================================================
   Scroll-to-top indicator in hero
   ============================================================ */
.hero-scroll-hint {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding-bottom: 0;
  animation: fade-up 1s 0.7s both;
}

.hero-scroll-hint-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-subtle);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1.25rem 0;
}

.hero-scroll-hint-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, var(--text-subtle), transparent);
  animation: scroll-line 2s 1.2s infinite ease-in-out;
}

@keyframes scroll-line {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6) translateY(-6px); }
  50%       { opacity: 0.8; transform: scaleY(1) translateY(0); }
}


/* ============================================================
   Utility
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}


/* ============================================================
   Responsive
   ============================================================ */

/* ── Mobile nav drawer (< 960px) ── */
@media (max-width: 960px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 199;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.375rem 0;
    background: rgba(11, 13, 18, 0.97);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    /* Hidden by default */
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav.is-open .nav-links {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-link {
    padding: 0.9rem 2rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-link:last-child { border-bottom: none; }
}

@media (max-width: 640px) {
  :root { --nav-h: 56px; }

  .nav-brand-wordmark { height: 14px; }

  .hero-icon { width: 72px; height: 72px; }
}

@media (max-width: 480px) {
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .footer-links { gap: 1.25rem; }
}

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