/* ================================================================
   VARIABLES
================================================================ */
:root {
  --bg:            #080010;
  --surface:       #0e0018;
  --surface-hover: #180028;
  --pink:          #ff2d78;
  --pink-bright:   #ff6699;
  --pink-glow:     rgba(255, 45, 120, 0.25);
  --text:          #ede5fc;
  --text-muted:    #9980b8;
  --border:        #251035;
  --radius:        8px;
}

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

html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(255, 45, 120, 0.4);
  color: #fff;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

strong, b {
  color: var(--pink-bright);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ================================================================
   AMBIENT GLOW – right side, starts below header
================================================================ */
body::after {
  content: '';
  position: fixed;
  right: -160px;
  top: 68px;
  width: 640px;
  height: 720px;
  background: radial-gradient(
    ellipse at 75% 25%,
    rgba(255, 45, 120, 0.22) 0%,
    rgba(200, 0, 100, 0.08) 45%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* ================================================================
   LAYOUT
================================================================ */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* ================================================================
   HEADER
================================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 0, 16, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--pink);
  filter:
    drop-shadow(0 0 8px rgba(255, 45, 120, 0.7))
    drop-shadow(0 0 22px rgba(255, 45, 120, 0.3));
  transition: filter 0.25s;
}

.header-logo-link:hover {
  filter:
    drop-shadow(0 0 12px rgba(255, 45, 120, 0.9))
    drop-shadow(0 0 36px rgba(255, 45, 120, 0.5));
}

.header-logo-icon {
  width: 28px;
  height: 28px;
  fill: var(--pink);
}

.header-nav {
  display: flex;
  gap: 2.5rem;
}

.header-nav a {
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}

.header-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--pink);
  transition: width 0.3s ease;
  box-shadow: 0 0 6px var(--pink);
}

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

.header-nav a:hover::after {
  width: 100%;
}

.header-right a {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color 0.25s, filter 0.25s;
}

.header-right a:hover {
  color: var(--pink);
  filter: drop-shadow(0 0 6px var(--pink));
}

.header-right svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

/* ================================================================
   HERO
================================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem;
  position: relative;
  z-index: 1;
}

.neon-title {
  color: #fff;
  cursor: default;
  user-select: none;
}

.neon-title .nl {
  display: inline;
}

.neon-title .nl.flicker {
  opacity: 0.12;
}

.hero-subtitle {
  margin-top: 1.4rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-muted);
}

/* ================================================================
   SCROLL HINT
================================================================ */
.scroll-hint {
  margin-top: 2.2rem;
  color: rgba(255, 45, 120, 0.45);
  animation: bob 1.6s ease-in-out infinite;
  cursor: default;
  user-select: none;
  display: inline-block;
}

.scroll-hint svg {
  width: 36px;
  height: 36px;
  display: block;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

/* ================================================================
   ARTICLES SECTION
================================================================ */
#articles {
  padding: 3rem 0 6rem;
  position: relative;
  z-index: 1;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.section-title {
  color: var(--pink);
  margin-bottom: 0.7rem;
}

.section-subtitle {
  color: var(--text-muted);
}

/* ================================================================
   TAG FILTER
================================================================ */
.filter-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s;
  align-self: center;
}

.filter-wrap:focus-within {
  border-bottom-color: var(--pink);
}


.tag-filter {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.15rem 0.3rem 0.15rem 0;
  outline: none;
  width: 140px;
}

.tag-filter::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

/* ================================================================
   CARDS GRID
================================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* ================================================================
   ARTICLE CARD
================================================================ */
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.75rem 1.5rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.35s, transform 0.35s, background 0.35s;
  opacity: 0;
  transform: translateY(44px);
}

