/* -------------------------------------------------
   Fonts (swap to self-host later)
-------------------------------------------------- */

/* @import url('https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600&family=Newsreader:opsz,wght@6..72,400;6..72,600&family=IBM+Plex+Mono:wght@400;500&display=swap'); */


/* -------------------------------------------------
   Base tokens (will be overridden per theme)
-------------------------------------------------- */
/* Base (dark) */
:root {
  /* Layout scales */
  --content-max: clamp(600px, 78vw, 860px);
  --content-padding: clamp(16px, 2.5vw, 24px);

  /* Typography */
  --font-sans: "Jost", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif: "Playwrite US Modern", cursive; /* new script / signature font */


  /* Colors (default = dark) */
  --bg: #4f6d84;
  --fg: #f5f5f5;
  --muted: #d0cfcf;
  --accent: #f0c6e7;
  /* --card: #15456a; */
  --card: #88687f13;
  --border: #c8adc3; 
  /* --header-bg: rgba(11, 18, 32, 0.7); */

  /* Extras */
  --code-bg: rgba(255, 255, 255, 0.04);
  --focus: #fab2ec35;

  color-scheme: dark light;
}

/* Light theme override (manual or JS-applied) */
html[data-theme="light"] {
  --bg: #d6effd;
  --fg: #0a0a0a;
  --muted: #808080;
  --accent: #5e4eca;
  --card:#bdb6eb0f; 
  /* --card: hsla(32, 29%, 91%, 0.848); */
  --border: #bdb6eb;
  /* --header-bg: rgba(250, 249, 246, 0.8); */
  --code-bg: rgba(0, 0, 0, 0.04);
  color-scheme: light dark;
}

/* -------------------------------------------------
   Resets & base
-------------------------------------------------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  line-height: 1.6;
  /* font-weight: 00; */
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 .5rem;
}
h1 { font-size: 1.5rem; line-height: 1.06; margin-top: 1.25rem; }
h2 { font-size: 1.25rem; line-height: 1.12; margin-top: 1.5rem; padding-bottom: .25rem; border: none; font-family: var(--font-sans); font-weight: 300;}

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: .95em;
  background: none;
  /* border: 1px solid var(--border); */
  /* border-radius: 6px; */
}
code, kbd { margin: 0; padding: 0; }
pre { margin: 0; padding: 0; overflow: auto; }

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
a:hover { border-color: currentColor; }
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Section rules */
hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  opacity: 0.9;
  margin: 2.5rem 0;
}

/* Utility */
.small { font-size: 0.9rem; color: var(--muted); }
.post-title:hover { text-decoration: underline; }

/* -------------------------------------------------
   Layout
-------------------------------------------------- */
.container {
  margin: 0 auto;
  padding: 1.25rem var(--content-padding);
}

.content,
.header { /* single source of truth for width */
  width: min(var(--content-max), calc(100vw - 2 * var(--content-padding)));
  margin: 0 auto;
}

.header .brand {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: .01em;
  font-size: 1.5rem
}

.content > .wide { max-width: none; }

/* Header (sticky) */
header {
  position: sticky;
  top: 0;
  /* border-bottom: 1px solid var(--border); */
  /* background: var(--header-bg); */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
}

.header {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 6vw, 5rem); /* responsive breathing room */
  /* font-weight: 300; */
  /* font-size: 2rem; */
}

/* Brand + tagline */
.brand { font-weight: 700; letter-spacing: 0.2px; font-size: 1.1rem; }
.tagline { margin-left: 0.5rem; font-size: 0.95rem; color: var(--muted); } /* is it being used? */

/* Nav */
.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 1.5rem;
}

/* Sticky footer push */
main.container { flex: 1; }

.footer { border-top: 1px solid var(--border); }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.card {
  /* background: var(--card); */
  border: 1px solid var(--card);
  /* border: none; */
  border-radius: 1epx;
  padding: 1rem;
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 1.5rem;
  line-height: 1;
  /* border-radius: 10px; */
  /* border: 1px solid var(--border); */
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  /* color: var(--fg); */
  cursor: pointer;
  transition: transform .1s ease;
}
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: inline; }
html[data-theme="light"] .theme-toggle .sun { display: inline; }
html[data-theme="light"] .theme-toggle .moon { display: none; }

/* -------------------------------------------------
   Motion preferences
-------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
