/*
  Field Notes section styles. Shared by the hub (/field-notes/) and every
  article page under /field-notes/. Editorial dark theme layered on top of the
  shared design system in styles.css. Uses real brand tokens (--accent terracotta,
  --primary teal) rather than the undefined tokens the older journal template assumed.

  Class families:
    .article-*  used by individual note pages
    .fn-*       used by the section hub
*/

::selection {
  background: var(--primary, #1E6F6B);
  color: var(--stone-50);
}

/* ============================================================
   NOTE PAGE - HERO
   ============================================================ */
.article-hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: flex-end;
  padding: 5rem 0;
  background:
    radial-gradient(ellipse 70% 50% at 80% 100%, rgba(30, 111, 107, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 0%, rgba(30, 111, 107, 0.2) 0%, transparent 50%),
    linear-gradient(170deg, var(--primary-800) 0%, var(--bg) 40%, var(--surface) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 3rem;
  text-align: center;
}

.article-category {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
}

.article-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  color: var(--stone-50);
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  color: var(--stone-500);
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================
   NOTE PAGE - BODY
   ============================================================ */
.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 5rem 3rem 6rem;
}

.article-body > * + * {
  margin-top: 2rem;
}

.article-body > p:first-of-type {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--stone-200);
  margin-bottom: 3rem;
}

.article-body p {
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--stone-300);
  max-width: 70ch;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 200;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  color: var(--stone-50);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--stone-50);
}

.article-body a {
  color: var(--primary-300);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s ease;
}

.article-body a:hover {
  color: var(--accent-light);
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
  font-size: 1.0625rem;
  line-height: 1.9;
}

.article-body li {
  margin-bottom: 0.75rem;
}

.article-body li::marker {
  color: var(--accent-light);
}

.article-body blockquote {
  position: relative;
  margin: 3rem 0;
  padding: 2rem 2.5rem;
  background: var(--surface);
  border-left: 3px solid var(--accent);
}

.article-body blockquote p {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 200;
  font-style: italic;
  line-height: 1.5;
  color: var(--stone-100);
  margin: 0;
}

.article-body strong {
  font-weight: 600;
  color: var(--stone-100);
}

.article-body hr {
  border: none;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 3rem auto;
  width: 60%;
}

.article-body > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 100;
  line-height: 0.8;
  padding-right: 0.75rem;
  padding-top: 0.25rem;
  color: var(--accent-light);
}

/* Inline code and code blocks for the more technical notes */
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface);
  color: var(--accent-light);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.article-body pre {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.article-body pre code {
  background: none;
  color: var(--stone-200);
  padding: 0;
  font-size: 0.875rem;
}

/* ============================================================
   NOTE PAGE - AUTHOR BOX
   ============================================================ */
.author-section {
  max-width: 720px;
  margin: 0 auto 5rem;
  padding: 2.5rem;
  background: var(--surface);
  border-top: 3px solid var(--primary);
}

.author-header {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone-500);
  margin-bottom: 1.25rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.author-details h4 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--stone-50);
  margin-bottom: 0.35rem;
}

.author-details p {
  font-size: 0.9375rem;
  color: var(--stone-500);
  line-height: 1.5;
  margin: 0;
}

/* ============================================================
   NOTE PAGE - COMPANION REPO CALLOUT
   ============================================================ */
.repo-callout {
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 1.75rem 2rem;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--accent);
}

.repo-callout .repo-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone-500);
  margin-bottom: 0.5rem;
}

.repo-callout p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--stone-300);
  margin: 0;
}

.repo-callout a {
  color: var(--primary-300);
  font-family: var(--font-mono);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   NOTE PAGE - RELATED
   ============================================================ */
.related-section {
  background: var(--surface);
  padding: 4rem 3rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.related-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.related-header {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone-500);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.related-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease;
}

.related-card:hover {
  transform: translateY(-4px);
}

.related-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--elevated);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  border-radius: 4px;
}

.related-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1.4;
  color: var(--stone-50);
  transition: color 0.3s ease;
}

.related-card:hover .related-title {
  color: var(--primary-300);
}

/* ============================================================
   SECTION HUB
   ============================================================ */
.fn-hero {
  position: relative;
  min-height: 65vh;
  display: flex;
  align-items: flex-end;
  padding: 6rem 0 4rem;
  background:
    radial-gradient(ellipse 70% 50% at 80% 100%, rgba(30, 111, 107, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 0%, rgba(30, 111, 107, 0.2) 0%, transparent 50%),
    linear-gradient(170deg, var(--primary-800) 0%, var(--bg) 40%, var(--surface) 100%);
}

.fn-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 3rem;
}