.article-card.visible {
  animation: card-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes card-enter {
  to { opacity: 1; transform: translateY(0); }
}

.article-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(
    ellipse at 80% 20%,
    rgba(255, 45, 120, 0.07) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.article-card:hover {
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.45),
    0 0 30px rgba(255, 45, 120, 0.1);
  transform: translateY(-5px);
  background: var(--surface-hover);
}

.article-card:hover::after {
  opacity: 1;
}

/* ---- Card internals ---- */
.card-date {
  color: var(--pink);
  margin-bottom: 0.8rem;
}

.card-title {
  margin-bottom: 0.75rem;
  color: var(--text);
  transition: color 0.2s;
  position: relative;
  z-index: 1;
}

.article-card:hover .card-title {
  color: var(--pink-bright);
  animation: title-glitch 0.45s ease;
}

@keyframes title-glitch {
  0%   { transform: translateX(0);    opacity: 1;   }
  12%  { transform: translateX(-5px); opacity: 0.5; }
  28%  { transform: translateX(4px);  opacity: 1;   }
  44%  { transform: translateX(-3px); opacity: 0.75;}
  60%  { transform: translateX(3px);  opacity: 1;   }
  76%  { transform: translateX(-1px); opacity: 0.9; }
  100% { transform: translateX(0);    opacity: 1;   }
}

.card-excerpt {
  color: var(--text-muted);
  margin-bottom: 1.3rem;
  position: relative;
  z-index: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  position: relative;
  z-index: 1;
}


/* ================================================================
   TAGS
================================================================ */
/*
  tag-outer = sleeve
  tag       = front of sleeve (solid bg, z-index 2) — covers disc while inside
  disc-wrap = the disc, z-index 1, starts fully behind the tag's right side,
              slides right on hover until ~45% is still hidden behind the sleeve
*/
.tag-outer {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  user-select: none;
}

.tag-outer:hover .tag {
  background: #120025;
}

.tag {
  position: relative;
  z-index: 2;
  background: #0e0018;     /* solid — the sleeve must actually cover the disc */
  color: var(--pink);
  border: 1px solid rgba(255, 45, 120, 0.28);
  border-radius: 0;
  padding: 0.22rem 0.7rem 0.22rem 0.5rem;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s;
}

/* disc sits behind tag's right edge, slightly smaller than tag */
.tag-disc-wrap {
  position: absolute;
  right: 0;
  top: 2px;
  bottom: 2px;
  aspect-ratio: 1 / 1;
  z-index: 1;
  pointer-events: none;
  transform: translateX(0);                       /* start: fully behind tag */
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.tag-outer:hover .tag-disc-wrap {
  transform: translateX(55%);                     /* ~45% still hidden, 55% visible */
}

.tag-disc-wrap svg {
  width: 100%;
  height: 100%;
  stroke: var(--pink);
  fill: none;
  display: block;
  transform: rotate(-30deg);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.tag-outer:hover .tag-disc-wrap svg {
  transform: rotate(30deg);  /* 60° total — rolls out */
}

.article-card:hover .tag {
  background: #130022;     /* solid — must stay opaque so disc stays hidden */
}

/* ================================================================
   FOOTER
================================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

footer .highlight {
  color: var(--pink);
  text-shadow: 0 0 14px rgba(255, 45, 120, 0.55);
}

/* ================================================================
   PAGE LOADER (show.html)
================================================================ */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--pink);
  box-shadow: 0 0 12px var(--pink), 0 0 4px var(--pink);
  z-index: 200;
  animation: loader-advance 0.9s cubic-bezier(0.1, 0.6, 0.4, 1) forwards;
}

@keyframes loader-advance {
  from { width: 0; }
  to   { width: 82%; }
}

.page-loader.done {
  animation: loader-finish 0.3s ease forwards;
}

@keyframes loader-finish {
  0%   { width: 82%; opacity: 1; }
  60%  { width: 100%; opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

/* ================================================================
   SHOW PAGE
================================================================ */
.article-page {
  max-width: 740px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.article-page.is-loaded {
  opacity: 1;
  transform: none;
}

/* ================================================================
   CALENDAR SEGMENTS (joined, no separators)
================================================================ */
.calendar-display {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 1.8rem 0 1.6rem;
}

.cal-segment {
  background: var(--surface);
  border: 1px solid rgba(255, 45, 120, 0.45);
  padding: 0.3rem 0.7rem;
  text-align: center;
  position: relative;
  min-width: 52px;
  border-radius: 0;
  box-shadow:
    0 0 18px rgba(255, 45, 120, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  animation: cal-flip-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  transform-origin: center top;
}

.cal-segment:not(:first-child) { border-left: none; }
.cal-segment:first-child        { border-radius: 5px 0 0 5px; }
.cal-segment:last-child         { border-radius: 0 5px 5px 0; }

.cal-segment::after {
  content: '';
  position: absolute;
  left: 0;
  top: calc(50% - 1px);
  width: 100%;
  height: 1px;
  background: rgba(255, 45, 120, 0.35);
  box-shadow: 0 0 4px rgba(255, 45, 120, 0.2);
  pointer-events: none;
}

.cal-segment:nth-child(1) { animation-delay: 0.1s; }
.cal-segment:nth-child(2) { animation-delay: 0.25s; }
.cal-segment:nth-child(3) { animation-delay: 0.4s; }

@keyframes cal-flip-in {
  from { transform: rotateX(-90deg); opacity: 0; }
  to   { transform: rotateX(0deg);   opacity: 1; }
}

/* ================================================================
   ARTICLE AUTHOR SIGNATURE
================================================================ */
.article-author {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.article-author .author-name {
  color: var(--pink);
}

/* ================================================================
   ARTICLE TITLE & TAGS
================================================================ */
.article-title {
  color: var(--text);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.9rem;
  margin-bottom: 3rem;
}

/* ================================================================
   ARTICLE CONTENT
================================================================ */
.article-content {
  color: var(--text);
}

.article-content u {
  text-decoration: underline;
}

.article-content strong,
.article-content b {
  color: var(--pink-bright);
}

.article-content h2 {
  color: var(--text);
  margin: 2.5rem 0 1rem;
}

.article-content h3 {
  color: var(--text);
  margin: 2rem 0 0.75rem;
}

.article-content code {
  background: rgba(255, 45, 120, 0.08);
  border: 1px solid rgba(255, 45, 120, 0.22);
  border-radius: 3px;
  padding: 0.15em 0.45em;
  color: var(--pink-bright);
}

.article-content pre {
  background: #050010;
  border: 1px solid var(--border);
  border-left: 3px solid var(--pink);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.article-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

.article-content img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
  display: block;
}

.article-content blockquote {
  border-left: 3px solid var(--pink);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
}

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

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

.article-content li {
  margin-bottom: 0.4rem;
}

/* ================================================================
   EMPTY / ERROR
================================================================ */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .header-nav {
    gap: 1.5rem;
  }

  .header-inner {
    padding: 0 1.25rem;
  }

  .container {
    padding: 0 1.25rem;
  }

  .cal-segment {
    min-width: 46px;
    padding: 0.45rem 0.6rem;
  }

  .article-page {
    padding: 3rem 1.25rem 5rem;
  }
}
