/* ==========================================================================
   timvarga.com — minimal, clean stylesheet
   Hand-written, no framework dependency. Open-source font via Google Fonts.
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f7f7f8;
  --color-text: #1c1c1e;
  --color-text-muted: #5b5b60;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-border: #e5e5e8;
  --max-width: 760px;
  --radius: 8px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono",
    Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 0.5em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; margin-top: 2.2em; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

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

/* ---------- Header / Nav ---------- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.nav-bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-mono);
}

.nav-brand:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-text);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 4px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */

.hero {
  padding: 4.5rem 0 3rem;
}

.hero .eyebrow {
  font-family: var(--font-mono);
  color: var(--color-accent);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  display: block;
}

.hero h1 {
  font-size: 2.5rem;
}

.hero p.lede {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.btn:hover {
  text-decoration: none;
}

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

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

.btn-secondary {
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

/* ---------- Cards (Projects) ---------- */

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--color-bg-alt);
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card .tags {
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: #eef2ff;
  color: var(--color-accent);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.card-links {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

/* ---------- Blog ---------- */

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

.post-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.post-list time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.post-list a {
  color: var(--color-text);
  font-weight: 600;
  font-size: 1.05rem;
}

.post-list a:hover {
  color: var(--color-accent);
}

article.post header {
  margin-bottom: 2rem;
}

article.post header time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ---------- About ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.skills-grid li::before {
  content: "—";
  color: var(--color-accent);
  margin-right: 0.5rem;
}

.timeline {
  margin-top: 1rem;
}

.timeline-item {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

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

.timeline-item .meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* ---------- D3 Career Timeline ---------- */

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.1rem;
  margin-bottom: 1.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.d3-timeline {
  position: relative;
  padding-left: 30px;
  margin-top: 0.5rem;
}

/* The vertical spine */
.d3-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 12px;
  width: 2px;
  background: var(--color-border);
}

/* Year markers */
.tl-year-marker {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: 0.75rem 0 0.35rem;
  user-select: none;
}

.tl-year-marker::before {
  content: '';
  position: absolute;
  left: -30px;
  top: calc(50% + 4px);
  width: 18px;
  height: 2px;
  background: var(--color-border);
}

/* Job node row */
.tl-node {
  position: relative;
  margin-bottom: 0.6rem;
  cursor: pointer;
  outline: none;
}

/* The dot on the spine */
.tl-dot {
  position: absolute;
  left: -26px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid;
  background: #fff;
  z-index: 1;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.tl-node:hover .tl-dot,
.tl-node:focus-visible .tl-dot {
  transform: scale(1.35);
}

.tl-node.is-active .tl-dot {
  transform: scale(1.35);
  background-color: currentColor; /* filled via JS inline color */
}

/* Card */
.tl-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tl-node:hover .tl-card,
.tl-node:focus-visible .tl-card {
  border-color: #c5c5c8;
}

.tl-node.is-active .tl-card {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

/* Card header (always visible) */
.tl-card-header {
  padding: 0.8rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.6rem;
}

.tl-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0;
  flex: 0 0 100%;
}

.tl-org {
  font-size: 0.83rem;
  color: var(--color-text-muted);
  flex: 1;
}

.tl-dates {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: block;
  flex: 0 0 100%;
}

.tl-concurrent-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 999px;
}

.tl-toggle-icon {
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  transition: transform 0.2s ease;
  align-self: center;
}

.tl-node.is-active .tl-toggle-icon {
  transform: rotate(180deg);
}

/* Expandable detail */
.tl-detail {
  max-height: 0;
  overflow: hidden;
  border-top: 0px solid var(--color-border);
  transition: max-height 0.32s ease, border-top-width 0.1s ease;
}

.tl-node.is-active .tl-detail {
  max-height: 600px;
  border-top-width: 1px;
}

.tl-detail-inner {
  padding: 0.9rem 1rem 1rem;
}

.tl-location {
  font-size: 0.83rem;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
}

.tl-desc {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--color-text);
  margin: 0 0 0.75rem;
}

/* Map placeholder box */
.tl-map-placeholder {
  height: 160px;
  border-radius: 6px;
  border: 1.5px dashed var(--color-accent);
  background: #f0f4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  margin-top: 0.5rem;
}

.tl-map-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ---------- Social Media ---------- */

.social-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-card {
  border: 1px solid var(--color-border);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  background: var(--color-bg-alt);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.social-card-body {
  flex: 1;
}

.social-card h3 {
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.social-card .handle {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
  display: block;
}

.social-card p {
  font-size: 0.93rem;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
}

.social-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Platform accent colors (left border) */
.social-card--bluesky  { border-left-color: #0085ff; }
.social-card--twitter  { border-left-color: #000000; }
.social-card--flickr   { border-left-color: #ff0084; }
.social-card--pinterest { border-left-color: #e60023; }
.social-card--github   { border-left-color: #333333; }
.social-card--linkedin { border-left-color: #0a66c2; }
.social-card--facebook { border-left-color: #1877f2; }
.social-card--instagram { border-left-color: #c13584; }
.social-card--placeholder { border-left-color: var(--color-border); opacity: 0.65; }

/* ---------- Contact ---------- */

.contact-block {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-alt);
}

.contact-block a {
  font-weight: 600;
}

.todo-note {
  font-size: 0.85rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px dashed #f59e0b;
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin: 1rem 0;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

main {
  min-height: 60vh;
  padding-bottom: 2rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    display: none;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 0.6rem 0;
  }

  .hero h1 {
    font-size: 2rem;
  }

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