/* Smooth scroll */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Base */
body {
  margin: 0;
  padding: 0;
  font-family: 'Inconsolata', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 17px;
  line-height: 1.7;
  background-color: #fafaf9;
  color: #1f1f1f;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Container */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.25rem 0;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
}

/* Brand (name) */
.brand {
  font-weight: 700;
  font-size: 1.75rem;
  margin-right: auto;
  color: #111;
  text-decoration: none;
  letter-spacing: -0.01em;
}

/* Navigation */
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  font-size: 1rem;
  white-space: nowrap;
}

.nav a {
  color: #c22;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav a:hover,
.nav a:focus {
  background-color: #fbe9e9;
  text-decoration: none;
  outline: none;
}

.nav a:focus-visible {
  outline: 2px solid #c22;
  outline-offset: 2px;
}

.sep {
  color: #d4d4d4;
}

.icon {
  display: inline-block;
  vertical-align: middle;
}

/* Full-width divider under header */
.header-divider {
  border: 0;
  border-top: 1px solid #ececec;
  margin: 0;
  transition: border-color 0.25s ease;
}

/* Content wrapper */
#content {
  padding-bottom: 4rem;
}

/* Section headings */
h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  color: #111;
  border-bottom: 1px solid #ececec;
  letter-spacing: -0.01em;
  transition: color 0.25s ease, border-color 0.25s ease;
}

/* Paragraphs — no max-width so text wraps around the floated avatar
   and continues full-width below it */
#content p {
  margin: 0 0 1.5rem;
}

#content strong {
  color: #111;
  font-weight: 700;
  transition: color 0.25s ease;
}

#content em {
  color: #6b6b6b;
  font-style: normal;
  font-size: 0.95em;
}

#content a {
  color: #c22;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

#content a:hover {
  text-decoration-thickness: 2px;
}

/* Avatar */
.avatar {
  margin: -20px 0 1.5rem 1.5rem;
  float: right;
}

.avatar img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid #ececec;
  transition: border-color 0.25s ease;
}

/* ========================================
   Floating theme toggle
   ======================================== */

.switch {
  font-size: 11px;
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: inline-block;
  width: 4em;
  height: 2.2em;
  border-radius: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2a2a2a;
  transition: 0.4s;
  border-radius: 30px;
  overflow: hidden;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.2em;
  width: 1.2em;
  border-radius: 20px;
  left: 0.5em;
  bottom: 0.5em;
  transition: 0.4s;
  transition-timing-function: cubic-bezier(0.81, -0.04, 0.38, 1.5);
  box-shadow: inset 8px -4px 0px 0px #fff;
}

.switch input:checked + .slider {
  background-color: #00a6ff;
}

.switch input:checked + .slider:before {
  transform: translateX(1.8em);
  box-shadow: inset 15px -4px 0px 15px #ffcf48;
}

.switch input:focus-visible + .slider {
  outline: 2px solid #c22;
  outline-offset: 2px;
}

.star {
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  width: 5px;
  transition: all 0.4s;
  height: 5px;
}

.star_1 {
  left: 2.5em;
  top: 0.5em;
}

.star_2 {
  left: 2.2em;
  top: 1.2em;
}

.star_3 {
  left: 3em;
  top: 0.9em;
}

.switch input:checked ~ .slider .star {
  opacity: 0;
}

.cloud {
  width: 3.5em;
  position: absolute;
  bottom: -1.4em;
  left: -1.1em;
  opacity: 0;
  transition: all 0.4s;
}

.switch input:checked ~ .slider .cloud {
  opacity: 1;
}

/* ========================================
   Experience: minimalist flat layout
   ======================================== */

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-bottom: 1.5rem;
}

details.exp {
  /* No box, no border, no background — just text */
}

details.exp summary {
  list-style: none;
  cursor: pointer;
  display: block;
  padding: 0;
}

details.exp summary::-webkit-details-marker {
  display: none;
}