.fn-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
}

.fn-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 100;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--stone-50);
  margin-bottom: 1.5rem;
}

.fn-hero .lead {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--stone-300);
  max-width: 60ch;
}

.fn-intro {
  max-width: 720px;
  margin: 0 auto;
  padding: 4.5rem 3rem 2rem;
}

.fn-intro p {
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--stone-300);
}

.fn-intro p + p {
  margin-top: 1.5rem;
}

.fn-intro strong {
  font-weight: 600;
  color: var(--stone-100);
}

.fn-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 3rem 6rem;
}

.fn-list-header {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone-500);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.fn-note {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 2rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.3s ease;
}

.fn-note.is-live:hover {
  padding-left: 0.75rem;
}

.fn-note-num {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent-light);
  letter-spacing: 0.1em;
}

.fn-note-body h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.3;
  color: var(--stone-50);
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.fn-note.is-live:hover .fn-note-body h2 {
  color: var(--primary-300);
}

.fn-note-body p {
  font-size: 0.9875rem;
  line-height: 1.7;
  color: var(--stone-400);
  max-width: 60ch;
}

.fn-note-status {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-top: 0.35rem;
}

.fn-note-status.live { color: var(--accent-light); }
.fn-note-status.soon { color: var(--stone-600); }

.fn-note.is-soon { cursor: default; opacity: 0.78; }

.fn-repo {
  max-width: 900px;
  margin: 0 auto 6rem;
  padding: 2.25rem 2.5rem;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--accent);
}

.fn-repo .repo-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone-500);
  margin-bottom: 0.75rem;
}

.fn-repo p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--stone-300);
  margin: 0;
  max-width: 70ch;
}

.fn-repo a {
  color: var(--primary-300);
  font-family: var(--font-mono);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .article-hero { min-height: 60vh; padding: 4rem 0; }
  .hero-content { padding: 0 2rem; }
  .article-title { font-size: 2rem; }
  .article-body { padding: 4rem 2rem 5rem; }
  .author-section { margin: 0 2rem 4rem; padding: 2rem; }
  .repo-callout { margin: 0 2rem 3rem; }
  .related-section { padding: 3rem 2rem; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .article-hero { min-height: 50vh; padding: 3rem 0; }
  .article-title { font-size: clamp(1.5rem, 5vw, 2rem); }
  .article-meta { gap: 1rem; flex-wrap: wrap; justify-content: center; }
  .article-body h2 { font-size: 1.5rem; }
  .article-body blockquote { padding: 1.25rem; }
  .related-grid { gap: 1.5rem; }

  .fn-hero { min-height: 55vh; padding: 4.5rem 0 3rem; }
  .fn-hero-inner { padding: 0 2rem; }
  .fn-intro { padding: 3.5rem 2rem 1.5rem; }
  .fn-list { padding: 2rem 2rem 4rem; }
  .fn-note { grid-template-columns: 44px 1fr; }
  .fn-note-status { grid-column: 2; padding-top: 0.5rem; }
  .fn-repo { margin: 0 2rem 4rem; padding: 1.75rem; }
}

@media (max-width: 640px) {
  .article-hero { min-height: 40vh; padding: 2.5rem 0; }
  .hero-content { padding: 0 1.5rem; }
  .article-title { font-size: clamp(1.25rem, 5vw, 1.5rem); margin-bottom: 1.5rem; }
  .article-meta { flex-direction: column; gap: 0.5rem; font-size: 0.75rem; }
  .article-body { padding: 2.5rem 1.5rem 4rem; }
  .article-body > p:first-of-type { font-size: 1.125rem; }
  .article-body > p:first-of-type::first-letter { font-size: 3.5rem; }
  .article-body h2 { font-size: 1.375rem; }
  .article-body p { font-size: 1rem; }
  .article-body blockquote { padding: 1rem; margin: 1.5rem 0; }
  .article-body blockquote p { font-size: 1rem; }
  .article-body li { font-size: 1rem; }
  .author-section { margin: 0 1.5rem 3rem; padding: 1.5rem; }
  .repo-callout { margin: 0 1.5rem 3rem; }
  .author-info { flex-direction: column; text-align: center; }
  .related-section { padding: 2.5rem 1.5rem; }
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .fn-hero-inner { padding: 0 1.5rem; }
  .fn-intro { padding: 3rem 1.5rem 1rem; }
  .fn-list { padding: 1.5rem 1.5rem 3rem; }
  .fn-note { grid-template-columns: 38px 1fr; gap: 1rem; }
  .fn-repo { margin: 0 1.5rem 3rem; }
}
