:root {
  --bg: #0f1115;
  --color-border: rgb(255 255 255 / 10%);
  --color-muted: #b7bfd6;
  --color-strong: #fff;
  --color-bg-secondary: #1f2937;
  --surface: #151821;
  --surface-2: #1b1f2b;
  --text: #e6e8ef;
  --muted: #9aa3b2;
  --accent: #5ab0ff;
  --border: rgb(255 255 255 / 8%);
  --shadow: 0 2px 10px rgb(0 0 0 / 25%);
  --shadow-hover: 0 6px 22px rgb(0 0 0 / 35%);
  --radius: 14px;
  --radius-sm: 10px;
  --spacing-page: clamp(1.25rem, 0.9rem + 1.6vw, 2.5rem);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --fade-in: 260ms;
  --fade-out: 140ms;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  scrollbar-gutter: stable;
}

html {
  overflow-y: scroll;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Spectral, serif;
  line-height: 1.6;
}

.logo__image {
  position: absolute;
  top: -1.8%;
  left: 1.5%;
  width: 180px;
}

.logo__link {
  cursor: pointer;
}

.logo__link img:hover {
  filter: brightness(0.6);
}

/* NAVBAR ------------------- */

.navbar {
  position: relative;
  top: 0;
  width: 100%;
  background: transparent;
  z-index: 500;
  padding: var(--space-3) 0;
}

.navbar__links {
  display: flex;
  justify-content: end;
  gap: var(--space-6);
  margin-right: 2rem;
  padding: 0;
  list-style: none;
}

.navbar__link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
}

.navbar__link:hover {
  opacity: 0.8;
}

/* =========================================================
   Hamburger (base / desktop)
   - Hidden on desktop
   - Styles for the button + the 3 lines
   ========================================================= */

.navbar__toggle {
  display: none; /* shown only at <= 660px */
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  line-height: 0;
}

.navbar__toggle:hover {
  border-color: rgb(90 176 255 / 45%);
}

.navbar__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* The 3 hamburger lines */
.navbar__toggle-line {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
}

/* Spacing between lines */
.navbar__toggle-line + .navbar__toggle-line {
  margin-top: 5px;
}

.navbar__links .navbar__link--active {
  border-bottom: 2px solid var(--accent);
  color: var(--muted);
  pointer-events: none;
}

#standout {
  background-color: var(--color-bg-secondary);
  padding: 3px 0.8rem 0;
  border-radius: 6px;
  color: var(--text);
  animation: pulse 2s infinite;
  transition: transform 0.25s ease;
}

#standout:hover {
  filter: brightness(0.8);
  transform: scale(1.05);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(90 176 255 / 70%);
  }

  70% {
    box-shadow: 0 0 0 10px rgb(90 176 255 / 0%);
  }

  100% {
    box-shadow: 0 0 0 0 rgb(90 176 255 / 0%);
  }
}

main {
  width: min(1100px, 100% - 2rem);
  margin: 0 auto;
  padding-block: clamp(16px, 3vw, 32px);
}

.page-header h1 {
  font-size: clamp(2.3rem, 3.4vw, 3.2rem);
  margin: 0 0 var(--space-2);
  text-align: center;
}

.page-header .intro {
  font-size: clamp(1.15rem, 1.3vw, 1.25rem);
  color: var(--muted);
  margin: 0 0 var(--space-5);
  text-align: center;
  letter-spacing: 0.3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.divider {
  border: none;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: var(--space-6) 0;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-5);
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.post-card:hover,
.post-card:focus-within {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  border-color: rgb(90 176 255 / 35%);
}

.post-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.post-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: var(--radius) var(--radius) 0 0;
}

.post-card__body {
  padding: var(--space-5);
}

.post-card__date {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-2);
}

.post-card__title {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.post-card__summary {
  margin: 0;
  color: var(--text);
  font-size: clamp(0.95rem, 1.05vw, 1.07rem);
  letter-spacing: 0.2px;
}

/* OPTIONAL TRUNCATION */
.post-card__summary.clamp-3 {
  /* CROSS-BROWSER 3-LINE CLAMP WITHOUT VENDOR PREFIXES */
  overflow: hidden;
  display: block;
  line-height: 1.6;
  max-height: calc(1.6em * 3);
}

/* FOCUS OUTLINE FOR KEYBOARD USERS */
.post-card a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* FEATURED */
.featured {
  margin-bottom: var(--space-6);
}

.featured .post-card {
  display: block;
}

.featured .post-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 8px 8px 0 0;
  box-shadow: var(--shadow);
}

.featured .post-card__title {
  font-size: clamp(1.6rem, 2.7vw, 2.2rem);
  letter-spacing: 0.3px;
}

.featured .post-card__summary {
  font-size: clamp(1.1rem, 1.25vw, 1.2rem);
  letter-spacing: 0.3px;
}

/* Footer */
.footer {
  padding: calc(var(--spacing-page) * 0.8) 0 var(--spacing-page);
  border-top: 1px solid var(--color-border);
}

.footer__inner {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: var(--space-6);
}

.footer__copy {
  margin: 0;
  color: var(--color-muted);
  user-select: none;
}

.footer__links {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.footer__link {
  color: var(--color-strong);
  font-weight: 600;
  font-size: 3rem;
  transition: all 0.4s ease;
}

.footer__link:hover {
  filter: drop-shadow(0 0 14px rgb(255 255 255 / 80%));
  transform: translateY(-2px);
}

.footer__link:active {
  filter: drop-shadow(0 0 10px rgb(255 255 255 / 80%));
  transform: translateY(0);
}

/* REDUCE MOTION PREFERENCE */
@media (prefers-reduced-motion: reduce) {
  .post-card {
    transition: none;
  }
}

@media (width <= 1024px) {
  .logo img {
    top: -1.5%;
    left: 2%;
  }
}

@media (width <= 872px) {
  .logo img {
    top: -4%;
    left: 2.4%;
  }
}

@media (width <= 820px) {
  .logo img {
    top: -1.8%;
    left: 2.4%;
  }
}

@media (width <= 712px) {
  .logo img {
    top: -0.8rem;
    width: 140px;
  }

  .navbar__links {
    gap: var(--space-5);
  }

  .footer__link {
    font-size: 2.2rem;
  }
}

@media (width <= 660px) {
  /* Mobile: navbar row with hamburger + dropdown menu */
  .navbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: var(--space-3) var(--spacing-page);
  }

  .navbar__toggle {
    margin-top: 0.85rem;
    display: grid;
  }

  .navbar__links {
    display: none;
    position: absolute;
    top: 100%;
    right: var(--spacing-page);
    left: var(--spacing-page);
    margin: 10px 0 0;
    padding: 12px;
    border-radius: var(--radius);
    background: rgb(21 24 33 / 96%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-hover);
    flex-direction: column;
    gap: 10px;
    z-index: 600;
  }

  /* When open */
  .navbar__links.is-open {
    display: flex;
  }

  .navbar__link {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
  }

  .navbar__link:hover {
    background: rgb(255 255 255 / 6%);
  }
}

@media (width <= 600px) {
  .logo img {
    width: 120px;
  }

  .footer__link {
    font-size: 2rem;
  }
}

@media (width <= 540px) {
  .navbar__toggle {
    margin-top: 0.6rem;
  }

  .footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
  }

  .footer__links {
    display: flex;
    gap: 0.9rem;
    justify-content: center;
  }
}

@media (width <= 400px) {
  .logo img {
    top: -0.8rem;
    left: 1rem;
  }
}
