/* ===========================================================
   Screen: clean, modern dark theme
   =========================================================== */
:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --line: #334155;
  --fg: #cbd5e1;
  --heading: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at top, rgba(56, 189, 248, .10), transparent 55%),
    var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.content {
  max-width: 820px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
}

/* --- Header -------------------------------------------------- */
h1 {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin: 0 0 .5rem;
  color: #fff;
}

h1 + p {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 1.2rem;
}
h1 + p strong { color: var(--heading); font-weight: 600; }

/* contact list directly under the subtitle */
:is(h1 + p + ul, .links > ul) {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
:is(h1 + p + ul, .links > ul) li {
  margin: 0;
  padding: .35rem .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .9rem;
}
:is(h1 + p + ul, .links > ul) li::marker { content: none; }
:is(h1 + p + ul, .links > ul) strong { color: var(--muted); font-weight: 500; }

/* pills that are a link: the whole pill is clickable */
:is(h1 + p + ul, .links > ul) li:has(> a:only-child) { padding: 0; transition: border-color .15s; }
:is(h1 + p + ul, .links > ul) li:has(> a:only-child):hover { border-color: var(--accent); }
:is(h1 + p + ul, .links > ul) li > a:only-child {
  display: block;
  padding: .35rem .9rem;
  color: var(--heading);
  text-decoration: none;
}
:is(h1 + p + ul, .links > ul) li > a:only-child::after { content: " ↗"; color: var(--accent); }

/* --- Section headings --------------------------------------- */
h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  margin: 3.5rem 0 1.5rem;
}
h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* --- Timeline entries (companies, schools) ------------------- */
section.level3 {
  position: relative;
  padding: 0 0 1.6rem 1.75rem;
  border-left: 2px solid var(--line);
  margin-left: .4rem;
}
section.level3:last-child { padding-bottom: .5rem; }
section.level3::before {
  content: "";
  position: absolute;
  left: -7px;
  top: .45rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: background .2s, box-shadow .2s;
}
section.level3:hover::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .2);
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 .1rem;
  line-height: 1.4;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading);
  margin: 1rem 0 .2rem;
}
h4 em { font-weight: 400; }

h3 + p, h4 + p { margin-top: 0; }
p { margin: .3rem 0 .6rem; }

em {
  font-style: normal;
  color: var(--muted);
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
}
strong { color: var(--heading); font-weight: 600; }

/* --- Summary & skills ---------------------------------------- */
#summary p { font-size: 1.05rem; color: var(--fg); }

#skills ul, #languages ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
#skills li, #languages li { margin: 0; padding: 0; display: grid; grid-template-columns: 10rem 1fr; gap: 0 .5rem; }
#skills li::marker, #languages li::marker { content: none; }
#skills strong, #languages strong {
  display: inline-block;
  min-width: 10rem;
  color: var(--muted);
  font-weight: 500;
}

/* --- Lists --------------------------------------------------- */
ul { padding-left: 1.2rem; margin: .4rem 0 .8rem; }
li { margin: .25rem 0; padding-left: .2rem; }
li::marker { color: var(--accent); }

/* --- Links & reveal button ----------------------------------- */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s;
}
a:hover { color: var(--accent-2); text-decoration: underline; }

.reveal-btn {
  font: inherit;
  font-size: .85rem;
  color: var(--accent);
  background: rgba(56, 189, 248, .1);
  border: 1px solid rgba(56, 189, 248, .35);
  border-radius: 999px;
  padding: .05rem .7rem;
  cursor: pointer;
  transition: background .15s;
}
.reveal-btn:hover { background: rgba(56, 189, 248, .2); }

/* --- Misc ---------------------------------------------------- */
hr { display: none; }

