/* ============================================================
   justinjanson.com — Main Stylesheet
   ============================================================
   Aesthetic: Editorial minimalism. Warm neutral grays.
   Fonts: Cormorant Garamond (headings) + Jost (body/UI)

   Sections:
     1. Custom Properties (CSS Variables)
     2. Reset & Base
     3. Typography
     4. Layout & Containers
     5. Navigation
     6. Page: Home / Hero
     7. Page: Blog Index
     8. Page: Blog Post
     9. Page: Projects
    10. Page: About & Contact
    11. Footer
    12. Utilities & Transitions
    13. Responsive
   ============================================================ */


/* ============================================================
   1. Custom Properties
   ============================================================ */
:root {
  /* Color palette — warm neutral grays + one slate-blue accent */
  --bg:           #f7f6f4;   /* page background — warm near-white */
  --bg-subtle:    #efede9;   /* card/section backgrounds */
  --bg-hover:     #e8e6e2;   /* hover state for cards */
  --text:         #1a1917;   /* primary text — near-black warm */
  --text-muted:   #7d7b74;   /* secondary/meta text */
  --border:       #d4d1cb;   /* rule lines and borders */
  --accent:       #3b4f63;   /* muted slate blue — the one color pop */
  --accent-hover: #2c3d4f;   /* darker accent on hover */
  --tag-bg:       #e2e0db;   /* tag pill background */
  --tag-text:     #55534e;   /* tag pill text */

  /* Typography scale */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Jost', 'Helvetica Neue', sans-serif;

  /* Spacing rhythm — base 4px */
  --space-xs:  0.25rem;   /*  4px */
  --space-sm:  0.5rem;    /*  8px */
  --space-md:  1rem;      /* 16px */
  --space-lg:  1.5rem;    /* 24px */
  --space-xl:  2.5rem;    /* 40px */
  --space-2xl: 4rem;      /* 64px */
  --space-3xl: 6rem;      /* 96px */

  /* Max widths */
  --width-text:  720px;   /* comfortable reading column */
  --width-wide:  1100px;  /* wider layout for home/project grid */

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration: 180ms;
}


/* ============================================================
   2. Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  /* Smooth scroll for anchor links */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;           /* 16px base */
  font-weight: 300;
  line-height: 1.7;
  /* Subtle warm noise texture via repeating-linear-gradient */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23f7f6f4'/%3E%3Crect x='0' y='0' width='1' height='1' fill='%23f0efed' opacity='0.5'/%3E%3C/svg%3E");
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

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

/* Horizontal rule used as section divider */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-xl) 0;
}

/* Code blocks — for any technical content in posts */
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--bg-subtle);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: var(--text);
}

pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--space-lg);
  overflow-x: auto;
  margin: var(--space-lg) 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Blockquotes in posts */
blockquote {
  border-left: 2px solid var(--accent);
  margin: var(--space-lg) 0;
  padding: var(--space-sm) var(--space-lg);
  color: var(--text-muted);
  font-style: italic;
}


/* ============================================================
   3. Typography
   ============================================================ */

/* Display headings use the serif — large, editorial */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.125rem; font-weight: 600; }

/* Paragraph spacing inside content areas */
.content p { margin-bottom: var(--space-md); }
.content p:last-child { margin-bottom: 0; }

/* Lists inside content */
.content ul,
.content ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.content li {
  margin-bottom: var(--space-xs);
}

/* Inline strong/em */
strong { font-weight: 500; }
em { font-style: italic; }

/* Meta text — dates, categories, tags */
.meta {
  font-size: 0.8125rem;   /* 13px */
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Decorative eyebrow label above headings */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}


/* ============================================================
   4. Layout & Containers
   ============================================================ */

/* Outer wrapper — full width, centered content */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main content grows to push footer down */
main {
  flex: 1;
}

