/* Sebastian Ikin — global stylesheet
   Inspired by ssi.inc: dark palette, centered column, minimal chrome. */

:root {
  --bg: #0b0d10;
  --bg-elevated: #12151a;
  --fg: #e8eaed;
  --fg-muted: #9aa0a6;
  --accent: #8ab4f8;
  --border: #2a2e35;
  --max-width: 42rem;
}

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

html {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Links are always clearly differentiated from plaintext: accent colour
   plus a persistent underline. */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

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

/* --- Header / Nav --- */
.site-header {
  padding: 1.5rem 1rem 0;
}

.site-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}

.site-nav a {
  text-decoration: none;
  color: var(--fg-muted);
  padding: 0 0.35rem;
}

.site-nav a:hover {
  color: var(--accent);
}

.nav-home {
  font-weight: 600;
  color: var(--fg) !important;
}

/* Pipe separator between the home link and the rest of the nav */
.site-nav .nav-pipe {
  color: var(--border);
  padding: 0 0.4rem;
  font-weight: 400;
}

/* --- Main content --- */
.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 4rem;
  text-align: left;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2.1rem;
  margin: 0 0 1.5rem;
}

h2 {
  font-size: 1.4rem;
  margin: 2.5rem 0 1rem;
}

h3 {
  font-size: 1.1rem;
  margin: 2rem 0 0.75rem;
}

h4 {
  font-size: 1rem;
  margin: 2rem 0 0.5rem;
  color: var(--fg-muted);
}

p {
  margin: 0 0 1.1rem;
}

ul,
ol {
  margin: 0 0 1.1rem 1.25rem;
  text-align: left;
}

li {
  margin-bottom: 0.45rem;
}

strong {
  color: var(--fg);
  font-weight: 600;
}

em {
  color: var(--fg-muted);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
  width: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border-radius: 6px;
}

code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}

pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  text-align: left;
}

pre code {
  border: none;
  padding: 0;
}

blockquote {
  border-left: 2px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--fg-muted);
}

/* --- Landing page --- */
.landing-page > p:first-of-type {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--fg);
  margin-bottom: 2rem;
}

/* --- Landing page project search --- */
/* Search field + suggestion list, read from the embedded project index
   by assets/search.js. The suggestions sit directly below the field (no
   overlay) so the recent-projects list also explains what to type. */
.project-search {
  margin: 0 0 2.5rem;
  max-width: 32rem;
}

.project-search .search-label {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}

.project-search #project-search-input {
  width: 100%;
  padding: 0.5rem 0.8rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.project-search #project-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-results {
  list-style: none;
}

.search-results .search-status {
  margin: 0.6rem 0 0.4rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.search-results .search-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.search-results .search-item a {
  display: inline-block;
}

.search-results .search-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* "More <keyword> projects" line under the suggestions */
.search-results .search-more {
  margin: 0.6rem 0 0.4rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* --- CV sections --- */
.cv-section h2,
.cv-section h3 {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

/* --- Blog / Reading indexes --- */
.blog-tags,
.reading-tags,
.project-tags {
  margin: 0 0 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.4rem;
  max-width: 32rem;
}

.blog-tags .tag,
.reading-tags .tag,
.project-tags .tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.blog-tags .tag:hover,
.reading-tags .tag:hover,
.project-tags .tag:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Filter pills on /reading/ and /cv/projects/ are buttons toggled by script */
.reading-tags .tag,
.project-tags .tag {
  background: none;
  font-family: inherit;
  cursor: pointer;
}

.reading-tags .tag.active,
.project-tags .tag.active {
  color: var(--accent);
  border-color: var(--accent);
}

/* Projects index: tighter spacing between the experience/domain/skill groups */
.projects-index .project-tags {
  margin-bottom: 0.6rem;
}

/* In-line filter row: one pill row per experience (no dropdown) plus one
   collapsible dropdown per remaining filter type. */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0 0 2rem;
}

/* On the projects page the experience pill row sits alone in the row,
   above the stacked dropdowns; keep the tighter group spacing there. */
.projects-index .filter-row {
  margin: 0 0 0.6rem;
}

/* Projects index: description entry from the managed index, shown under
   the page title as muted intro text. */
.projects-index .project-description {
  color: var(--fg-muted);
  max-width: 42rem;
}

/* Projects index: header above the experience filter pills. */
.projects-index .experience-header {
  margin: 2rem 0 0.8rem;
}

/* Inside the row, spacing comes from the row's gap */
.filter-row .filter-dropdown {
  margin: 0;
}

/* Experience pills match the size of the dropdown trigger buttons next to
   them (padding/typeface borrowed from .filter-dropdown summary). */
.filter-row > .project-tags {
  margin: 0;
}

.filter-row > .project-tags .tag {
  padding: 0.35rem 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reading-filter-label {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* Collapsible filter groups (native <details> dropdowns) */
.filter-dropdown {
  display: block;
  margin: 0 0 0.6rem;
}

.filter-dropdown summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.filter-dropdown summary::before {
  content: "▸";
  font-size: 0.65rem;
  transition: transform 0.15s ease;
}

.filter-dropdown[open] summary::before {
  transform: rotate(90deg);
}

.filter-dropdown summary:hover,
.filter-dropdown[open] summary {
  color: var(--accent);
  border-color: var(--accent);
}

.filter-dropdown .project-tags,
.filter-dropdown .reading-tags {
  margin: 0.6rem 0 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--bg-elevated);
}

.blog-list,
.reading-list,
.project-list {
  list-style: none;
  margin-left: 0;
}

.blog-item,
.reading-item,
.project-item {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}

.blog-item a,
.reading-item a,
.reading-title,
.project-item a {
  font-weight: 600;
  font-size: 1.05rem;
}

.blog-item a,
.reading-item a,
.project-item a {
  text-decoration: none;
}

.blog-item-description,
.reading-comment {
  margin: 0.35rem 0 0.4rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.blog-meta,
.reading-meta,
.project-meta {
  display: block;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 0.25rem;
}

/* --- Blog / Reading posts --- */
.blog-post,
.reading-review,
.project-page {
  max-width: 38rem;
  margin: 0 auto;
}

.blog-post h1,
.reading-review h1,
.project-page h1 {
  text-align: left;
}

/* Post/entry header metadata injected after the h1 at build time */
.post-meta {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin: -0.75rem 0 1.5rem;
}

/* --- Projects index --- */
.project-list {
  margin: 0 0 2rem;
}

/* --- Footer --- */
.site-footer {
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--fg-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
}

.site-footer a.footer-icon {
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
}

.site-footer a.footer-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.site-footer a.footer-icon:hover {
  color: var(--accent);
}

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

  .site-main {
    padding: 2.5rem 1rem 3rem;
  }

  h1 {
    font-size: 1.7rem;
  }

  .site-nav {
    font-size: 0.78rem;
  }

  .site-nav a {
    padding: 0 0.2rem;
  }
}