table { border-collapse: collapse; width: 100%; }
th, td {
  text-align: left;
  padding: .6rem 1rem .6rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 500; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
td:first-child { color: var(--heading); font-weight: 600; white-space: nowrap; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 2rem 1rem 3rem;
}
kbd {
  font: inherit;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 .3rem;
}

::selection { background: rgba(56, 189, 248, .3); }

@media (max-width: 600px) {
  html { font-size: 15px; }
  .content { padding-top: 2.5rem; }
  section.level3 { padding-left: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* primary call-to-action pill (e.g. "View my CV") */
:is(h1 + p + ul, .links > ul) li:has(> a.cta) {
  background: var(--accent);
  border-color: var(--accent);
}
:is(h1 + p + ul, .links > ul) li > a.cta { color: var(--bg); font-weight: 600; }
:is(h1 + p + ul, .links > ul) li > a.cta::after { content: none; }
/* CTA and icon buttons share one height so they line up */
.links { --btn-h: 3.25rem; }
:is(h1 + p + ul, .links > ul) li > a.cta {
  display: flex;
  align-items: center;
  height: var(--btn-h);
  padding: 0 1.9rem;
  font-size: 1.1rem;
}
:is(h1 + p + ul, .links > ul) li > a.icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  /* +2px matches the CV button's 1px border on each side */
  width: calc(var(--btn-h) + 2px);
  height: calc(var(--btn-h) + 2px);
  padding: 0;
  color: var(--heading);
}
:is(h1 + p + ul, .links > ul) li > a.icon-link::after { content: none; }
:is(h1 + p + ul, .links > ul) li > a.icon-link svg { width: 100%; height: 100%; display: block; }
/* icon button: no border, glows like the CV button only on hover */
:is(h1 + p + ul, .links > ul) li:has(> a.icon-link) {
  border: 0;
  box-shadow: none;
  transition: box-shadow .2s;
}
:is(h1 + p + ul, .links > ul) li:has(> a.icon-link):hover {
  box-shadow: 0 0 28px rgba(56, 189, 248, .7), 0 0 6px rgba(125, 211, 252, .8);
}
:is(h1 + p + ul, .links > ul) li:has(> a.cta) {
  box-shadow: 0 0 18px rgba(56, 189, 248, .45), 0 0 4px rgba(56, 189, 248, .6);
  transition: box-shadow .2s, background .2s;
}
:is(h1 + p + ul, .links > ul) li:has(> a.cta):hover {
  background: #7dd3fc;
  border-color: #7dd3fc;
  box-shadow: 0 0 28px rgba(56, 189, 248, .7), 0 0 6px rgba(125, 211, 252, .8);
}

/* ===========================================================
   Landing page: project cards
   =========================================================== */
#about p { font-size: 1.05rem; }
.home .content > section:first-child > h2 { margin-top: 0; }
.links > ul { margin: 0; align-items: center; }

.home section.level3 {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(30, 41, 59, .55);
  padding: 1.4rem 1.6rem;
  margin: 0 0 1.25rem;
  transition: border-color .2s, transform .2s;
}
.home section.level3::before { content: none; }
.home section.level3:hover { border-color: var(--accent); transform: translateY(-2px); }
.home section.level3 h3 { margin-bottom: .2rem; }
.home section.level3 h3 + p { margin-bottom: .8rem; }
/* titles in prose (e.g. game names) are plain italics, not the muted date style */
#about em, .home section.level3 h3 + p ~ p em { font-style: italic; color: inherit; font-size: inherit; }

/* last paragraph of a card = its links, shown as small buttons */
.home section.level3 > p:last-child { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
.home section.level3 > p:last-child a {
  padding: .25rem .9rem;
  border: 1px solid rgba(56, 189, 248, .4);
  border-radius: 999px;
  font-size: .85rem;
}
.home section.level3 > p:last-child a:hover {
  background: rgba(56, 189, 248, .12);
  text-decoration: none;
}

#also-on-github ul { list-style: none; padding: 0; }
#also-on-github li::marker { content: none; }

@media (prefers-reduced-motion: reduce) {
  .home section.level3:hover { transform: none; }
}

/* ===========================================================
   CV page: print / save as PDF button (top right)
   =========================================================== */
.content { position: relative; }
.cv .content { padding-top: 2rem; }
.print-btn {
  --print-h: 2.3rem;
  position: absolute;
  /* vertically centred on the name: page top padding + half of (name line height - button height) */
  top: calc(2rem + (clamp(2.2rem, 6vw, 3.2rem) * 1.1 - var(--print-h)) / 2);
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: var(--print-h);
  padding: 0 1rem;
  font: inherit;
  font-size: .85rem;
  color: var(--muted);
  background: var(--surface);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s, box-shadow .2s;
}
.print-btn svg { width: 1rem; height: 1rem; }
.print-btn:hover {
  color: var(--heading);
  box-shadow: 0 0 28px rgba(56, 189, 248, .7), 0 0 6px rgba(125, 211, 252, .8);
}
.print-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* too narrow for the label next to the name: icon-only round button on the same line */
@media (max-width: 480px) {
  .print-btn { width: var(--print-h); padding: 0; justify-content: center; }
  .print-label { display: none; }
}

/* ===========================================================
   Print: clean, white background, black text
   =========================================================== */
@media print {
  @page { size: A4; margin: 11mm 14mm; }

  html { font-size: 10pt; }

  *, *::before, *::after {
    color: #000 !important;
    background: none !important;
    box-shadow: none !important;
  }

  body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    line-height: 1.3;
  }

  .no-print { display: none !important; }
  .content { padding: 0; max-width: none; }

  h1 {
    font-size: 22pt;
    margin-bottom: 2pt;
  }
  h1 + p { font-size: 11pt; margin-bottom: 4pt; }

  :is(h1 + p + ul, .links > ul) { gap: 0 14pt; margin-bottom: 0; }
  :is(h1 + p + ul, .links > ul) li { padding: 0; border: 0; border-radius: 0; font-size: 10.5pt; }
  :is(h1 + p + ul, .links > ul) li > a:only-child { padding: 0; }
  :is(h1 + p + ul, .links > ul) li > a:only-child::after { content: none; }

  h2 {
    display: block;
    font-size: 12pt;
    letter-spacing: .08em;
    border-bottom: 1px solid #000;
    padding-bottom: 2pt;
    margin: 14pt 0 6pt;
  }
  h2::after { content: none; }

  section.level3 { border: 0; padding: 0 0 4pt; margin: 0; }
  section.level3::before { content: none; }

  h3 { font-size: 11pt; margin-top: 6pt; }
  h4 { font-size: 10.5pt; margin: 5pt 0 1pt; }
  h2, h3, h4 { break-after: avoid; }
  li { break-inside: avoid; }

  em { font-style: italic; font-size: inherit; }

  ul { margin: 2pt 0 4pt; }
  li { margin: 0; }
  li::marker { color: #000 !important; }

  a { text-decoration: none; }

  th, td { border-bottom: 1px solid #999; padding: 1pt 8pt 1pt 0; }
  th { font-size: 9pt; }

  #summary p { font-size: inherit; max-width: none; margin: 0; }
  #skills ul, #languages ul { gap: 0; margin: 0; }
  #skills strong { min-width: 8.5rem; }
  h2 { margin: 8pt 0 4pt; }
  h3 { margin-top: 4pt; }
  section.level3 { padding-bottom: 2pt; }
  h3 + p, h4 + p { margin-bottom: 1pt; }

  .home section.level3 { border: 0; padding: 0; margin: 0 0 6pt; transform: none; }
  .home section.level3 > p:last-child a { border: 0; padding: 0; }
  :is(h1 + p + ul, .links > ul) li > a.cta::after { content: none; }

  /* page 1 = header + IONITY; older roles start on page 2 with more breathing room */
  #jumio-corporation { break-before: page; }
  #jumio-corporation ~ section.level3, #experience ~ section section.level3 { break-inside: avoid; }
  #jumio-corporation, #jumio-corporation ~ section.level3,
  #experience ~ section { line-height: 1.5; }
  #jumio-corporation ~ section.level3, #experience ~ section section.level3 { padding-top: 6pt; }
  #experience ~ section > h2 { margin-top: 16pt; }
}
