/* Dark, text-first theme. Display font for headings, Inter for body. */
:root {
  --bg: #0b1426;
  --bg-elev: #111d33;
  --border: #1f2d4a;
  --fg: #f2f2f2;
  --fg-2: #b7c0d4;
  --muted: #7f8ba6;
  --accent: #2fbf71;
  --accent-bright: #32d57a;
  --display: "Tektur", "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", -apple-system, system-ui, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

html { color-scheme: dark; background: var(--bg); }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--fg);
  font: 400 17px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-bright); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }
.muted { color: var(--muted); }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; }
h2 { font-size: 2rem; margin-bottom: 1.75rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 76px; }
.site-header nav { text-align: center; }
.logo {
  justify-self: start; display: inline-flex; align-items: center; gap: .35rem; height: 48px; padding: 0 .8rem;
  background: #050b18; border: 1px solid var(--border); border-radius: 6px; color: #fff;
}
.logo-text { font: italic 500 1.15rem/1 "Ubuntu", "Ubuntu Sans", system-ui, sans-serif; letter-spacing: .02em; }
.logo .tryzub { color: var(--accent-bright); flex: none; }
.logo:hover .tryzub { color: #ffd500; }
.site-header nav a { font-family: var(--display); font-size: .95rem; margin: 0 .9rem; color: var(--fg); }
.lang-switch { justify-self: end; display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; font-size: .8rem; font-weight: 600; letter-spacing: .05em; }
.lang-switch a { padding: .35rem .7rem; color: var(--muted); }
.lang-switch a.active { background: var(--bg-elev); color: var(--fg); }
.lang-switch a:hover { color: var(--accent-bright); }
.lang-filter { font-size: .9rem; margin: -.5rem 0 2rem; }
.lang-filter a { color: var(--accent); }
.translation-note { margin: -1.25rem 0 2rem; color: var(--fg-2); }
.translation-note a { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; }
.site-header nav a:hover { color: var(--accent-bright); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 3rem; align-items: center; padding: 6rem 0 4rem; }
.hero h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); max-width: 20ch; }
.bio { color: var(--fg-2); font-size: 1.15rem; max-width: 52ch; margin: 1.75rem 0 .5rem; }
.location { color: var(--muted); margin: 0 0 1.5rem; font-size: .95rem; }
.social { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; }
.social a { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; color: var(--fg-2); }
.social a:hover { color: var(--accent-bright); }
.social .icon { opacity: .8; }
.hero-art svg { width: 100%; height: auto; max-height: 300px; }

.section { padding: 3rem 0; }

