/* ========================================
   drand labs - Minimal stylesheet
   ======================================== */

/* ---- Fonts ---- */
@font-face {
  font-family: "Funnel Display";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/funnel-display-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Funnel Display";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/funnel-display-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Funnel Sans";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("/assets/fonts/funnel-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Funnel Sans";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("/assets/fonts/funnel-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a2e;
  --color-text-secondary: #555570;
  --color-accent: #4d65ff;
  --color-accent-light: #e8ebff;
  --color-border: #e2e2f0;
  --color-surface: #f7f7fc;
  --font-display: "Funnel Display", system-ui, sans-serif;
  --font-body: "Funnel Sans", system-ui, sans-serif;
  --max-width: 680px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Screen reader only */
.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;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.3;
}

.logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.logo-tagline {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.site-logo:hover .logo-name {
  color: var(--color-accent);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--color-accent);
}

/* Burger menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10;
}

.menu-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ---- Main ---- */
main {
  flex: 1;
  padding: 2.5rem 1.5rem 4rem;
}

/* ---- Hero ---- */
.hero {
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  font-weight: 300;
}

/* ---- Sections ---- */
section + section {
  margin-top: 2rem;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

p {
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration: none;
}

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

/* Services list */
.services-list {
  list-style: none;
  padding: 0;
}

.services-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.services-list li:last-child {
  border-bottom: none;
}

.services-list strong {
  font-weight: 600;
  color: var(--color-text);
}

/* Social links */
.social-links {
  color: var(--color-text-secondary);
}

/* ---- Blog ---- */
.blog-page h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.blog-post {
  margin-bottom: 1rem;
}

.post-header {
  margin-bottom: 1rem;
}

.post-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  display: flex;
  gap: 1rem;
}

.post-summary {
  font-style: italic;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

.post-content {
  line-height: 1.75;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.post-content pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  margin: 1rem 0;
}

.post-content code {
  font-size: 0.875em;
  background: var(--color-surface);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content blockquote {
  border-left: 3px solid var(--color-accent-light);
  padding-left: 1rem;
  color: var(--color-text-secondary);
  margin: 1rem 0;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.no-posts {
  color: var(--color-text-secondary);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.pagination-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.pagination-link:hover {
  text-decoration: underline;
}

.pagination-link.disabled {
  color: var(--color-border);
  cursor: default;
}

.pagination-info {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

/* ---- 404 ---- */
.not-found {
  text-align: center;
  padding: 4rem 0;
}

.not-found h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-accent-light);
  margin-bottom: 1rem;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  text-align: center;
}

.site-footer a {
  color: var(--color-text-secondary);
}

.site-footer a:hover {
  color: var(--color-accent);
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .menu-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
  }

  .site-nav.open {
    display: flex;
  }

  .site-header {
    position: relative;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .tagline {
    font-size: 1rem;
  }

  main {
    padding: 2rem 1.5rem 3rem;
  }

  .post-meta {
    flex-direction: column;
    gap: 0.25rem;
  }

  .menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}
