/* ============================================================
   EXIT VELO — Main Stylesheet
   ============================================================ */

/* --- Variables --- */
:root {
  --bg:           #ffffff;
  --bg-subtle:    #f9fafb;
  --text:         #1a1a1a;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --nav-bg:       #1c2533;
  --nav-text:     #ffffff;
  --accent:       #e05c1a;
  --accent-dark:  #c44e14;
  --accent-light: #fef3ee;
  --link:         #1d4ed8;
  --link-hover:   #1e40af;

  --font-body: Georgia, 'Times New Roman', Times, serif;
  --font-ui:   -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --max-width:         1100px;
  --article-width:     720px;
  --spacing-section:   3rem;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* --- Navigation --- */
.nav {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--accent);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.nav__logo {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--nav-text);
  text-decoration: none;
}

.nav__logo span {
  color: var(--accent);
}

.nav__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav__links a {
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.nav__links a:hover {
  color: var(--nav-text);
  text-decoration: none;
}

/* --- Page Layout --- */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Homepage --- */
.home-header {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.home-header__title {
  font-family: var(--font-ui);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.home-header__description {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.6;
}

/* --- Article Cards --- */
.article-list {
  list-style: none;
}

.article-card {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 0.5rem;
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-card__category {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

.article-card__title {
  font-family: var(--font-ui);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.article-card__title a {
  color: var(--text);
  text-decoration: none;
}

.article-card__title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.article-card__excerpt {
  font-family: var(--font-body);
  font-size: 1rem;
  color: #374151;
  line-height: 1.65;
  max-width: 680px;
}

.article-card__readmore {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.article-card__readmore:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* --- Article Page --- */
.article-wrap {
  max-width: var(--article-width);
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-header__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.article-header__category {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.7rem;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

.article-header__date {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-header__title {
  font-family: var(--font-ui);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.article-header__subtitle {
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: #4b5563;
  line-height: 1.5;
  margin-bottom: 1rem;
  font-style: italic;
}

.article-header__byline {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --- Article Body --- */
.article-body {
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.78;
  color: var(--text);
}

.article-body p {
  margin-bottom: 1.4rem;
}

.article-body h2 {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
  color: var(--text);
}

.article-body strong {
  font-weight: 700;
}

.article-body em {
  font-style: italic;
}

/* --- Glossary Terms --- */
.term {
  border-bottom: 1px dotted var(--accent);
  cursor: pointer;
  color: inherit;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.term:hover,
.term:focus {
  color: var(--accent-dark);
  border-bottom-color: var(--accent-dark);
  outline: none;
}

/* --- Glossary Popover --- */
.glossary-popover {
  position: absolute;
  z-index: 500;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  padding: 1rem 1.25rem 1rem 1rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13);
  max-width: 320px;
  width: calc(100vw - 2rem);
}

.glossary-popover__term {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.4rem;
  padding-right: 1.5rem;
}

.glossary-popover__definition {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text);
}

.glossary-popover__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-muted);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  transition: color 0.1s, background 0.1s;
}

.glossary-popover__close:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

/* --- Glossary hint bar --- */
.glossary-hint {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 0.65rem 1rem;
  margin-bottom: 2rem;
  font-family: var(--font-ui);
  font-size: 0.825rem;
  color: #7c3b12;
  border-radius: 0 4px 4px 0;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2rem 1.5rem;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.825rem;
  color: var(--text-muted);
}

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

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

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

.not-found h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.not-found p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  :root { --spacing-section: 2rem; }

  .nav__inner { padding: 0 1rem; }
  .page        { padding: 0 1rem; }

  .home-header { padding: 1.75rem 0 1.5rem; }
  .home-header__title { font-size: 1.4rem; }

  .article-wrap { padding: 1.75rem 0 3rem; }
  .article-header__title { font-size: 1.65rem; }
  .article-body { font-size: 1.05rem; }

  .nav__links { display: none; }
}
