/* Oktay Karakiya — CV
   One typeface, one grid, no colour but the portrait. */

@font-face {
  font-family: "Host Grotesk";
  src: url("assets/fonts/HostGrotesk.var.woff2") format("woff2") tech("variations"),
       url("assets/fonts/HostGrotesk.var.woff2") format("woff2-variations"),
       url("assets/fonts/HostGrotesk.var.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Host Grotesk Fallback";
  src: local("Arial"), local("Liberation Sans"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 105.48%;
  ascent-override: 96.22%;
  descent-override: 29.86%;
  line-gap-override: 0%;
}

:root {
  --paper: #ffffff;
  --ink: #1a1a1a;
  --ink-2: #616161;
  --ink-3: #767676;
  --rule: #e4e4e4;
  --fill: #f1f1f1;

  --font: "Host Grotesk", "Host Grotesk Fallback", ui-sans-serif, system-ui, -apple-system,
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --rail: 9.5rem;      /* label column */
  --gap: 2rem;         /* between rail and content */
  --measure: 46rem;    /* page width */

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000000;
    --ink: #ededed;
    --ink-2: #a0a0a0;
    --ink-3: #7f7f7f;
    --rule: #2a2a2a;
    --fill: #1a1a1a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #000000;
  --ink: #ededed;
  --ink-2: #a0a0a0;
  --ink-3: #7f7f7f;
  --rule: #2a2a2a;
  --fill: #1a1a1a;
  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--ink); color: var(--paper); }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--ink-3);
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-color: currentColor; }

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

@media (prefers-reduced-motion: no-preference) {
  a { transition: text-decoration-color 150ms ease; }
}

/* ---------- grid ---------- */

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3rem, 12vh, 7rem) 1.5rem 0;
}

.row {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  column-gap: var(--gap);
  align-items: start;
}

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

.photo {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 22%;
  object-fit: cover;
  background: var(--fill);
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 2rem + 3vw, 3.5rem);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lede {
  margin: 0.75rem 0 0;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--ink-2);
  text-wrap: pretty;
}

.header:has(> .back) { align-items: baseline; }
.back { margin: 0; }

/* ---------- facts ---------- */

.facts {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 0.375rem var(--gap);
  margin: 2.5rem 0 0;
}
.facts > div { display: contents; }
.facts dt { color: var(--ink-2); overflow-wrap: break-word; }
.facts.legal { row-gap: 0.75rem; }

address { font-style: normal; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- sections ---------- */

section.row { margin-top: 4.5rem; }

h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 500;
  position: sticky;
  top: 1.5rem;
  align-self: start;
}

h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 600;
}
.org { font-weight: 400; color: var(--ink-2); }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

article + article { margin-top: 2.25rem; }

article ul {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
}
article li { padding-left: 0.15rem; }
article li + li { margin-top: 0.375rem; }
article li::marker { color: var(--ink-3); }

/* ---------- languages ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 0 -3px;   /* absorbs the outer border-spacing so the cells align with the column edge */
}

.cefr {
  width: 100%;
  min-width: 26rem;
  margin: 0;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
  font-size: 0.875rem;
  line-height: 1.3;
}
.cefr th, .cefr td { padding: 0; font-weight: 400; }

.cefr thead th {
  color: var(--ink-3);
  font-size: 0.75rem;
  text-align: center;
  vertical-align: bottom;
  padding-bottom: 0.375rem;
}
.cefr thead tr:first-child th {
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 500;
  vertical-align: top;
  padding-bottom: 0.125rem;
}

.cefr tbody th {
  width: 5.5rem;
  text-align: left;
  font-weight: 500;
  color: var(--ink);
}

.cefr tbody td {
  height: 2.25rem;
  text-align: center;
  border-radius: 0.25rem;
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--ink-3);
}
.cefr tbody td[data-level^="B"] { color: var(--ink-2); }
.cefr tbody td[data-level^="C"] {
  background: var(--fill);
  box-shadow: none;
  color: var(--ink);
  font-weight: 500;
}

.note {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-3);
}

/* ---------- footer ---------- */

footer.row {
  max-width: var(--measure);
  margin: 5rem auto 0;
  padding: 0 1.5rem 3rem;
}
.colophon {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
footer p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- small screens ---------- */

@media (max-width: 40rem) {
  body { font-size: 0.9375rem; }
  .page { padding-top: 3rem; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .photo { width: 4.5rem; height: 4.5rem; margin-bottom: 1.5rem; }
  .facts { grid-template-columns: 6rem minmax(0, 1fr); column-gap: 1rem; }
  section.row { margin-top: 3.5rem; }
  h2 { position: static; margin-bottom: 1rem; }
  .table-wrap { margin: 0 -1.5rem; padding: 0 calc(1.5rem - 3px); }
  .cefr { min-width: 0; table-layout: auto; }
  .cefr thead th { font-size: 0.6875rem; }
  .cefr tbody th { width: auto; padding-right: 0.5rem; }
  .back { margin-bottom: 1rem; }
  .facts.legal { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .facts.legal > div + div > dt { margin-top: 0.75rem; }
  .colophon { grid-column: 1; }
}

/* ---------- print ---------- */

@media print {
  :root {
    --paper: #fff; --ink: #000; --ink-2: #444; --ink-3: #666; --rule: #bbb; --fill: #eee;
  }
  @page { size: A4; margin: 14mm 16mm; }
  body { font-size: 10pt; line-height: 1.45; }
  .page, footer.row { max-width: none; padding: 0; }
  .photo { width: 20mm; height: 20mm; }
  h1 { font-size: 2.25rem; }
  .lede { font-size: 1.1rem; margin-top: 0.5rem; }
  .facts { margin-top: 1.5rem; gap: 0.2rem var(--gap); }
  .facts > .no-print, .colophon > .no-print { display: none; }
  section.row { margin-top: 2rem; }
  h2 { position: static; }
  article + article { margin-top: 1.25rem; }
  article ul { margin-top: 0.4rem; }
  article li + li { margin-top: 0.2rem; }
  a { text-decoration: none; }
  .table-wrap { overflow: visible; }
  .cefr { min-width: 0; }
  .cefr tbody td {
    height: 1.625rem;
    box-shadow: none;
    border: 1px solid var(--rule);
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .cefr tbody td[data-level^="C"] { border-color: var(--fill); }
  article, .cefr { break-inside: avoid; }
  footer.row { margin-top: 1rem; }
}