/* Contribution graph */
.contrib { display: grid; grid-template-columns: 1fr; }
.contrib-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem 2rem 1.75rem; }
.contrib-scroll { overflow-x: auto; }
.contrib-months, .contrib-grid { --cell: 16px; --gap: 5px; display: grid; grid-auto-columns: var(--cell); column-gap: var(--gap); }
.contrib-months { grid-template-rows: 1fr; grid-auto-flow: column; height: 1.6rem; font-size: .85rem; white-space: nowrap; }
.contrib-grid { grid-template-rows: repeat(7, var(--cell)); grid-auto-flow: column; row-gap: var(--gap); }
.contrib-grid i, .legend i { display: block; width: var(--cell, 16px); height: var(--cell, 16px); border-radius: 3px; background: #0d1a2e; }
.l1 { background: #0e4429 !important; }
.l2 { background: #006d32 !important; }
.l3 { background: #26a641 !important; }
.l4 { background: #39d353 !important; }
.contrib-foot { display: flex; justify-content: space-between; margin-top: 1rem; font-size: .95rem; }
.legend { display: inline-flex; align-items: center; gap: 4px; }
.legend i { --cell: 14px; display: inline-block; }

/* Work experience */
.jobs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem 4rem; }
.job { display: grid; grid-template-columns: 96px 1fr; gap: 1.5rem; position: relative; }
.job-logo {
  position: relative; z-index: 1; width: 96px; height: 96px; display: grid; place-items: center;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px;
}
.job-logo img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
.job-logo span { font-family: var(--display); font-size: 2rem; color: var(--accent); }
.job::after { content: ""; position: absolute; left: 47px; top: 96px; bottom: -3rem; width: 1px; background: var(--border); }
.job:nth-last-child(-n+2)::after { display: none; }
.job h3 { font-size: 1.25rem; padding-top: .35rem; }
.job-role { margin: .15rem 0 .35rem; font-size: 1.05rem; }
.job-dates { margin: 0 0 1rem; color: var(--muted); font-size: .9rem; letter-spacing: .12em; text-transform: uppercase; }
.job-dates .present { color: var(--accent-bright); }
.job-desc { margin: 0; color: var(--fg-2); }
.job-more { margin-top: .75rem; }
.job-more summary { cursor: pointer; color: var(--accent); font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; }
.job-more summary:hover { color: var(--accent-bright); }
.job-more ul { margin: .75rem 0 0; padding-left: 1.1rem; color: var(--fg-2); font-size: .97rem; }
.job-more li { margin-bottom: .5rem; }

.skills { color: var(--fg-2); }
.skills strong { color: var(--fg); margin-right: .5rem; }
.chip { display: inline-block; padding: .1rem .6rem; margin: .15rem .3rem .15rem 0; border: 1px solid var(--border); border-radius: 999px; font-size: .9rem; }

/* Post lists */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.post-list time { display: inline-block; width: 8rem; color: var(--muted); font-size: .9rem; }
.post-list a { font-weight: 500; }
.more { color: var(--accent); }

.page-title { font-size: 2.4rem; margin: 3rem 0 2rem; }
.post-summary { max-width: 46rem; margin-bottom: 2.5rem; }
.post-summary .post-meta { margin: 0; }
.post-summary h2 { font-size: 1.5rem; margin: .3rem 0 .5rem; }
.post-summary p { color: var(--fg-2); margin: 0 0 .5rem; }
.tags a { color: var(--muted); margin-right: .5rem; font-size: .9rem; }
.tags a:hover { color: var(--accent-bright); }
.pagination { display: flex; justify-content: space-between; max-width: 46rem; margin: 2rem 0; }
.back { display: inline-block; margin: 1rem 0 3rem; color: var(--muted); }

/* Single post */
.post { max-width: 46rem; margin: 3rem 0 0; }
.post h1 { font-size: 2.4rem; margin-bottom: .5rem; }
.post-meta { color: var(--muted); font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 2rem; }
.post-meta .sep { margin: 0 .3rem; }
.read-time { margin-left: .75rem; font-size: .85rem; }
.post-body { font-size: 1.1rem; color: #e4e4e6; }
.post-body h2, .post-body h3 { margin: 2rem 0 .75rem; }
.post-body h2 { font-size: 1.5rem; }
.post-body a { color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; }
.post-body img { max-width: 100%; border-radius: 8px; }
.post-body pre { background: #081020; border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; overflow-x: auto; font: .9rem/1.5 var(--mono); }
.post-body code { font-family: var(--mono); font-size: .92em; background: #081020; padding: .1rem .35rem; border-radius: 4px; }
.post-body pre code { background: none; padding: 0; }
.post-body blockquote { border-left: 3px solid var(--accent); margin: 1.5rem 0; padding-left: 1rem; color: var(--fg-2); }
.post-body table { border-collapse: collapse; }
.post-body td, .post-body th { border: 1px solid var(--border); padding: .35rem .7rem; }
.notice { background: #2a2416; border: 1px solid #4a3f1e; color: #f1d789; padding: .6rem .9rem; border-radius: 6px; font-size: .95rem; }

/* Locked post */
.locked { text-align: left; }
.unlock-form { display: flex; gap: .6rem; margin-top: 1.5rem; max-width: 26rem; }
.unlock-form input { flex: 1; padding: .7rem .9rem; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 6px; color: var(--fg); font: inherit; }
.unlock-form button { padding: .7rem 1.2rem; background: var(--accent-bright); border: 0; border-radius: 6px; color: #0b2a19; font: 600 1rem var(--body); cursor: pointer; }
.errorlist { list-style: none; padding: 0; margin: 0 0 .5rem; color: #f28b82; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 4rem; padding: 3rem 0; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.site-footer p { margin: 0; }
.site-footer a { font-weight: 500; }
.site-footer .sep { color: var(--muted); margin: 0 .4rem; }

/* Pygments (codehilite) */
.highlight .k, .highlight .kn, .highlight .kd { color: #c792ea; }
.highlight .s, .highlight .s1, .highlight .s2 { color: #c3e88d; }
.highlight .nf, .highlight .fm { color: #82aaff; }
.highlight .c, .highlight .c1 { color: #6b6b73; font-style: italic; }
.highlight .mi, .highlight .mf { color: #f78c6c; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 3.5rem; }
  .hero-art { display: none; }
  .jobs { grid-template-columns: 1fr; gap: 2.5rem; }
  .job:nth-last-child(-n+2)::after { display: block; }
  .job:last-child::after { display: none; }
  .contrib { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  /* Logo and language switcher on the first row, nav wraps beneath. */
  .site-header .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; height: auto; padding-top: .75rem; padding-bottom: .75rem; gap: .5rem 1rem; }
  .site-header nav { order: 3; width: 100%; text-align: left; }
  .site-header nav a { margin: 0 1.1rem 0 0; }
}
@media (max-width: 600px) {
  .job { grid-template-columns: 64px 1fr; gap: 1rem; }
  .job-logo { width: 64px; height: 64px; }
  .job::after { left: 31px; top: 64px; }
  .post-list time { display: block; width: auto; }
}

/* Cookie-consent banner (only rendered when GA is configured) */
.consent { position: fixed; right: 1rem; bottom: 1rem; left: 1rem; max-width: 30rem; margin-left: auto; padding: 1rem 1.25rem; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); z-index: 50; }
.consent p { margin: 0 0 .75rem; color: var(--fg-2); font-size: .95rem; }
.consent-actions { display: flex; gap: .6rem; }
.consent button { padding: .55rem 1.1rem; background: var(--accent-bright); border: 0; border-radius: 6px; color: #0b2a19; font: 600 .9rem var(--body); cursor: pointer; }
.consent button.secondary { background: transparent; border: 1px solid var(--border); color: var(--fg-2); }
.consent button.secondary:hover { color: var(--fg); border-color: var(--fg-2); }