details.exp summary:focus-visible {
  outline: 2px solid #c22;
  outline-offset: 4px;
  border-radius: 2px;
}

.exp-role {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: #111;
  line-height: 1.4;
  transition: color 0.25s ease;
}

.exp-at {
  color: #c22;
  font-weight: 400;
  margin: 0 0.15em;
}

.exp-meta {
  font-size: 0.9rem;
  color: #6b6b6b;
  margin-top: 0.2rem;
  font-weight: 400;
}

.exp-toggle {
  display: inline-block;
  margin-top: 0.5rem;
  color: #c22;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

details.exp summary:hover .exp-toggle {
  text-decoration: underline;
}

/* Toggle text swap based on open state */
.exp-toggle-less {
  display: none;
}

details.exp[open] .exp-toggle-more {
  display: none;
}

details.exp[open] .exp-toggle-less {
  display: inline;
}

.exp-body {
  margin-top: 1rem;
  padding-left: 0;
}

.exp-body p {
  margin: 0.85rem 0;
  max-width: none;
}

.exp-body p:first-child {
  margin-top: 0;
}

.exp-body ul {
  margin: 0.85rem 0;
  padding-left: 1.25rem;
}

.exp-body li {
  margin: 0.4rem 0;
  line-height: 1.65;
}

.exp-body li::marker {
  color: #c22;
}

/* Selection */
::selection {
  background-color: #fbe9e9;
  color: #111;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 575px) {
  body {
    font-size: 16px;
    line-height: 1.65;
  }

  .container {
    padding: 2rem 1.25rem 0;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-right: 4.5rem; /* leave room for floating toggle */
  }

  .brand {
    margin-right: 0;
    font-size: 1.5rem;
  }

  .nav {
    white-space: normal;
  }

  .nav a {
    padding: 0.35rem 0.5rem;
  }

  .avatar {
    float: none;
    margin: 0 auto 1.5rem;
    text-align: center;
  }

  h2 {
    font-size: 1.2rem;
    margin-top: 2.5rem;
  }

  .switch {
    top: 1rem;
    right: 1rem;
    font-size: 10px;
  }

  .exp-role {
    font-size: 1rem;
  }
}

/* ========================================
   Dark theme
   ======================================== */
[data-theme="dark"] body {
  background-color: #161616;
  color: #d8d8d8;
}

[data-theme="dark"] .brand,
[data-theme="dark"] h2,
[data-theme="dark"] #content strong,
[data-theme="dark"] .exp-role {
  color: #f5f5f5;
}

[data-theme="dark"] .header-divider,
[data-theme="dark"] h2 {
  border-color: #2a2a2a;
}

[data-theme="dark"] .sep {
  color: #444;
}

[data-theme="dark"] #content em,
[data-theme="dark"] .exp-meta {
  color: #909090;
}

[data-theme="dark"] .nav a,
[data-theme="dark"] #content a,
[data-theme="dark"] .exp-toggle,
[data-theme="dark"] .exp-at {
  color: #ff6b6b;
}

[data-theme="dark"] .nav a:hover,
[data-theme="dark"] .nav a:focus {
  background-color: #2a1818;
  color: #ff6b6b;
}

[data-theme="dark"] .avatar img {
  border-color: #2a2a2a;
}

[data-theme="dark"] .exp-body li::marker {
  color: #ff6b6b;
}

[data-theme="dark"] .switch {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] ::selection {
  background-color: #3a1c1c;
  color: #fff;
}

/* ========================================
   Print: expand everything for printing
   ======================================== */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.5;
  }

  .nav,
  .header-divider,
  .avatar,
  .switch,
  .exp-toggle {
    display: none !important;
  }

  h2 {
    page-break-after: avoid;
    border-bottom: 1px solid #999;
    color: #000 !important;
  }

  details.exp {
    page-break-inside: avoid;
    margin-bottom: 1rem;
  }

  details.exp .exp-body {
    display: block !important;
  }

  details.exp:not([open]) .exp-body {
    display: block !important;
  }
}