/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink:        #1a1a1a;
  --ink-light:  #555555;
  --ink-faint:  #888888;
  --rule:       #d8d8d4;
  --paper:      #fafaf8;
  --paper-dim:  #f2f2ef;
  --accent:     #3a5f8a;
  --accent-dim: #e8eef4;

  --font-body:  Georgia, "Times New Roman", serif;
  --font-mono:  "Courier New", Courier, monospace;
  --font-ui:    -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --measure:    680px;
  --nav-h:      56px;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   TYPOGRAPHY SCALE
   ============================================================ */

h1, h2, h3, h4 {
  font-family: var(--font-body);
  font-weight: normal;
  line-height: 1.25;
  color: var(--ink);
}

h1 { font-size: 2rem;   letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; margin-bottom: 1.25rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--rule); }
h3 { font-size: 1.05rem; font-weight: bold; margin-bottom: 0.35rem; }
h4 { font-size: 0.95rem; font-weight: bold; }

p  { margin-bottom: 1.1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--ink); }

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.1rem;
}
li { margin-bottom: 0.3rem; }

strong { font-weight: bold; }
em     { font-style: italic; }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--paper-dim);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

.container {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container--wide {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.page-body {
  padding-top: calc(var(--nav-h) + 3rem);
  padding-bottom: 5rem;
  min-height: 100vh;
}

.section {
  margin-bottom: 3.5rem;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  z-index: 100;
  display: flex;
  align-items: center;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav__title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.nav__title:hover { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav__links li a {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-light);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav__links li a:hover {
  color: var(--ink);
}

.nav__links li a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--ink);
  font-size: 1.2rem;
}

/* ============================================================
   HOME PAGE
   ============================================================ */

.home-header {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.home-header__photo {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--paper-dim);
  border: 1px solid var(--rule);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-align: center;
  line-height: 1.4;
}

.home-header__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-header__photo-placeholder {
  padding: 0.5rem;
}

.home-header__text h1 {
  margin-bottom: 0.2rem;
}

.home-header__subtitle {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  margin-bottom: 0.9rem;
  display: block;
}

.home-header__links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.home-header__links a {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

/* Interests */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.interest-card {
  background: var(--paper-dim);
  border: 1px solid var(--rule);
  padding: 1rem 1.1rem;
}

.interest-card__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.25rem;
}

.interest-card__name {
  font-size: 0.92rem;
  font-weight: bold;
  color: var(--ink);
}

/* Latest posts on home */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}

.post-list__item:first-child {
  border-top: 1px solid var(--rule);
}

.post-list__title {
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
}
.post-list__title:hover { color: var(--accent); text-decoration: underline; }

.post-list__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.home-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}
.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ============================================================
   RESUME PAGE
   ============================================================ */

.resume-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.resume-header h1 {
  margin-bottom: 0.2rem;
}

.resume-header__meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
  margin-top: 0.5rem;
}

.resume-header__actions {
  margin-top: 1.25rem;
}

/* Resume entry */
.resume-entry {
  margin-bottom: 1.75rem;
}

.resume-entry__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.15rem;
}

.resume-entry__org {
  font-size: 0.95rem;
  font-weight: bold;
}

.resume-entry__period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.resume-entry__role {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 0.55rem;
}

.resume-entry ul {
  margin-bottom: 0;
}

.resume-entry li {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.skill-group__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
  display: block;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  background: var(--paper-dim);
  border: 1px solid var(--rule);
  color: var(--ink);
}

/* ============================================================
   BLOG PAGE
   ============================================================ */

.blog-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.blog-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-post-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
}

.blog-post-item:first-child {
  border-top: 1px solid var(--rule);
}

.blog-post-item__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.blog-post-item__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.blog-post-item__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.blog-post-item__title {
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.35;
  display: block;
  margin-bottom: 0.55rem;
}
.blog-post-item__title:hover {
  color: var(--accent);
  text-decoration: underline;
}

