/* ===== VARIABLES ===== */
:root {
  --font-mono: "Courier New", Courier, monospace;
  --bg-main: #ffffff;
  --text-main: #333333;
  --text-headings: #111111;
  --text-muted: #666666;
  --link-color: #0055aa;
  --link-hover: #003366;
  --border-subtle: #dddddd;
  --code-bg: #f5f5f5;
  --code-border: #cccccc;
  --card-hover-bg: rgba(0, 0, 0, 0.02);
  --accent: #0055aa;
  --max-width: 1200px;
}

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

/* ===== BODY ===== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-mono);
  background: var(--bg-main);
  color: var(--text-main);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem 2rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== NAV ===== */
.main-nav {
  position: sticky;
  top: 0;
  background: var(--bg-main);
  border-bottom: 1px dashed var(--border-subtle);
  padding: 1rem 0;
  z-index: 100;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-headings);
}

/* ===== HEADER ===== */
.site-header {
  padding: 3rem 0 2rem;
}

.site-header h1 {
  font-size: 2.5rem;
  color: var(--text-headings);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.site-header p {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ===== SECTIONS ===== */
.section {
  margin: 3rem 0;
}

.section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-headings);
  border-bottom: 2px solid var(--text-headings);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

/* ===== TIMELINE ===== */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--border-subtle);
}

.timeline-item {
  position: relative;
  padding: 0.5rem 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.15rem;
  top: 0.85rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-subtle);
  border: 2px solid var(--bg-main);
}

.timeline-item.current::before {
  background: var(--accent);
}

.timeline-item .item-name {
  font-weight: 700;
  color: var(--text-headings);
}

.timeline-item .item-detail {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== CARDS GRID ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.card {
  border: 1px dashed var(--border-subtle);
  padding: 1.25rem;
  transition: border-style 0.2s, background 0.2s;
}

.card:hover {
  border-style: solid;
  background: var(--card-hover-bg);
}

.card-name {
  font-weight: 700;
  color: var(--text-headings);
  margin-bottom: 0.25rem;
}

.card-name a {
  color: inherit;
  text-decoration: none;
}

.card-name a:hover {
  color: var(--link-color);
}

.card-description {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== DATA TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.5rem 1rem 0.5rem 0;
  border-bottom: 2px solid var(--border-subtle);
}

.data-table td {
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px dotted var(--border-subtle);
  font-size: 0.9rem;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table td a {
  color: inherit;
  text-decoration: none;
}

.data-table td a:hover {
  text-decoration: underline;
}

/* ===== CERT GRID ===== */
.cert-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cert-badge {
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-headings);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cert-badge .cert-name {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  margin-top: 0.15rem;
}

/* ===== BLOG LIST ===== */
.blog-list {
  margin-top: 1rem;
}

.blog-year-group {
  margin-bottom: 2rem;
}

.blog-year {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-headings);
  margin-bottom: 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.blog-entries {
  list-style: none;
}

.blog-entry {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  gap: 1rem;
  padding: 0.4rem 0;
  align-items: baseline;
  border-bottom: 1px dotted var(--border-subtle);
}

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

.blog-entry-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.blog-entry-title a {
  color: var(--text-main);
  text-decoration: none;
}

.blog-entry-title a:hover {
  color: var(--link-color);
}

.blog-entry-type {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== BLOG POST ===== */
.post {
  max-width: 800px;
  position: relative;
  margin-left: 220px;
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.post-header h1 {
  font-size: 1.8rem;
  color: var(--text-headings);
  line-height: 1.3;
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.post-content::after {
  content: "";
  display: block;
  clear: both;
}

.post-content h2 {
  font-size: 1.3rem;
  color: var(--text-headings);
  margin: 2rem 0 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-subtle);
}

.post-content h3 {
  font-size: 1.1rem;
  color: var(--text-headings);
  margin: 1.5rem 0 0.75rem;
}

.post-content p {
  margin: 1rem 0;
}

.post-content a {
  color: var(--link-color);
}

.post-content a:hover {
  color: var(--link-hover);
}

.post-content ul,
.post-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.post-content li {
  margin: 0.3rem 0;
}

.post-content code {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 0.15rem 0.4rem;
  font-size: 0.85em;
  border-radius: 2px;
}

.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
}

.post-content figure {
  margin: 2rem 0;
}

.post-content figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-subtle);
}

.post-content figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

.post-content blockquote {
  border-left: 3px solid var(--border-subtle);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
}

/* ===== SIDE NOTES ===== */
.sidenote-toggle {
  color: var(--link-color);
  cursor: default;
  font-size: 0.75em;
  vertical-align: super;
}

.sidenote-checkbox {
  display: none;
}

.sidenote {
  float: left;
  clear: left;
  width: 180px;
  margin-left: -220px;
  margin-bottom: 0.5rem;
  margin-top: 0.25rem;
  text-align: right;
}

.sidenote-label {
  display: block;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidenote-line {
  display: block;
  width: 2rem;
  height: 1px;
  background: var(--border-subtle);
  margin: 0.4rem 0 0.4rem auto;
}

.sidenote-text {
  display: block;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== LINKS PAGE ===== */
.links-section {
  margin: 2rem 0;
}

.links-section-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.links-section-number {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.links-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--text-headings);
}

.links-table {
  width: 100%;
  border-collapse: collapse;
}

.links-table td {
  padding: 0.5rem 1rem 0.5rem 0;
  border-bottom: 1px dotted var(--border-subtle);
  vertical-align: top;
}

.links-table tr:last-child td {
  border-bottom: none;
}

.link-platform {
  font-weight: 700;
  color: var(--text-headings);
  white-space: nowrap;
  width: 1%;
}

.link-description {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.link-url {
  text-align: right;
}

.link-url a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 0.85rem;
}

.link-url a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== BACK LINK ===== */
.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .post {
    margin-left: 0;
  }

  .sidenote {
    float: none;
    width: auto;
    margin-left: 0;
    margin-bottom: 0;
    margin-top: 0;
    text-align: left;
    display: none;
    padding: 0.75rem;
    border-left: 2px solid var(--border-subtle);
    background: var(--code-bg);
  }

  .sidenote-line {
    display: none;
  }

  .sidenote-checkbox:checked + .sidenote {
    display: block;
  }

  .sidenote-toggle {
    cursor: pointer;
    text-decoration: underline;
  }
}

@media (max-width: 768px) {
  body {
    padding: 0 1rem 1rem;
  }

  .site-header h1 {
    font-size: 2rem;
  }

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

  .blog-entry {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .blog-entry-date {
    order: 2;
  }

  .blog-entry-title {
    order: 1;
  }

  .blog-entry-type {
    order: 3;
  }

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table th,
  .data-table td,
  .data-table tr {
    display: block;
  }

  .data-table thead {
    display: none;
  }

  .data-table td {
    padding: 0.25rem 0;
    border-bottom: none;
  }

  .data-table tr {
    border-bottom: 1px dotted var(--border-subtle);
    padding: 0.5rem 0;
  }

  .links-table td {
    display: block;
    padding: 0.2rem 0;
  }

  .links-table tr {
    padding: 0.5rem 0;
    display: block;
    border-bottom: 1px dotted var(--border-subtle);
  }

  .links-table tr:last-child {
    border-bottom: none;
  }
}

@media (max-width: 480px) {
  .site-header h1 {
    font-size: 1.6rem;
  }

  .nav-links {
    gap: 0.5rem;
  }

  .nav-link {
    font-size: 0.75rem;
  }

  .section {
    margin: 2rem 0;
  }

  .post-header h1 {
    font-size: 1.4rem;
  }
}
