/* ===================================
   MODERN PERSONAL SITE STYLES
   =================================== */

/* CSS CUSTOM PROPERTIES (Variables) */
:root {
  /* Colors */
  --color-bg: #0a0a0a;
  --color-text: #e8e8e8;
  --color-text-muted: #a8a8a8;
  --color-accent: #5eb3f6;
  --color-accent-hover: #7ac3f8;
  --color-accent-glow: rgba(94, 179, 246, 0.2);
  --color-border: #2a2a2a;
  
  /* Typography */
  --font-primary: 'Encode Sans Condensed', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --font-size-h1: clamp(1.75rem, 1.5rem + 1.25vw, 2.5rem);
  --font-size-h2: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --font-size-small: 0.875rem;
  --line-height: 1.7;
  
  /* Spacing */
  --space-xs: clamp(0.5rem, 0.45rem + 0.25vw, 0.75rem);
  --space-sm: clamp(1rem, 0.95rem + 0.25vw, 1.25rem);
  --space-md: clamp(1.5rem, 1.4rem + 0.5vw, 2rem);
  --space-lg: clamp(2rem, 1.8rem + 1vw, 3rem);
  --space-xl: clamp(3rem, 2.5rem + 2.5vw, 5rem);
  
  /* Layout */
  --max-width: 70rem;
  --content-width: 40rem;
  
  /* Animation */
  --transition-base: 0.2s ease-out;
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* FONT FACE DECLARATIONS */
@font-face {
  font-display: swap;
  font-family: 'Encode Sans Condensed';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/encode-sans-condensed-v10-latin/encode-sans-condensed-v10-latin-regular.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Encode Sans Condensed';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/encode-sans-condensed-v10-latin/encode-sans-condensed-v10-latin-700.woff2') format('woff2');
}

/* RESET & BASE STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* TYPOGRAPHY */
h1, h2, h3 {
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--font-size-h1);
  margin-bottom: var(--space-sm);
}

h2 {
  font-size: var(--font-size-h2);
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

p {
  margin-bottom: var(--space-sm);
}

/* LINKS */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
}

a:hover {
  color: var(--color-accent-hover);
  text-shadow: 0 0 8px var(--color-accent-glow);
}

/* Different link styles */
a.link-external::after {
  content: '↗';
  font-size: 0.75em;
  margin-left: 0.25em;
  display: inline-block;
  transition: transform var(--transition-base);
}

a.link-external:hover::after {
  transform: translate(2px, -2px);
}

/* Internal links get underline animation */
a.link-internal {
  display: inline-block;
  position: relative;
}

a.link-internal::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-accent);
  transition: width var(--transition-base);
}

a.link-internal:hover::after {
  width: 100%;
}

/* LAYOUT */
.wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.content-grid {
  width: 100%;
  display: grid;
  gap: var(--space-lg);
  align-items: start;
}

/* HEADER */
.site-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.home-link {
  color: var(--color-text);
  text-decoration: none;
  display: inline-block;
  transition: all var(--transition-smooth);
}

.home-link:hover {
  color: var(--color-accent);
  text-shadow: none;
  transform: translateX(4px);
}

/* CONTENT SECTIONS */
.intro-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.intro-section {
  position: relative;
  padding-left: var(--space-md);
  border-left: 1px solid var(--color-border);
  transition: border-color var(--transition-base);
}

.intro-section:hover {
  border-color: var(--color-accent-glow);
}

/* Time indicators */
.intro-section[data-time]::before {
  content: attr(data-time);
  position: absolute;
  left: calc(var(--space-md) * -0.5);
  top: 0.5em;
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 0 0.5em;
  font-family: monospace;
}

.highlight {
  color: var(--color-accent);
  font-weight: 400;
}