/* Standard reading-width container */
.container {
  width: 100%;
  max-width: var(--width-text);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* Wide container for home page grid and project grid */
.container--wide {
  width: 100%;
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* Section vertical breathing room */
.section {
  padding: var(--space-3xl) 0;
}

.section--sm {
  padding: var(--space-2xl) 0;
}


/* ============================================================
   5. Navigation
   ============================================================ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  /* Subtle glass-like opacity so content slides under */
  background: rgba(247, 246, 244, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: var(--space-md) var(--space-xl);
}

/* Site name / logo mark */
.site-nav__brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: opacity var(--duration) var(--ease);
}

.site-nav__brand:hover {
  color: var(--text);
  opacity: 0.6;
}

/* Nav links — right side */
.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.site-nav__links a {
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

.site-nav__links a:hover,
.site-nav__links a.active {
  color: var(--text);
}


/* ============================================================
   6. Page: Home / Hero
   ============================================================ */

/* Full-height hero section */
.hero {
  padding: var(--space-3xl) 0;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 57px); /* subtract nav height */
}

.hero__inner {
  width: 100%;
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.hero__name {
  /* Very large editorial name treatment */
  font-size: clamp(3.5rem, 12vw, 9rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: var(--space-xl);
}

/* Italic surname styling for visual interest */
.hero__name em {
  font-style: italic;
  color: var(--text-muted);
  font-weight: 300;
}

.hero__tagline {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 300;
  color: var(--text);
  max-width: 480px;
  line-height: 1.6;
  margin-bottom: var(--space-2xl);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: var(--space-md) var(--space-lg);
}

/* Thin rule before nav cards */
.hero__rule {
  width: 60px;
  height: 1px;
  background: var(--border);
  margin-bottom: var(--space-2xl);
}

/* Three section cards: Blog / Projects / About */
.hero__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;                /* 1px gap creates the grid line effect */
  background: var(--border);
  border: 1px solid var(--border);
  max-width: 680px;
}

.hero-card {
  background: var(--bg);
  padding: var(--space-xl) var(--space-lg);
  text-decoration: none;
  display: block;
  transition: background var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}

.hero-card:hover {
  background: var(--bg-hover);
  color: inherit;
}

/* Animated underline accent on hover */
.hero-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms var(--ease);
}

.hero-card:hover::after {
  transform: scaleX(1);
}

.hero-card__label {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: var(--space-xs);
}

.hero-card__desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.5;
}

/* Arrow indicator — appears on hover */
.hero-card__arrow {
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
  font-size: 1rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity var(--duration) var(--ease),
    transform var(--duration) var(--ease);
}

.hero-card:hover .hero-card__arrow {
  opacity: 1;
  transform: translateX(0);
}


/* ============================================================
   7. Page: Blog Index
   ============================================================ */

/* Page header used by blog and projects listing pages */
.page-header {
  padding: var(--space-2xl) 0 var(--space-xl);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-xl);
}

.page-header__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: var(--space-sm);
}

.page-header__subtitle {
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 300;
  background-color: #e3e0da;
  border: 1px solid #b8b4ad;
  border-radius: 3px;
  padding: var(--space-xs) var(--space-md);
  display: inline-block;
  margin-top: var(--space-xs);
}

/* Blog post list — simple vertical stack with ruled separators */
.post-list {
  list-style: none;
}

/* Each post entry */
.post-entry {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-subtle);
  margin-bottom: var(--space-sm);
  transition: background var(--duration) var(--ease);
}

.post-entry:hover {
  background: var(--bg-hover);
}

.post-entry__link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-lg);
  text-decoration: none;
  color: inherit;
}

.post-entry__link:hover .post-entry__title {
  color: var(--accent);
}

.post-entry__left {
  flex: 1;
  min-width: 0;
}

.post-entry__title {
  font-family: var(--font-display);
  font-size: 1.3125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
  transition: color var(--duration) var(--ease);
  /* Prevent long titles from overlapping date */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-entry__excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.5;
  /* Truncate at 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-entry__date {
  font-size: 0.8125rem;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 400;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.15em 0.6em;
}

/* "No posts yet" empty state */
.empty-state {
  padding: var(--space-2xl) 0;
  color: var(--text-muted);
  font-style: italic;
}


/* ============================================================
   8. Page: Blog Post (individual)
   ============================================================ */

.post-header {
  padding: var(--space-2xl) 0 var(--space-xl);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-xl);
}

.post-header__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  margin-bottom: var(--space-md);
}

.post-header__meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

/* Tag pills */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.2em 0.7em;
  border-radius: 2px;
}

/* The actual post body — rendered markdown content */
.post-body {
  padding: var(--space-xl) 0;
}

