/* ============================================================================
   Modern Accessible Theme
   Based on original color scheme with modern CSS and accessibility features
   ============================================================================ */

/* ============================================================================
   CSS Custom Properties (Design Tokens)
   ============================================================================ */
:root {
  /* Colors - preserved from original */
  --color-primary: #1c097d; /* Author name purple */
  --color-accent: rgb(153, 27, 27); /* Links red */
  --color-text-primary: rgb(24, 24, 27);
  --color-text-secondary: rgb(82, 82, 91);
  --color-text-muted: rgb(161, 161, 170);
  --color-text-meta: rgb(113, 113, 122);
  --color-social: #526d7a;
  --color-heading-blue: #33a;
  --color-heading-purple: rgb(51, 51, 119);
  --color-job-title: rgb(58, 58, 206);
  --color-job-meta: rgb(16, 16, 83);
  --color-bg: #fcfcfc;
  --color-bg-white: #ffffff;
  --color-bg-highlight: rgba(28, 9, 125, 0.03);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.25rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3.75rem;

  /* Typography */
  --font-primary: "Roboto Slab", "Roboto", "Lato", sans-serif;
  --font-secondary: "Roboto", sans-serif;
  --font-accent: "Lato", sans-serif;

  /* Layout */
  --container-max-width: 800px;
  --border-radius: 0.5rem;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
}

/* ============================================================================
   CSS Reset & Base Styles
   ============================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-primary);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.25rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ============================================================================
   Accessibility - Screen Reader Only
   ============================================================================ */
.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;
}

/* ============================================================================
   Typography
   ============================================================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: var(--spacing-sm);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
}

h2 {
  font-family: var(--font-accent), serif;
  font-weight: bold;
  color: var(--color-heading-blue);
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
}

h3 {
  font-family: var(--font-accent), serif;
  color: var(--color-heading-blue);
  font-size: clamp(1.25rem, 1.1rem + 0.75vw, 1.75rem);
}

h4 {
  text-decoration: underline;
  font-family: "Roboto Slab", serif;
  color: rgb(51, 51, 119);
}

h5 {
  font-family: var(--font-secondary), serif;
  color: rgb(58, 58, 206);
}

h6 {
  font-family: var(--font-secondary), serif;
  color: rgb(16, 16, 83);
}

p {
  margin-top: 0;
  margin-bottom: var(--spacing-sm);
}

/* ============================================================================
   Links
   ============================================================================ */
a {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--color-accent);
  outline: none;
}

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

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

.content a:hover,
.content a:focus {
  text-decoration-thickness: 2px;
}

/* ============================================================================
   Layout
   ============================================================================ */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  flex: 1;
}

/* ============================================================================
   Header
   ============================================================================ */
.header {
  text-align: center;
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
}

.headshot {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 0 auto var(--spacing-md);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition:
    transform var(--transition-normal),
    box-shadow var(--transition-normal);
}

.headshot:hover {
  transform: scale(1.05);
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.author {
  color: var(--color-primary);
  font-family: "Roboto Slab", serif;
  margin: 0;
}

/* ============================================================================
   Info Section
   ============================================================================ */
.info {
  text-align: center;
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.description {
  font-family: var(--font-secondary);
  font-weight: 200;
  color: var(--color-text-muted);
  font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
  line-height: 1.3;
}

.description p {
  margin-bottom: 0.25rem;
}

/* Description pairs (static fallback) */
.description-pair {
  margin-bottom: 0.25rem;
}

.description-pair .adjective {
  color: var(--color-text-muted);
}

.description-pair .noun {
  color: var(--color-text-muted);
  margin-left: 0.5rem;
}

/* Description carousel (two independent columns) */
.description-carousel {
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.carousel-inner {
  position: relative;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  min-height: 160px;
}

.carousel-column {
  position: relative;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  min-width: 100px;
  flex: 1;
}

@media (min-width: 600px) {
  .carousel-column {
    min-width: 150px;
    flex: 0 1 auto;
  }
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-item {
  font-family: var(--font-secondary);
  font-weight: 300;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  opacity: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  transition:
    opacity 0.3s ease-out,
    transform 0.8s ease-out;
  white-space: nowrap;
  pointer-events: none;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

#adjectives-track .carousel-item {
  text-align: right;
  left: 100%;
  transform: translate3d(-100%, -50%, 0) scale(0.77);
  transform-origin: right center;
}

#adjectives-track .carousel-item.carousel-focus {
  opacity: 1;
  transform: translate3d(-100%, -50%, 0) scale(1.36);
}

#adjectives-track .carousel-item.carousel-above {
  opacity: 0.5;
  transform: translate3d(-100%, calc(-50% - 35px), 0) scale(1);
}

#adjectives-track .carousel-item.carousel-below {
  opacity: 0.5;
  transform: translate3d(-100%, calc(-50% + 35px), 0) scale(1);
}

#adjectives-track .carousel-item.carousel-far-above {
  opacity: 0.25;
  transform: translate3d(-100%, calc(-50% - 65px), 0) scale(0.77);
}