.blog-post-item__summary {
  font-size: 0.92rem;
  color: var(--ink-light);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.blog-post-item__readmore {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

/* ============================================================
   BLOG POST (SINGLE)
   ============================================================ */

.blog-post__header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.blog-post__header h1 {
  margin-top: 0.3rem;
  margin-bottom: 0.75rem;
}

.blog-post__dates {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.blog-post__body {
  max-width: var(--measure);
  margin: 0 auto;
}

.blog-post__figure {
  clear: both;
  margin: 0 0 1.5rem;
}

.blog-post__figure img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper-dim);
  border: 1px solid var(--rule);
}

.blog-post__figure--float-left,
.blog-post__figure--float-right {
  width: 42%;
  margin-bottom: 1rem;
}

.blog-post__figure--float-left {
  float: left;
  clear: right;
  margin-right: 1.5rem;
}

.blog-post__figure--float-right {
  float: right;
  clear: left;
  margin-left: 1.5rem;
}

.blog-post__figure-row {
  display: flex;
  gap: 1.25rem;
  clear: both;
  margin: 0 0 1.5rem;
}

.blog-post__figure-row .blog-post__figure {
  flex: 1;
  margin-bottom: 0;
}

.blog-post__body h2,
.blog-post__body h3 {
  clear: both;
}

.blog-post__figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  text-align: center;
  margin-top: 0.6rem;
}

.blog-post sup {
  font-size: 0.7em;
}

.blog-post sup a {
  color: var(--accent);
  text-decoration: none;
  padding: 0 0.1em;
}

.blog-post sup a:hover {
  text-decoration: underline;
}

.blog-post__footnotes {
  max-width: var(--measure);
  margin: 3rem auto 0;
  font-size: 0.85rem;
  color: var(--ink-light);
}

.blog-post__footnotes hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin-bottom: 1.75rem;
}

.blog-post__footnotes ol {
  padding-left: 1.25rem;
}

.blog-post__footnotes li {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.blog-post__footnotes li .blog-post__figure {
  max-width: 420px;
}

.blog-post__footnotes a {
  color: var(--accent);
  text-decoration: none;
  margin-left: 0.3rem;
}

.blog-post__footnotes a:hover {
  text-decoration: underline;
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */

.contact-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.contact-channels {
  list-style: none;
  padding: 0;
  margin: 0 0 2.5rem;
}

.contact-channel {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}

.contact-channel:first-child {
  border-top: 1px solid var(--rule);
}

.contact-channel__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  width: 80px;
  flex-shrink: 0;
}

.contact-channel__value {
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
}
.contact-channel__value:hover { color: var(--accent); text-decoration: underline; }

.contact-note {
  font-size: 0.9rem;
  color: var(--ink-light);
  font-style: italic;
  padding: 1.25rem 1.25rem;
  border-left: 3px solid var(--rule);
  margin-top: 2rem;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  border-top: 1px solid var(--rule);
  padding: 1.75rem 0;
  margin-top: 4rem;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.footer__links {
  display: flex;
  gap: 1.25rem;
}

.footer__links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-decoration: none;
}
.footer__links a:hover { color: var(--accent); }

/* ============================================================
   SECTION LABEL
   ============================================================ */

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.75rem;
}

/* ============================================================
   DIVIDER
   ============================================================ */

.divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
  :root { --paper: #fff; --paper-dim: #f5f5f5; }

  .nav, .home-cta, .btn, .footer { display: none !important; }

  .page-body { padding-top: 1.5rem; }

  body { font-size: 11pt; color: #000; }

  h1 { font-size: 20pt; }
  h2 { font-size: 13pt; }

  a { color: #000; text-decoration: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }

  .page-break { page-break-before: always; }

  .resume-header__actions { display: none; }
}

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

@media (max-width: 600px) {
  html { font-size: 16px; }

  .nav__links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    padding: 0.5rem 0;
  }

  .nav__links.open { display: flex; }

  .nav__links li a {
    padding: 0.75rem 1.5rem;
    border-left: none;
    border-bottom: 1px solid var(--rule);
    font-size: 0.9rem;
    letter-spacing: 0.03em;
  }

  .nav__toggle { display: block; }

  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.15rem; }

  .home-header {
    flex-direction: column;
    gap: 1.5rem;
  }

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

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

  .post-list__item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .resume-entry__head {
    flex-direction: column;
    gap: 0.15rem;
  }

  .contact-channel {
    flex-direction: column;
    gap: 0.35rem;
  }

  .blog-post__figure--float-left,
  .blog-post__figure--float-right {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .blog-post__figure-row {
    flex-direction: column;
    gap: 1.5rem;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .home-header__links { flex-direction: column; gap: 0.5rem; }
}