/* ===================================================
   adamdaniel.ai — Cobalt Thermal Design System
   =================================================== */

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

:root {
  --bg-0: #04060f;
  --bg-1: #060d1f;
  --bg-2: #0a1530;
  --bg-3: #111e40;
  --accent: #285aff;
  --accent-dim: #1a3abf;
  --accent-glow: rgb(40 90 255 / 28%);
  --text-primary: #d8e4ff;
  --text-secondary: #c8d4f0;
  --text-dim: #8ab0e8;
  --text-bright: #fff;
  --border: #1a2a5e;
  --border-bright: #2a3a7e;
  --mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --sans: 'Helvetica Neue', 'Arial', sans-serif;
  --radius: 4px;
  --radius-lg: 8px;
  --transition: 0.2s ease;
}

html, body {
  height: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--text-secondary);
  font-family: var(--sans);
  line-height: 1.6;
  animation: thermal 40s ease-in-out infinite alternate;
}

@keyframes thermal {
  0%   { background-color: #04060f; }
  50%  { background-color: #060d1f; }
  100% { background-color: #03040c; }
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, var(--accent-glow), transparent 70%);
  animation: warmth 8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes warmth {
  0% {
    opacity: 0.05;
    transform: scale(0.7);
  }

  100% {
    opacity: 0.6;
    transform: scale(1.3);
  }
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
}

@keyframes text-thermal {
  0%   { color: var(--text-dim); }
  100% { color: var(--text-primary); }
}

@keyframes border-thermal {
  0%   { border-color: var(--text-dim); }
  100% { border-color: var(--text-primary); }
}

/* ── Typography ─────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 200;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 6vw, 4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

p { margin-bottom: 1.2rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

a:hover, a:focus-visible {
  color: var(--text-bright);
  border-bottom-color: var(--text-bright);
}

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

code, pre {
  font-family: var(--mono);
  font-size: 0.875em;
}

pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

code {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.15em 0.4em;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  color: var(--text-dim);
  font-style: italic;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

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

/* ── Layout ─────────────────────────────────────── */

.site-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.container--wide {
  max-width: 1100px;
}

main {
  flex: 1;
  padding: 4rem 0;
}

/* ── Site Header ────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgb(4 6 15 / 85%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

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

.site-logo {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  border: none;
}

.site-logo:hover {
  color: var(--text-bright);
  border: none;
}

.site-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.site-nav a {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--mono);
  border: none;
  color: var(--text-dim);
  animation: text-thermal 8s ease-in-out infinite alternate;
}

.site-nav a:hover {
  color: var(--text-bright);
  border: none;
}

.site-nav a.active {
  color: var(--text-primary);
}

/* ── Site Footer ────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
}

.site-footer p {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--text-dim);
  animation: text-thermal 8s ease-in-out infinite alternate;
  margin: 0;
}

/* ── Hero (homepage) ────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  text-align: center;
  padding: 2rem;
}

.hero-name {
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 200;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--text-primary);
}

.hero-role {
  font-size: clamp(0.7rem, 1.6vw, 0.8rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 0.4rem;
  animation: text-thermal 8s ease-in-out infinite alternate;
}

.hero-links {
  margin-top: 2.5rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-link {
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--mono);
  border-bottom: 1px solid;
  padding-bottom: 2px;
  animation:
    text-thermal   8s ease-in-out infinite alternate,
    border-thermal 8s ease-in-out infinite alternate;
}

.hero-link:hover, .hero-link:focus-visible {
  color: var(--text-bright) !important;
  border-color: var(--text-bright) !important;
}

/* ── Page Header ────────────────────────────────── */

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

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header .subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--text-dim);
}

/* ── Post List ──────────────────────────────────── */

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.post-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2.5rem;
}

.post-item:last-child {
  border-bottom: none;
}

.post-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.post-date, .post-reading-time {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--text-dim);
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-pill {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--mono);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.2em 0.6em;
  color: var(--text-dim);
  transition: border-color var(--transition), color var(--transition);
}

.tag-pill:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.post-title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 200;
  margin-bottom: 0.6rem;
}

.post-title a {
  color: var(--text-primary);
  border: none;
}

.post-title a:hover {
  color: var(--text-bright);
  border: none;
}

