/* ============================================================
   GLOBAL RESETS & THEME
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #111214;
  --bg-raised: #17181b;
  --text: #e9e6df;
  --text-muted: #a8a29a;
  --gold: #c9a86a;
  --gold-on-fill: #16130c;
  --border: rgba(255, 255, 255, 0.1);
  --serif: 'Source Serif 4', 'Roboto Slab', Georgia, serif;
  --sans: 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  border: 0;
  margin: 0;
  background-color: var(--bg);
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.55;
}

a {
  color: var(--gold);
}

/* ============================================================
   HEADER / NAV
   ============================================================ */

.site-header {
  background-color: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  min-height: 2.75em;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 10;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5em;
}

.header-ul {
  list-style: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .85em;
}

.header-ul a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75em;
  color: var(--text);
  text-decoration: none;
  padding: 0 .2em;
}

.header-ul a:hover,
.header-ul a.active {
  color: var(--gold);
}

.header-ul li {
  padding-left: 2em;
}

.lang-switch {
  display: flex;
  gap: .5em;
  font-size: .8em;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.lang-switch a {
  color: var(--text-muted);
  text-decoration: none;
  padding: .2em .5em;
  border-radius: .25em;
}

.lang-switch a.active {
  color: var(--gold-on-fill);
  background-color: var(--gold);
}

.lang-switch a:not(.active):hover {
  color: var(--text);
}

/* ============================================================
   FOOTER (site-wide)
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 5em;
  padding: 2.5em 1.5em 3em;
  text-align: center;
  color: var(--text-muted);
  font-size: .9em;
}

.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5em;
  flex-wrap: wrap;
  margin-bottom: 1em;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--gold);
}

.site-footer .footer-note {
  font-size: .85em;
  opacity: .7;
}

/* ============================================================
   HERO / HOME
   ============================================================ */

.jumbotron-intro-container {
  width: 90%;
  max-width: 46em;
  color: var(--text);
  margin: 0 auto;
  margin-top: 8em;
  animation: fadeIn 1.4s linear;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 1.6em;
}

.hero-avatar {
  width: 6.5em;
  height: 6.5em;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(201, 168, 106, .4);
}

.hero-name-block {
  min-width: 0;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.jumbotron-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.8em;
  margin: 0;
  line-height: 1.15;
}

.jumbotron-description {
  margin: .4em 0 1.4em;
  font-size: 1.25em;
  color: var(--gold);
  font-family: var(--serif);
  font-style: italic;
}

.current-focus {
  margin: 1.6em 0;
  padding: 1em 1.4em;
  background-color: var(--bg-raised);
  border-left: 3px solid var(--gold);
  border-radius: 0 .3em .3em 0;
  font-size: .95em;
}

.current-focus b {
  color: var(--gold);
}

.bio-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .7em;
  color: var(--text-muted);
  opacity: .6;
  margin-bottom: .6em;
}

.bio-text {
  font-size: 1em;
}

.bio-text p {
  margin: 0 0 1em;
}

/* links */
.cv-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .5em;
  font-family: var(--sans);
}

.cv-primary {
  display: inline-block;
  padding: .55em 1.3em;
  color: var(--gold-on-fill);
  background-color: var(--gold);
  border-radius: 2em;
  text-decoration: none;
  font-weight: 600;
  font-size: .95em;
  transition: opacity .15s ease;
}

.cv-primary:hover {
  opacity: .85;
}

.cv-alt {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .8em;
  border-bottom: 1px solid transparent;
}

.cv-alt:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.links-container {
  margin-top: 2em;
}

/* ============================================================
   PAGE HEADER (Writing / Papers / Software)
   ============================================================ */

.page-main {
  margin-top: 7em;
  width: 90%;
  max-width: 50em;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 2em;
}

.page-header {
  font-family: var(--serif);
  font-size: 2.2em;
  margin-bottom: .2em;
}

.page-subheader {
  color: var(--text-muted);
  margin-bottom: 2.5em;
  font-size: 1em;
  max-width: 40em;
}

/* ============================================================
   WRITING PAGE
   ============================================================ */

.venue-block {
  margin-bottom: 3em;
}

.venue-title {
  font-family: var(--serif);
  font-size: 1.4em;
  color: var(--gold);
  margin-bottom: .2em;
}

.venue-subtitle {
  color: var(--text-muted);
  font-size: .85em;
  margin-bottom: 1.2em;
}

.venue-podcast-note {
  margin: -.4em 0 1.2em;
  font-size: .82em;
}

.venue-podcast-note a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}