.emphasis-today {
  font-style: italic;
  background: linear-gradient(to right, var(--color-accent), var(--color-accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* IMAGE SECTION */
.profile-figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.profile-image {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(20%);
  transition: filter var(--transition-smooth);
}

.profile-figure:hover .profile-image {
  filter: grayscale(0%);
}

.profile-caption {
  margin-top: var(--space-sm);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  line-height: 1.5;
}

.profile-caption a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* RESPONSIVE DESIGN */
@media (min-width: 768px) {
  .intro-section {
    padding-left: var(--space-lg);
  }
  
  .intro-section[data-time]::before {
    left: calc(var(--space-lg) * -0.5);
  }
}

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
  }
  
  .text-content {
    order: 2;
  }
  
  .image-content {
    order: 1;
  }
}

/* ANIMATION ON LOAD */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header {
  animation: fadeInUp 0.6s ease-out;
}

.intro-section {
  animation: fadeInUp 0.8s ease-out backwards;
}

.intro-section:nth-child(1) { animation-delay: 0.1s; }
.intro-section:nth-child(2) { animation-delay: 0.2s; }
.intro-section:nth-child(3) { animation-delay: 0.3s; }

.profile-figure {
  animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

/* BLOG POST STYLES */
.blog-content {
  max-width: var(--content-width);
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

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

.blog-post {
  margin-top: var(--space-lg);
}

.post-header {
  margin-bottom: var(--space-xl);
  text-align: center;
}

.post-title {
  font-size: var(--font-size-h1);
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}

.post-date {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  font-family: monospace;
}

.post-content {
  font-size: var(--font-size-base);
  line-height: 1.8;
}

.post-content h2 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.post-content p {
  margin-bottom: var(--space-md);
}

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

/* Blog figures */
.blog-figure {
  margin: var(--space-xl) 0;
  text-align: center;
}

.blog-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.blog-figure figcaption {
  margin-top: var(--space-sm);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

/* Video styles */
video {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: var(--space-lg) 0;
  border-radius: 4px;
}

.post-footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.post-meta {
  font-size: var(--font-size-small);
}

/* SPECIAL PAGE ELEMENTS */

/* Video container for responsive YouTube embeds */
.video-figure {
  margin: var(--space-xl) 0;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  background: var(--color-bg);
  border-radius: 4px;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Timeline styles for about page */
.timeline-list {
  list-style: none;
  padding-left: 0;
  margin-top: var(--space-md);
}

.timeline-list li {
  margin-bottom: var(--space-xs);
  padding-left: var(--space-lg);
  position: relative;
}

.timeline-year {
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-family: monospace;
  font-size: var(--font-size-small);
}

/* Emoji list styles for now page */
.emoji-list {
  list-style: none;
  padding-left: 0;
  margin: var(--space-md) 0;
}

.emoji-list li {
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: flex-start;
}

.emoji {
  font-size: 1.2em;
  margin-right: var(--space-sm);
  flex-shrink: 0;
}

/* Now page intro */
.now-page-intro {
  background: var(--color-border);
  padding: var(--space-sm);
  border-radius: 4px;
  margin-bottom: var(--space-lg);
}

/* Audio embeds */
.audio-embed {
  margin: var(--space-md) 0;
  border-radius: 4px;
  overflow: hidden;
}

.audio-attribution {
  font-size: 10px;
  color: var(--color-text-muted);
  line-height: 1.4;
  padding: var(--space-xs);
  background: var(--color-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-attribution a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

/* BLOG INDEX STYLES */
.blog-posts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.blog-post-item {
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  transition: all var(--transition-base);
}

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

.blog-post-item:hover {
  padding-left: var(--space-sm);
}

.blog-post-item h3 {
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-h2);
}

.blog-post-item .post-date {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  font-family: monospace;
}

.post-excerpt {
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* SPECIAL PAGES (USES, BOOKS, ETC) */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md);
}

.page-header {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-border);
}

.page-title {
  font-size: var(--font-size-h1);
  margin-bottom: var(--space-sm);
}

.page-date {
  display: block;
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
  font-family: monospace;
}

.page-section {
  margin-bottom: var(--space-xl);
}

.page-section h2 {
  margin-bottom: var(--space-md);
  color: var(--color-accent);
}

.page-section h3 {
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
}

.page-section h4 {
  margin-top: var(--space-sm);
  margin-bottom: var(--space-xs);
  color: var(--color-text-muted);
}

/* Uses page specific */
.uses-list {
  list-style: none;
  padding-left: 0;
}

.uses-list li {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-md);
  position: relative;
}

.uses-list li:before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

/* Books page specific */
.book-entry {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.book-entry:last-child {
  border-bottom: none;
}

.book-entry h3 {
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-h3);
}

.book-author {
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: var(--space-xs);
}

.book-notes {
  margin-top: var(--space-sm);
}

.reading-list {
  margin-bottom: var(--space-md);
}

/* Page figures (for special pages) */
.page-figure {
  margin: var(--space-lg) 0;
  text-align: center;
}

.page-figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.page-figure figcaption {
  margin-top: var(--space-sm);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
  :root {
    --font-size-h1: 2rem;
    --font-size-h2: 1.5rem;
    --font-size-h3: 1.25rem;
  }
  
  .wrapper {
    padding: var(--space-sm);
  }
}

/* BACKWARDS COMPATIBILITY FOR OTHER PAGES */
/* Support for old HTML structure */
.Bryan-info {
  max-width: var(--content-width);
}

.Bryan-info h2 {
  font-size: var(--font-size-h2);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.Bryan-info p {
  margin-bottom: var(--space-sm);
}

.Bryan-fig {
  margin: var(--space-lg) 0;
}

.Bryan-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  filter: grayscale(20%);
  transition: filter var(--transition-smooth);
}

.Bryan-img:hover {
  filter: grayscale(0%);
}

/* Blog-specific styles */
.blog-fig {
  margin: var(--space-lg) 0;
}

.blog-fig img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* Video styles for blog */
video {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin: var(--space-md) 0;
}

/* HR style for older pages */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-md) 0;
}

/* List styles */
.no-bullets {
  list-style: none;
}

/* Section spacing for blog posts */
section {
  margin-bottom: var(--space-lg);
}

/* Small text (dates, captions) */
small {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
}

/* Fix for old header link structure */
h1 a {
  color: var(--color-text);
  text-decoration: none;
  display: inline-block;
  transition: all var(--transition-smooth);
}

h1 a:hover {
  color: var(--color-accent);
  text-shadow: none;
  transform: translateX(4px);
}

/* Responsive adjustments for old structure */
@media (min-width: 1024px) {
  .wrapper:has(.Bryan-info) {
    display: block;
  }
  
  .Bryan-info {
    width: 50%;
    float: right;
    padding-left: var(--space-lg);
  }
  
  .Bryan-fig {
    width: 50%;
    float: left;
    padding-right: var(--space-lg);
  }
  
  /* Clear floats */
  .wrapper::after {
    content: "";
    display: table;
    clear: both;
  }
}

/* PRINT STYLES */
@media print {
  body {
    color: black;
    background: white;
  }
  
  .profile-image,
  .Bryan-img {
    filter: grayscale(100%);
  }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}