/* ============================================================
   CV Website — the only stylesheet (black & white, minimalist)
   The HTML has no classes or ids: everything below targets
   plain elements by where they sit in the page.
     index.html  → <main>
     cv.html     → <nav> (top buttons) and <article> (the CV)
   ============================================================ */

/* ---------- Colours, fonts, sizes ---------- */

:root {
  --bg: #d6d1bc;
  --ink: #000;
  --ink-blue: rgb(73, 99, 141);
  --ink-p: rgb(93, 161, 93);
  --soft: #595959;
  --hair: #000;

  /* Atkinson Hyperlegible: designed for maximum letter clarity */
  --font-display: "Atkinson Hyperlegible", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Helvetica Neue", Arial, sans-serif;

  --max-width: 900px;
  --rule: 3px;        /* major lines on the CV page */
  --rule-thin: 2px;   /* lines between entries */
}

/* Follows the visitor's light/dark setting; add data-theme="light" or "dark" on <html> to force one. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="dark"]) { --bg: #000; --ink: #fff; --soft: #a6a6a6; --hair: #fff; }
}
:root[data-theme="light"] { --bg: #000; --ink: #fff; --soft: #a6a6a6; --hair: #fff; }

/* ---------- Base ---------- */

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink-blue);
  #color: var(--ink-p);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; }

#p {
  color: --ink-p;
}

p, ul, figure { margin: 0; }
ul { padding: 0; }
hr { border: 0; margin: 0; }

a { color: var(--ink); }

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

svg { fill: none; stroke: currentColor; stroke-width: 2; }

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

/* ============================================================
   FRONT PAGE  (index.html)
   ============================================================ */

main {
  min-height: 100vh;
  max-width: 980px;
  margin: 0 auto;
  padding: 8vh 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

main h1 {
  font-size: clamp(2.8rem, 10vw, 6rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

main > p { margin-top: 22px; font-size: 1.15rem; color: var(--soft); }

main > hr { width: 48px; height: var(--rule); background: var(--hair); margin: 40px 0; }

/* Square, clickable entry to the CV */
main > a {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 200px;
  height: 200px;
  padding: 18px 20px;
  color: var(--ink);
  text-decoration: none;
  border: var(--rule) solid var(--hair);
  transition: background 0.15s ease, color 0.15s ease;
}

main > a:hover { background: var(--ink); color: var(--bg); }

main > a span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 4.2rem;
  line-height: 0.9;
  letter-spacing: -0.02em;
}

main > a svg { width: 34px; height: 34px; align-self: flex-end; stroke-width: 1.6; stroke-linecap: square; }

main small { display: block; margin-top: 48px; max-width: 380px; font-size: 0.85rem; color: var(--soft); }

/* ============================================================
   CV PAGE  (cv.html)
   ============================================================ */

/* ---------- Top buttons: Back to home + Print (same size, side by side) ---------- */

body > nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 24px 0;
  display: flex;
  justify-content: flex-start;
  gap: 12px;
}

body > nav > a,
body > nav > button {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 164px;
  max-width: calc(50% - 6px);
  height: 42px;
  padding: 0 14px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--hair);
  transition: background 0.15s ease, color 0.15s ease;
}

body > nav > a:hover,
body > nav > button { background: var(--ink); color: var(--bg); }

body > nav > button:hover { background: transparent; color: var(--ink); }

/* ---------- The CV sheet ---------- */

article {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* Hero: photo + name */
article > header {
  display: flex;
  align-items: flex-end;
  gap: 36px;
  padding: 56px 0 40px;
  border-bottom: var(--rule) solid var(--hair);
}

article > header figure {
  flex: none;
  width: 128px;
  height: 164px;
  border: var(--rule-thin) solid var(--hair);
  overflow: hidden;
  font-size: 0.8rem;
  color: var(--soft);
}

article > header figure img { width: 100%; height: 100%; object-fit: cover; }

article > header > div { flex: 1; min-width: 0; }

article > header h1 {
  font-size: clamp(2.3rem, 7vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

article > header p:first-of-type { margin-top: 10px; font-size: 1.1rem; font-weight: 700; }

article > header p:last-of-type { margin-top: 16px; max-width: 58ch; color: var(--soft); }

/* Two columns */
article > div {
  display: grid;
  grid-template-columns: 1fr 2fr;
  padding-top: 40px;
  align-items: start;
}

/* ---------- Left column ---------- */

article > div > aside { padding-right: 36px; }

/* Contact icons: one row, icons only */
aside nav { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }

aside nav > * {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
  border: var(--rule-thin) solid var(--hair);
  border-radius: 50%;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

aside nav > a:hover { background: var(--ink); color: var(--bg); }

aside nav svg { width: 20px; height: 20px; }

aside h3 { font-size: 1.15rem; line-height: 1.3; margin-bottom: 6px; }

aside p { margin-bottom: 28px; color: var(--soft); font-size: 1rem; }

/* ---------- Right column ---------- */

article > div > div { padding-left: 36px; border-left: var(--rule) solid var(--hair); }

section { margin-bottom: 44px; }
section:last-child { margin-bottom: 0; }

section h2 { font-size: 1.6rem; line-height: 1.2; margin-bottom: 18px; }

/* One job / qualification: title left, dates right, bullet points below */
section > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  align-items: baseline;
  padding: 16px 0;
  border-top: var(--rule-thin) solid var(--hair);
}

section > div:last-of-type { border-bottom: var(--rule-thin) solid var(--hair); }

section > div strong { font-weight: 700; }

section > div small { font-size: 0.9rem; color: var(--soft); white-space: nowrap; }

section > div ul { grid-column: 1 / -1; margin: 6px 0 0 18px; color: var(--soft); }

section > div li { margin-bottom: 3px; }

/* Skills */
section > ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }

section > ul > li {
  padding: 4px 14px;
  font-size: 0.9rem;
  border: var(--rule-thin) solid var(--hair);
  border-radius: 999px;
}

/* ---------- Footer: name left, date right ---------- */

article > footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin-top: 56px;
  padding-top: 16px;
  border-top: var(--rule) solid var(--hair);
  color: var(--soft);
  font-size: 0.85rem;
}

/* ============================================================
   Small screens, motion, print
   ============================================================ */

@media (max-width: 700px) {
  article > header { flex-direction: column; align-items: flex-start; padding-top: 40px; }
  article > div { grid-template-columns: 1fr; }
  article > div > aside { padding-right: 0; padding-bottom: 12px; }
  article > div > div { padding-left: 0; border-left: 0; border-top: var(--rule) solid var(--hair); padding-top: 32px; }
}

@media (max-width: 560px) {
  body > nav { padding: 16px 16px 0; }
  article { padding: 0 16px 48px; }
  section > div { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  main > a, body > nav > a, body > nav > button, aside nav > * { transition: none; }
}

/* Print: always black on white */
@media print {
  :root:not([data-theme="light"]), :root[data-theme="dark"], :root {
    --bg: #fff; --ink: #000; --soft: #333; --hair: #000;
  }
  body > nav, main small { display: none !important; }
  article { max-width: 100%; padding: 0; }
  article > header { padding-top: 0; }
  section > div { break-inside: avoid; }
  a { text-decoration: none; }
}