.venue-podcast-note a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.writing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.writing-item {
  padding: 1.2em 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1em;
}

.writing-thumb-link {
  flex-shrink: 0;
  display: block;
}

.writing-thumb {
  width: 4.5em;
  height: 4.5em;
  object-fit: cover;
  border-radius: .35em;
  border: 1px solid var(--border);
  display: block;
}

.writing-item-body {
  display: flex;
  flex-direction: column;
  gap: .3em;
  min-width: 0;
  flex: 1;
}

.writing-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  flex-wrap: wrap;
}

.writing-title a {
  font-family: var(--serif);
  font-size: 1.15em;
  color: var(--text);
  text-decoration: none;
}

.writing-title a:hover {
  color: var(--gold);
}

.writing-date {
  color: var(--text-muted);
  font-size: .8em;
  white-space: nowrap;
}

.writing-abstract {
  color: var(--text-muted);
  font-size: .92em;
}

.writing-coauthor {
  font-style: italic;
  opacity: .8;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5em;
  margin-top: 1.5em;
}

.pagination-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: .85em;
  padding: .5em 1.1em;
  border-radius: 1.5em;
  cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.pagination-btn:disabled {
  opacity: .35;
  cursor: default;
}

.pagination-range {
  color: var(--text-muted);
  font-size: .8em;
  white-space: nowrap;
}

.writing-meta {
  display: flex;
  gap: .8em;
  align-items: center;
  margin-top: .2em;
}

.listen-badge {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  font-size: .78em;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 1em;
  padding: .15em .7em;
}

.listen-badge:hover {
  border-color: var(--gold);
}

/* ============================================================
   PAPERS PAGE
   ============================================================ */

.papers-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.paper-item {
  padding: 1.2em 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  flex-wrap: wrap;
}

.paper-title a {
  font-family: var(--serif);
  font-size: 1.1em;
  color: var(--text);
  text-decoration: none;
}

.paper-title a:hover {
  color: var(--gold);
}

.paper-desc {
  color: var(--text-muted);
  font-size: .9em;
  flex-basis: 100%;
}

.paper-date {
  color: var(--text-muted);
  font-size: .8em;
  white-space: nowrap;
}

.empty-state {
  color: var(--text-muted);
  font-size: .95em;
  padding: 2em 0;
  border-top: 1px solid var(--border);
  font-style: italic;
}

/* ============================================================
   COURSES PAGE
   ============================================================ */

.course-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.course-item {
  padding: 1.2em 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  flex-wrap: wrap;
}

.course-title {
  font-family: var(--serif);
  font-size: 1.1em;
  color: var(--text);
}

.course-title a {
  color: var(--text);
  text-decoration: none;
}

.course-title a:hover {
  color: var(--gold);
}

.course-term {
  color: var(--text-muted);
  font-size: .8em;
  white-space: nowrap;
}

.course-desc {
  color: var(--text-muted);
  font-size: .9em;
  flex-basis: 100%;
}

/* ============================================================
   SOFTWARE / CONSULTING PAGE
   ============================================================ */

.availability-badge {
  display: inline-block;
  font-size: .8em;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gold-on-fill);
  background-color: var(--gold);
  padding: .3em .8em;
  border-radius: 1em;
  margin-bottom: 1.2em;
}

.consulting-strengths {
  list-style: none;
  margin: 1.5em 0;
  padding: 0;
}

.consulting-strengths li {
  padding: .6em 0;
  border-bottom: 1px solid var(--border);
}

.consulting-strengths b {
  color: var(--gold);
  font-family: var(--serif);
}

.experience-list {
  margin: 1.5em 0;
}

.experience-item {
  padding: 1em 0;
  border-bottom: 1px solid var(--border);
}

.experience-role {
  font-family: var(--serif);
  font-size: 1.05em;
}

.experience-org {
  color: var(--text-muted);
  font-size: .85em;
}

.skills-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5em;
  margin: 1.5em 0;
  padding: 0;
  list-style: none;
}

.skills-chips li {
  border: 1px solid var(--border);
  border-radius: 1em;
  padding: .3em .9em;
  font-size: .85em;
  color: var(--text-muted);
}

.section-divider {
  margin: 3em 0;
  border: none;
  border-top: 1px solid var(--border);
}

/* =================================Projects=============== */

.projects-main {
  max-width: 100em;
  margin: 1em auto 0;
  padding-top: 2em;
  padding-bottom: 2em;
  border-top: 1px solid var(--border);
}

.projects-header {
  font-family: var(--serif);
  font-size: 1.5em;
  text-align: center;
  margin-bottom: 1em;
}