/* Markdown heading styles within post body */
.post-body h2 {
  font-size: 1.75rem;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.post-body h3 {
  font-size: 1.3125rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.post-body p {
  margin-bottom: var(--space-md);
  font-size: 1.0625rem; /* slightly larger for reading comfort */
  line-height: 1.8;
}

.post-body a {
  border-bottom: 1px solid var(--border);
  transition:
    color var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.post-body a:hover {
  border-color: var(--accent);
}

.post-body img {
  border-radius: 2px;
  margin: var(--space-xl) 0;
  border: 1px solid var(--border);
}

.post-body ul,
.post-body ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.post-body li {
  margin-bottom: var(--space-xs);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.post-body li > ul,
.post-body li > ol {
  margin-top: var(--space-xs);
  margin-bottom: var(--space-xs);
}

/* Video embeds — rendered from ![alt](video.mp4) syntax */
.video-wrap {
  margin: var(--space-xl) 0;
}

.video-wrap video {
  width: 100%;
  display: block;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: #000;
}

.video-caption {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 300;
  font-style: italic;
  margin-top: var(--space-sm);
  margin-bottom: 0;
}

/* Back navigation link above post */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--space-lg) 0;
  display: block;
  transition: color var(--duration) var(--ease);
}

.back-link:hover {
  color: var(--text);
}


/* ============================================================
   9. Page: Projects
   ============================================================ */

/* Project grid — 2 column on wide, 1 on narrow */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.project-card {
  background: var(--bg);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  transition: background var(--duration) var(--ease);
  position: relative;
  cursor: pointer;
}

.project-card:hover {
  background: var(--bg-hover);
}

/* Bottom accent line on card hover (matches hero-card) */
.project-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms var(--ease);
}

.project-card:hover::after {
  transform: scaleX(1);
}

/* Stretched link — ::after covers the whole card; actual link text is in the title */
.project-card__title-link {
  text-decoration: none;
  color: inherit;
}

.project-card__title-link::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
}

.project-card:hover .project-card__title-link {
  color: var(--accent);
}

.project-card__title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
  transition: color var(--duration) var(--ease);
  position: relative;
}

.project-card__desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.6;
  flex: 1;
  position: relative;
}

.project-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  position: relative;
}

.project-card__tags {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

/* Link row — sits above the stretched link overlay */
.project-card__links {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-xs);
  position: relative;
  z-index: 1;
}

/* Used on both card and detail page */
.project-detail__links {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin: var(--space-lg) 0;
}

/* Status dot indicator */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status--active::before { background: #5a9a72; }  /* muted green */
.status--wip::before    { background: #c4935a; }  /* muted amber */
.status--archive::before{ background: var(--border); }

/* Project link button */
.project-card__link {
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
  white-space: nowrap;
}

.project-card__link:hover {
  color: var(--accent-hover);
}


/* ============================================================
   10. Page: About & Contact
   ============================================================ */

.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-3xl);
  align-items: start;
}

.about-bio {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text);
}

.about-bio p {
  margin-bottom: var(--space-md);
}

.about-bio p:last-child {
  margin-bottom: 0;
}

/* Sidebar: contact + quick links */
.about-sidebar {
  position: sticky;
  top: calc(57px + var(--space-xl)); /* below sticky nav */
}

.about-sidebar__section {
  margin-bottom: var(--space-xl);
}

.about-sidebar__heading {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contact-list a {
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: color var(--duration) var(--ease);
}

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


/* ============================================================
   11. Footer
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl) 0;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--width-wide);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.site-footer__copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 300;
}

.site-footer__links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.site-footer__links a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

.site-footer__links a:hover {
  color: var(--text);
}


/* ============================================================
   12. Utilities & Transitions
   ============================================================ */

/* Fade-in on load — applied to main content areas */
.fade-in {
  animation: fadeIn 0.4s var(--ease) both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger children animations */
.fade-in:nth-child(1) { animation-delay: 0.05s; }
.fade-in:nth-child(2) { animation-delay: 0.10s; }
.fade-in:nth-child(3) { animation-delay: 0.15s; }
.fade-in:nth-child(4) { animation-delay: 0.20s; }

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


/* ============================================================
   13. Responsive
   ============================================================ */

/* Tablet — ~900px */
@media (max-width: 900px) {
  .hero__cards {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

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

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .about-sidebar {
    position: static;
  }
}

/* Mobile — ~600px */
@media (max-width: 600px) {
  :root {
    /* Tighten spacing on small screens */
    --space-xl:  1.75rem;
    --space-2xl: 2.5rem;
    --space-3xl: 3.5rem;
  }

  .container,
  .container--wide {
    padding: 0 var(--space-md);
  }

  .site-nav__inner {
    padding: var(--space-sm) var(--space-md);
  }

  .site-nav__links {
    gap: var(--space-lg);
  }

  .site-footer__inner {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
    padding: 0 var(--space-md);
  }

  .hero {
    min-height: auto;
    padding: var(--space-2xl) 0;
  }

  .hero__inner {
    padding: 0 var(--space-md);
  }

  .post-entry__link {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .post-entry__title {
    white-space: normal;
  }

  .post-entry__date {
    order: -1; /* date above title on mobile */
  }
}