#adjectives-track .carousel-item.carousel-far-below {
  opacity: 0.25;
  transform: translate3d(-100%, calc(-50% + 65px), 0) scale(0.77);
}

#adjectives-track .carousel-item.carousel-hidden,
#adjectives-track .carousel-item.carousel-entering {
  transform: translate3d(-100%, calc(-50% + 95px), 0) scale(0.64);
}

#adjectives-track .carousel-item.carousel-exiting {
  transform: translate3d(-100%, calc(-50% - 95px), 0) scale(0.64);
}

#nouns-track .carousel-item {
  text-align: left;
  left: 0%;
  transform: translate3d(0%, -50%, 0) scale(0.77);
  transform-origin: left center;
}

#nouns-track .carousel-item.carousel-focus {
  opacity: 1;
  transform: translate3d(0%, -50%, 0) scale(1.36);
}

#nouns-track .carousel-item.carousel-above {
  opacity: 0.5;
  transform: translate3d(0%, calc(-50% - 35px), 0) scale(1);
}

#nouns-track .carousel-item.carousel-below {
  opacity: 0.5;
  transform: translate3d(0%, calc(-50% + 35px), 0) scale(1);
}

#nouns-track .carousel-item.carousel-far-above {
  opacity: 0.25;
  transform: translate3d(0%, calc(-50% - 65px), 0) scale(0.77);
}

#nouns-track .carousel-item.carousel-far-below {
  opacity: 0.25;
  transform: translate3d(0%, calc(-50% + 65px), 0) scale(0.77);
}

#nouns-track .carousel-item.carousel-hidden,
#nouns-track .carousel-item.carousel-entering {
  transform: translate3d(0%, calc(-50% + 95px), 0) scale(0.64);
}

#nouns-track .carousel-item.carousel-exiting {
  transform: translate3d(0%, calc(-50% - 95px), 0) scale(0.64);
}

/* Focus - largest, center */
.carousel-item.carousel-focus {
  opacity: 1;
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--color-text);
}

/* One step away - medium size */
.carousel-item.carousel-above {
  opacity: 0.5;
  font-size: 1.2rem;
  font-weight: 300;
}

.carousel-item.carousel-below {
  opacity: 0.5;
  font-size: 1.2rem;
  font-weight: 300;
}

/* Two steps away - smallest */
.carousel-item.carousel-far-above {
  opacity: 0.25;
  font-size: 1.2rem;
  font-weight: 300;
}

.carousel-item.carousel-far-below {
  opacity: 0.25;
  font-size: 1.2rem;
  font-weight: 300;
}

.carousel-item.carousel-hidden {
  opacity: 0;
  font-weight: 300;
  font-size: 1.2rem;
}

/* Accessibility: visually hidden but available to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .description-carousel {
    display: none !important;
  }

  .description-pair {
    display: block !important;
  }
}

/* ============================================================================
   Social Links
   ============================================================================ */
.social {
  text-align: center;
  margin: 0 0 0 0;
}

.social nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.social a {
  color: var(--color-social);
  font-size: 1.5rem;
  transition:
    color var(--transition-fast),
    transform var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
}

.social a:hover,
.social a:focus {
  color: var(--color-accent);
  transform: translateY(-2px);
}

/* Custom SVG icons styled to match FontAwesome */
.svg-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  fill: currentColor;
  vertical-align: -0.125em;
  font-size: inherit;
}

.social a .svg-icon {
  font-size: 1.5rem;
}

/* ============================================================================
   Navigation
   ============================================================================ */
.main-menu {
  text-align: center;
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.main-menu nav {
  display: inline;
  text-align: center;
}

.menu-item {
  font-family: var(--font-accent);
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--color-accent);
  padding: 0;
  transition: color var(--transition-fast);
}

.menu-item:hover,
.menu-item:focus {
  color: var(--color-primary);
}

.menu-item::before {
  content: " | ";
  color: var(--color-text-muted);
  margin: 0 0.5rem;
}

.menu-item::after {
  content: " | ";
  color: var(--color-text-muted);
  margin: 0 0.5rem;
}

/* Navigation style: underline on hover */
.nav-underline .menu-item {
  position: relative;
  padding-bottom: 0.5rem;
  margin: 0 1rem;
}

.nav-underline .menu-item::before,
.nav-underline .menu-item::after {
  content: none !important;
  margin: 0 !important;
}

