/* IdleEndeavor — minimal full-width timeline
   Design: pale cool paper + near-black ink, one slate-indigo "thread"
   running straight down the page. Fjalla One + Merriweather — the same
   display/body pairing as the original Jekyll theme — with a plain
   system sans for UI chrome. */

@font-face {
  font-family: 'Fjalla One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/fjalla-one-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/merriweather-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/merriweather-bold.woff2') format('woff2');
}

:root {
  --paper: #faf9f6;
  --paper-raised: #f1eee6;
  --ink: #17181c;
  --ink-soft: #5b5e66;
  --ink-faint: #9a9ca3;
  --thread: #45577a;
  --thread-line: rgba(69, 87, 122, 0.5);
  --hairline: rgba(23, 24, 28, 0.12);
  --focus: #45577a;

  --font-display: 'Fjalla One', Helvetica Neue, Helvetica, Arial, sans-serif;
  --font-body: 'Merriweather', Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --content-w: 40rem;
  --post-w: 50rem;
  --gutter: clamp(1.25rem, 4vw, 4rem);
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: .75rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

a { color: inherit; }

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--gutter);
  background: rgba(250, 249, 246, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.wordmark__logo {
  height: 2.25rem;
  width: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.btn-chrome {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color .15s ease;
}
.btn-chrome:hover {
  color: var(--thread);
}
.btn-chrome[aria-current="page"] {
  color: var(--ink);
}
.btn-chrome--icon {
  display: inline-flex;
  align-items: center;
}

/* ---------- search panel ---------- */

.search-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(23, 24, 28, 0.35);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1.5rem 1.5rem;
}
.search-panel[hidden] { display: none; }

.search-panel__inner {
  position: relative;
  width: 100%;
  max-width: 34rem;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(23, 24, 28, 0.18);
}

.search-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.25rem;
  border: none;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  padding: .5rem 2rem .75rem 0;
}
.search-input:focus { outline: none; border-bottom-color: var(--thread); }

.search-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}
.search-close:hover { color: var(--ink); }

.search-results {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  max-height: 50vh;
  overflow-y: auto;
}
.search-results li a {
  display: block;
  text-decoration: none;
  padding: .7rem .25rem;
  border-bottom: 1px solid var(--hairline);
}
.search-results li:last-child a { border-bottom: none; }
.search-results .result-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: .01em;
  color: var(--ink);
}
.search-results .result-meta {
  display: block;
  font-family: var(--font-ui);
  font-size: .75rem;
  color: var(--ink-faint);
  margin-top: .15rem;
}
.search-empty {
  font-family: var(--font-ui);
  font-size: .875rem;
  color: var(--ink-faint);
  padding: .75rem .25rem 0;
  margin: 0;
}

/* ---------- hero ---------- */

.hero {
  padding: clamp(3rem, 10vw, 7rem) var(--gutter) clamp(2rem, 6vw, 3rem);
  max-width: 56rem;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.75rem, 8vw, 5.25rem);
  letter-spacing: .01em;
  margin: 0;
  line-height: .95;
}
.hero__subtitle {
  font-family: var(--font-ui);
  font-size: .9375rem;
  color: var(--ink-soft);
  margin: .75rem 0 0;
}

/* ---------- view toggle ---------- */

.view-toggle-row {
  padding: 0 var(--gutter);
  display: flex;
  justify-content: flex-end;
  margin-bottom: .5rem;
}
.view-toggle {
  font-family: var(--font-ui);
  font-size: .8125rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: none;
  border: none;
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: .2em;
  cursor: pointer;
  padding: .25rem 0;
}
.view-toggle:hover { color: var(--thread); text-decoration-color: var(--thread-line); }

/* ---------- list view ---------- */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0 var(--gutter) 6rem;
  max-width: 46rem;
}
.list-entry {
  border-bottom: 1px solid var(--hairline);
}
.list-entry a {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  align-items: baseline;
  gap: 1.25rem;
  text-decoration: none;
  color: var(--ink);
  padding: .9rem 0;
}
.list-entry time {
  font-family: var(--font-ui);
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
  text-align: right;
}
.list-entry__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.list-entry a:hover .list-entry__title { color: var(--thread); }

/* ---------- timeline ---------- */

.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 1rem var(--gutter) 8rem;
  width: 100%;
}

.thread {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: linear-gradient(var(--thread-line), var(--thread-line));
  z-index: 0;
}

.entry {
  position: relative;
  z-index: 1;
  width: min(42%, 34rem);
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
  opacity: 0;
  transform: translateY(28px) rotate(calc(var(--tilt) * -3));
  transition: opacity .7s ease, transform .7s cubic-bezier(.16,1,.3,1);
}
.entry.is-visible {
  opacity: 1;
  transform: translateY(0) rotate(var(--tilt));
}
.entry--left { margin-right: auto; text-align: right; }
.entry--right { margin-left: auto; text-align: left; }