.post-excerpt {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ── Tag list / Tag cloud ───────────────────────── */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag-cloud .tag-pill {
  font-size: 0.72rem;
  padding: 0.3em 0.8em;
}

.tag-cloud-count {
  color: var(--text-dim);
  margin-left: 0.3em;
}

.tag-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.tag-list-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  transition: border-color var(--transition);
}

.tag-list-item:hover {
  border-color: var(--border-bright);
}

.tag-list-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  border: none;
  color: var(--text-primary);
}

.tag-list-link:hover {
  border: none;
  color: var(--text-bright);
}

.tag-list-name {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.tag-list-count {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  font-family: var(--mono);
  color: var(--text-dim);
}

.tag-list-description {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Single Post ────────────────────────────────── */

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

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

.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.post-content h2 {
  margin: 2.5rem 0 1rem;
}

.post-content h3 {
  margin: 2rem 0 0.8rem;
}

.post-content ul, .post-content ol {
  margin: 1rem 0 1.2rem 1.5rem;
}

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

.post-content a {
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  animation: text-thermal 8s ease-in-out infinite alternate,
             border-thermal 8s ease-in-out infinite alternate;
}

.post-content a:hover {
  color: var(--text-bright);
  border-bottom-color: var(--text-bright);
}

/* HTML Embed wrapper emitted by the Decap "HTML Embed" editor component
   (admin/editor-component-html-embed.js). Vertical rhythm only — author
   markup inside the wrapper styles itself. */
.post-embed {
  display: block;
  margin: 1.5rem 0;
}

.featured-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

/* ── Projects Grid ──────────────────────────────── */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  transition: border-color var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-glow), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card-inner {
  position: relative;
  z-index: 1;
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

.project-card h3 a {
  color: var(--text-primary);
  border: none;
}

.project-tech {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.project-description {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4em 0.9em;
  transition: border-color var(--transition), color var(--transition);
}

.project-link:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.featured-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.2em 0.5em;
  z-index: 2;
}

/* ── Page content ───────────────────────────────── */

.page-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.page-content h2 {
  margin: 2.5rem 0 1rem;
}

.page-content ul, .page-content ol {
  margin: 1rem 0 1.2rem 1.5rem;
}

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

.page-content a {
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  animation: text-thermal 8s ease-in-out infinite alternate,
             border-thermal 8s ease-in-out infinite alternate;
}

/* ── Page not found ─────────────────────────────── */

.page-not-found {
  text-align: center;
  padding-top: 2rem;
  border-bottom: none;
}

.page-not-found__code {
  font-family: var(--mono);
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: 200;
  letter-spacing: 0.08em;
  color: var(--accent);
  line-height: 1;
  margin: 0;
  animation: text-thermal 8s ease-in-out infinite alternate;
}

.page-not-found__message {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  margin-top: 1rem;
}

.page-not-found__actions {
  text-align: center;
  margin-top: 2rem;
}

/* ── Utility ────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ── Feed Link (RSS icon) ───────────────────────── */

.feed-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  vertical-align: middle;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  background: transparent;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.feed-link:hover,
.feed-link:focus-visible {
  color: #ee802f; /* canonical RSS orange — appears only on intent */
  border-color: #ee802f;
  background: rgb(238 128 47 / 8%);
}

.feed-link-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.page-header-with-feed {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  margin-bottom: 0.5rem;
}

.page-header-with-feed h1,
.page-header-with-feed h2 {
  margin-bottom: 0;
}

/* ── Share Row ──────────────────────────────────── */

.share-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}

.share-row-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--mono);
  color: var(--text-dim);
  margin-right: 0.4rem;
}

.share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.share-link svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.share-link:hover,
.share-link:focus-visible {
  color: var(--text-bright);
  border-color: var(--border-bright);
  background: var(--bg-2);
}

.share-icon-success { display: none; }
.share-copy.share-copied .share-icon-default { display: none; }
.share-copy.share-copied .share-icon-success { display: block; }

.share-copy.share-copied {
  color: var(--text-bright);
  border-color: var(--accent);
}

@media (forced-colors: active) {
  .feed-link,
  .share-link {
    border-color: ButtonText;
  }

  .feed-link:hover,
  .feed-link:focus-visible,
  .share-link:hover,
  .share-link:focus-visible {
    border-color: Highlight;
    color: Highlight;
  }
}

/* ── Responsive ─────────────────────────────────── */

@media (width <= 640px) {
  .site-nav {
    gap: 1.2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 2.5rem 0;
  }
}