.nav-underline .menu-item::after {
  content: "" !important;
  margin: 0 !important;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.nav-underline .menu-item:hover::after,
.nav-underline .menu-item:focus::after {
  width: 100%;
}

/* ============================================================================
   Resume Page
   ============================================================================ */
.resume {
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  font-size: 1rem;
}

.resume header {
  text-align: center;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.resume header h1 {
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
}

.resume header address {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: var(--spacing-sm);
}

.resume header p {
  font-size: 0.85rem;
  color: var(--color-text-meta);
  line-height: 1.8;
}

.resume section {
  margin-bottom: var(--spacing-xl);
}

.resume section > h2 {
  color: var(--color-heading-blue);
  font-weight: bold;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-text-muted);
}

/* Job Entries */
.resume .job {
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: #ffffff;
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  overflow: auto;
}

.resume .job:hover {
  background: #fafafa;
  transition: background var(--transition-fast);
}

.job-header {
  margin-bottom: var(--spacing-xs);
}

.job-main-content {
  display: block;
}

.job-title {
  color: var(--color-job-title);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 var(--spacing-xs) 0;
  text-decoration: underline;
  text-decoration-color: var(--color-job-title);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.job-meta {
  margin: 0 0 var(--spacing-xs) 0;
}

.job-date {
  color: var(--color-job-meta);
  font-size: 0.95rem;
}

.job-date em {
  font-style: italic;
}

.job-company {
  font-size: 1.05rem;
  margin: 0 0 var(--spacing-xs) 0;
}

.job-company strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

.job-company a {
  color: var(--color-accent);
}

.job-location {
  color: var(--color-text-secondary);
  font-weight: 400;
}

.job-org {
  color: var(--color-text-meta);
  font-size: 0.9rem;
  margin: 0 0 var(--spacing-sm) 0;
}

.job-org em {
  font-style: italic;
}

.job-projects {
  background: #d4d4c4;
  padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius);
  margin: 0 0 var(--spacing-sm) var(--spacing-md);
  font-size: 0.75rem;
  font-family: var(--font-secondary);
  width: 280px;
  float: right;
  order: 2;
}

/* Float on wide screens */
@media (min-width: 900px) {
  .job-projects {
    float: right;
    margin: 0 0 var(--spacing-sm) var(--spacing-md);
  }
}

/* Position between header and highlights on medium screens */
@media (max-width: 899px) {
  .resume .job {
    display: flex;
    flex-direction: column;
  }

  .job-header {
    order: 1;
  }

  .job-projects {
    order: 2;
    float: none;
    width: 100%;
    margin: var(--spacing-sm) 0;
  }

  .job-highlights {
    order: 3;
  }
}

.job-projects strong {
  font-weight: bold;
  text-decoration: underline;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
}

.job-projects a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  display: inline;
  margin: 0;
  padding: 0;
}

.job-projects-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  line-height: 1.5;
}

.job-projects-list div {
  text-indent: 0;
  padding-left: 1rem;
  position: relative;
}

.job-projects-list div:last-child {
  margin-bottom: 0;
}

.job-projects-list div::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 600;
}

.job-highlights {
  padding-left: 0;
  margin: var(--spacing-sm) 0 0 0;
  list-style: none;
}

.job-highlights li {
  margin-bottom: var(--spacing-xs);
  text-align: left;
  line-height: 1.6;
  color: var(--color-text-secondary);
  padding-left: 1.5rem;
  position: relative;
}

.job-highlights li::before {
  content: "■";
  position: absolute;
  left: 0.4rem;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.6em;
  top: 0.5em;
}

/* Highlights Section */
.resume-highlights {
  padding-left: 0;
  margin: var(--spacing-sm) 0;
}

.resume-highlights > div {
  margin-top: var(--spacing-xs);
  padding-left: 2rem;
  text-indent: -2rem;
  line-height: 1.6;
}

.resume-highlights > div:first-child {
  margin-top: 0;
}

.resume-highlights dt {
  font-weight: 600;
  color: var(--color-primary);
  display: inline;
}

.resume-highlights dt::after {
  content: ": ";
}

.resume-highlights dd {
  display: inline;
  margin: 0;
}

/* Skills Section */
.resume section:has(.skill-category) p {
  margin-bottom: var(--spacing-md);
}

.resume section p strong {
  color: var(--color-heading-purple);
  font-size: 1.05rem;
}

/* Education Section */
.education-item {
  margin-bottom: var(--spacing-md);
}

.education-item a {
  color: var(--color-accent);
  font-weight: 700;
}

/* ============================================================================
   Footer
   ============================================================================ */
.footer {
  text-align: center;
  margin-top: 0;
  padding: 0;
  color: #8b8b8b;
}

.footer hr {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: var(--spacing-sm);
}

.copyright {
  font-family: var(--font-secondary);
  font-size: 0.75rem;
  font-weight: 200;
  margin: 0;
}

/* ============================================================================
   Code Blocks
   ============================================================================ */
pre {
  overflow-x: auto;
  padding: var(--spacing-sm);
  background-color: #f5f5f5;
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-sm);
}

pre > code {
  white-space: pre;
  word-wrap: initial;
  word-break: initial;
}

code {
  font-family: "Courier New", monospace;
  font-size: 0.9em;
  background-color: #f5f5f5;
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
}

pre code {
  background-color: transparent;
  padding: 0;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */
@media (max-width: 768px) {
  .header {
    margin-top: var(--spacing-lg);
  }

  .menu-item {
    font-size: 1.1rem;
  }

  .social a {
    font-size: 1.25rem;
    width: 2rem;
    height: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================================
   Print Styles
   ============================================================================ */
@media print {
  .social,
  .main-menu,
  .footer {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
    color: #000;
  }
}