.projects-container {
  margin: 0 auto;
  text-align: center;
  max-width: 90%;
}

.project-container {
  display: flex;
  width: 75em;
  max-width: 100%;
  margin: 4em auto;
}

.project-image {
  flex-grow: 1;
  flex-shrink: 0;
  margin: 0 auto;
}

.project-info-container {
  flex-basis: 60%;
  box-sizing: border-box;
}

.project-container.no-image .project-info-container {
  flex-basis: 100%;
  background-color: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: .5em;
  padding: 1.5em 2em;
}

.project-container.no-image .project-description {
  max-width: 40em;
  width: auto;
}

.project-name {
  font-family: var(--serif);
  font-size: 1.5em;
  text-align: left;
  color: var(--gold);
  margin-bottom: .5em;
}

.project-description {
  display: block;
  margin-top: 1em;
  text-align: left;
  width: 90%;
  font-size: .9em;
  color: var(--text-muted);
}

.project-description a {
  color: var(--gold);
}

.myrole {
  margin-top: 1em;
}

.role-title {
  color: var(--gold);
  margin-bottom: .5em;
  font-family: var(--serif);
}

.project-image img {
  width: 32em;
  max-width: 100%;
  box-shadow: 4px 4px 12px rgba(0,0,0,.5);
}

.repo-link {
  margin-left: .5em;
  padding-top: .5em;
}

.repo-link-img {
  width: 1em;
}

.proprietary-note {
  font-size: .75em;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 1em;
  padding: .2em .7em;
}

.name-link-cont {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
}

/* About / Software bio block */
.gravatar-img {
  margin: 0 auto;
  margin-top: 8em;
  width: 20em;
}

.gravatar-img img {
  z-index: 0;
  border-radius: 25em;
  width: 15em;
  margin: 0 auto;
  display: block;
}

.whoami-title {
  margin-bottom: 1em;
  font-size: 1.2em;
  font-family: var(--serif);
}

.about-me-information {
  width: 60%;
  margin: 0 auto;
  margin-top: 3em;
  font-family: var(--sans);
  line-height: 1.5;
}

.about-me-information a {
  color: var(--gold);
}

.workingon-header {
  margin-top: 1em;
  font-size: 1.2em;
  text-decoration: underline;
  margin-bottom: 1em;
}

.workingon {
  margin-bottom: 2em;
}

.workingon a {
  color: var(--gold);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media only screen and (max-width: 1200px) {
  .project-container {
    flex-direction: column;
    width: 100%;
  }

  .project-name {
    font-size: 1.3em;
    text-align: center;
  }

  .project-description {
    margin: 0 auto;
    width: 60%;
  }

  .name-link-cont {
    justify-content: center;
  }

  .project-info-container {
    width: 100%;
  }

  .project-image img {
    width: 28em;
  }

  .project-image {
    margin-top: 2em;
  }
}

@media only screen and (max-width: 800px) {
  .site-header {
    flex-direction: column;
    padding: .6em 0;
    height: auto;
    /* A fixed header with wrapping nav has unpredictable height on narrow screens —
       fixing it would force guessing that height everywhere below to avoid overlap.
       `sticky` keeps the nav following scroll like `fixed` does, but (like `static`)
       participates in normal flow, so there's no offset to guess and no overlap risk. */
    position: sticky;
  }

  .header-ul {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .header-ul li {
    padding: 0 .5em;
  }

  .lang-switch {
    margin-top: .4em;
  }

  .cv-links {
    align-items: center;
  }

  .links-container {
    margin: 0 auto;
  }

  .project-description {
    width: 100%;
  }

  .project-image img {
    width: 20em;
  }

  .hero-top {
    flex-direction: column;
    text-align: center;
  }

  .jumbotron-name {
    text-align: center;
    margin: 0;
  }

  .jumbotron-description {
    text-align: center;
    margin: .5em auto 1.2em;
  }

  .jumbotron-intro-container {
    margin-top: 2.5em;
    text-align: center;
  }

  .page-main {
    margin-top: 2.5em;
  }

  .writing-item-top {
    flex-direction: column;
    gap: .2em;
  }

  .writing-thumb {
    width: 3.2em;
    height: 3.2em;
  }

  .paper-item {
    flex-direction: column;
    gap: .2em;
  }

  .gravatar-img {
    margin-top: 5em;
  }

  .about-me-information {
    width: 85%;
    margin: 0 auto;
    margin-top: 3em;
    margin-bottom: 3em;
  }

  .whoami-title {
    text-align: center;
  }
}