.entry__node {
  position: absolute;
  top: .5em;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--thread);
}
.entry--left .entry__node { right: calc(-1 * var(--gutter) / 1.1 - 4px); }
.entry--right .entry__node { left: calc(-1 * var(--gutter) / 1.1 - 4px); }

.entry__card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: .375rem;
  padding: 1.25rem 1.5rem;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.entry__card:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 0 10px 30px rgba(23,24,28,0.08);
  border-color: var(--thread-line);
}

.entry__date {
  display: block;
  font-family: var(--font-ui);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .4rem;
}
.entry__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: .005em;
  line-height: 1.15;
  margin: 0 0 .5rem;
}
.entry__tags {
  font-family: var(--font-ui);
  font-size: .75rem;
  color: var(--thread);
  margin: 0 0 .5rem;
}
.entry__excerpt {
  font-size: .9375rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
}

@media (max-width: 46rem) {
  .thread { left: 1.1rem; }
  .entry, .entry--left, .entry--right {
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left;
    padding-left: 2rem;
  }
  .entry--left .entry__node, .entry--right .entry__node {
    left: -.65rem;
    right: auto;
  }
}

/* ---------- post page ---------- */

.post {
  max-width: var(--post-w);
  margin: 0 auto;
  padding: 2rem var(--gutter) 6rem;
}
.post__date {
  display: block;
  font-family: var(--font-ui);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .5rem;
}
.post__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5.5vw, 2.85rem);
  letter-spacing: .005em;
  line-height: 1.1;
  margin: 0 0 .75rem;
}
.post__tags {
  font-family: var(--font-ui);
  font-size: .8125rem;
  color: var(--thread);
  margin: 0 0 2rem;
}
.post__image {
  width: 100%;
  height: auto;
  max-height: 26rem;
  object-fit: cover;
  border-radius: .5rem;
  margin: 0 0 2rem;
}
.post__body { font-size: 1.0625rem; }
.post__body h1, .about__body h1,
.post__body h2, .about__body h2,
.post__body h3, .about__body h3,
.post__body h4, .about__body h4,
.post__body h5, .about__body h5,
.post__body h6, .about__body h6 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .005em;
  line-height: 1.2;
  margin: 2.25rem 0 .75rem;
}
.post__body h1, .about__body h1 { font-size: 1.75rem; }
.post__body h2, .about__body h2 { font-size: 1.55rem; }
.post__body h3, .about__body h3 { font-size: 1.375rem; }
.post__body h4, .about__body h4 { font-size: 1.1875rem; }
.post__body h5, .about__body h5,
.post__body h6, .about__body h6 {
  font-family: var(--font-ui);
  font-size: .8125rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.post__body p { margin: 0 0 1.25rem; }
.post__body a { color: var(--thread); text-decoration-color: var(--thread-line); }
.post__body ul, .about__body ul,
.post__body ol, .about__body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}
.post__body li, .about__body li { margin: 0 0 .4rem; }
.post__body blockquote {
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--thread);
  font-style: italic;
  color: var(--ink-soft);
}
.post__body blockquote cite,
.about__body blockquote cite {
  display: block;
  margin-top: .5rem;
  font-family: var(--font-ui);
  font-style: normal;
  font-size: .8125rem;
  color: var(--ink-faint);
}
.post__body img { border-radius: .5rem; margin: 1.5rem 0; }
.post__body pre {
  overflow-x: auto;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: .375rem;
  padding: 1rem 1.25rem;
  margin: 0 0 1.25rem;
  font-size: .8125rem;
  line-height: 1.55;
}
.post__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .875em;
}
.post__body p > code {
  background: var(--paper-raised);
  border-radius: .25rem;
  padding: .1em .35em;
}
.post__body .download-btn {
  display: inline-block;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: .5rem 1.1rem;
  margin: .25rem 0;
  font-weight: 700;
  transition: border-color .15s ease, background .15s ease;
}
.post__body .download-btn:hover {
  border-color: var(--thread);
  background: var(--paper);
}
.post__back {
  margin-top: 3rem;
  font-family: var(--font-ui);
  font-size: .875rem;
}
.post__back a { text-decoration: none; color: var(--ink-soft); }
.post__back a:hover { color: var(--thread); }

/* ---------- about page ---------- */

.about {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 3rem var(--gutter) 6rem;
}
.about__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 6.5vw, 3rem);
  letter-spacing: .005em;
  margin: 0 0 1.5rem;
}
.about__body p { margin: 0 0 1.25rem; }
.about__body blockquote {
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--thread);
  font-style: italic;
  color: var(--ink-soft);
}
.about__body a { color: var(--thread); }

/* ---------- projects (about page) ---------- */

.projects {
  border-top: 1px solid var(--hairline);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
}
.projects__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.125rem;
  letter-spacing: .01em;
  margin: 0 0 .75rem;
}
.projects__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  font-size: .9375rem;
}
.projects__list a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dotted var(--hairline);
}
.projects__list a:hover { color: var(--thread); border-color: var(--thread-line); }

@media (prefers-reduced-motion: reduce) {
  .entry {
    transition: none;
    transform: none;
    opacity: 1;
  }
}
