/* dykyi.net: one variable family (Archivo). Width carries the personality:
   extra-wide heavy for display, normal width for reading. Hi-vis orange is
   reserved for the signal line in the layer stack and link underlines. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --paper: #eceff1;
  --ink: #18222b;
  --steel: #4f5b66;
  --rule: #c6cdd3;
  --signal: #e85d04;
  --btn-ink: #eceff1;
  --measure: 62ch;
  --gutter: clamp(16px, 5vw, 48px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a2128;
    --ink: #e3e8ec;
    --steel: #9aa6b1;
    --rule: #34414c;
    --signal: #ff7b2e;
    --btn-ink: #1a2128;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #1a2128;
  --ink: #e3e8ec;
  --steel: #9aa6b1;
  --rule: #34414c;
  --signal: #ff7b2e;
  --btn-ink: #1a2128;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
}

a { color: inherit; }

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

.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 8px;
  top: -48px;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  z-index: 10;
}
.skip:focus { top: 8px; }

/* Top bar */

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-block: 20px;
}

.theme-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.theme-btn:hover { border-color: var(--ink); }

/* Hero */

.hero { padding-block: clamp(48px, 10vw, 120px) clamp(48px, 8vw, 96px); }

h1 {
  margin: 0;
  font-size: clamp(2.75rem, 10vw, 6.875rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.92;
  letter-spacing: -0.01em;
}

.role {
  margin: 0.9rem 0 0;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 600;
  font-stretch: 112%;
}

.lede {
  max-width: var(--measure);
  margin: 1.25rem 0 0;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--steel);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  font-weight: 650;
  text-decoration: none;
}
.btn-solid { background: var(--ink); color: var(--btn-ink); }
.btn-solid:hover { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--btn-ink); }

.text-link,
.contact-mail a {
  text-decoration-color: var(--signal);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}
.text-link:hover, .contact-mail a:hover { text-decoration-thickness: 3px; }

/* Too narrow for one row: LinkedIn and GitHub share their own row
   instead of GitHub wrapping alone. */
@media (max-width: 40em) {
  .actions::before { content: ""; flex-basis: 100%; order: 1; }
  .text-link { order: 2; }
}

/* Sections */

/* Divider drawn inside the gutters so it lines up with the text edge. */
.section {
  padding-block: clamp(40px, 7vw, 80px);
  background: linear-gradient(var(--rule), var(--rule)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}

h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  font-weight: 750;
  font-stretch: 118%;
  line-height: 1.1;
  text-wrap: balance;
}

.section-lede {
  max-width: var(--measure);
  margin: 0.75rem 0 0;
  color: var(--steel);
}

/* Layer stack: the one bold element. A signal line runs through every layer;
   on load a pulse travels once from the vehicle up to the screen. */

.stack {
  --rail: 22px;
  position: relative;
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0 0 0 calc(var(--rail) + 28px);
}

.stack::before {
  content: "";
  position: absolute;
  left: calc(var(--rail) / 2 - 1.5px);
  top: 18px;
  bottom: 18px;
  width: 3px;
  /* a border, not a background: it survives forced colors and printing */
  border-left: 3px solid var(--signal);
}

.stack::after {
  content: "";
  position: absolute;
  left: calc(var(--rail) / 2 - 6px);
  bottom: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--signal) 25%, transparent);
  opacity: 0;
}

/* main.js adds .is-live when the stack scrolls into view, so the pulse runs
   where the visitor can see it rather than below the fold on load. */
@media (prefers-reduced-motion: no-preference) {
  .stack.is-live::after {
    animation: pulse-up 1.8s cubic-bezier(.45, 0, .2, 1) 0.2s 1 both;
  }
}

@keyframes pulse-up {
  0% { bottom: 12px; opacity: 0; }
  10% { opacity: 1; }
  85% { opacity: 1; }
  100% { bottom: calc(100% - 24px); opacity: 0; }
}

.stack li {
  position: relative;
  display: grid;
  /* text column lands 14rem + 32px from the edge, same as .job and .skills */
  grid-template-columns: calc(14rem - var(--rail) - 28px) 1fr;
  gap: 4px 32px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.stack li:first-child { border-top: 1px solid var(--rule); }

/* Ring node anchored to the layer name itself: 0.55em is the middle of its
   1.1 line box, so it tracks the name's cap height at every font size. */
.layer::before {
  content: "";
  position: absolute;
  left: calc(-28px - var(--rail) / 2 - 7px);
  top: calc(0.55em - 7px);
  width: 14px;
  height: 14px;
  border: 3px solid var(--signal);
  border-radius: 50%;
  background: var(--paper);
}

.layer {
  position: relative;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1.1;
}

.stack p {
  max-width: var(--measure);
  margin: 0;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 16px 48px;
  margin-top: 2.5rem;
}
.results p { max-width: var(--measure); margin: 0; }
.results strong { font-weight: 700; }

/* Experience */

.job {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 4px 32px;
  padding-top: 2.25rem;
}
.job + .job { margin-top: 0.5rem; }

.when {
  margin: 0;
  padding-top: 4px;
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}

h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  font-stretch: 108%;
  line-height: 1.25;
  text-wrap: balance;
}

.where {
  margin: 2px 0 0;
  color: var(--steel);
}

.job ul {
  max-width: var(--measure);
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
}
.job li { margin: 0.35rem 0; }
.job li::marker { color: var(--signal); }

.tools {
  max-width: var(--measure);
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  color: var(--steel);
}

/* Skills, education */

.skills { margin: 2rem 0 0; }
.skills div {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 4px 32px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.skills div:first-child { border-top: 1px solid var(--rule); }
.skills dt { font-weight: 700; }
.skills dd { margin: 0; max-width: var(--measure); }

/* Contact */

.contact-mail {
  margin: 1.5rem 0 0;
  /* the 5.6vw cap keeps the address on one line down to 280px */
  font-size: min(clamp(1.25rem, 4vw, 2.25rem), 5.6vw);
  font-weight: 700;
  font-stretch: 112%;
  overflow-wrap: anywhere;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 28px 40px;
  background: linear-gradient(var(--rule), var(--rule)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat;
  color: var(--steel);
  font-size: 0.9375rem;
}
.footer p { margin: 0; }

/* Narrow screens: label above content */

@media (max-width: 720px) {
  .stack li,
  .job,
  .skills div { grid-template-columns: 1fr; }
  .stack { --rail: 16px; padding-left: calc(var(--rail) + 20px); }
  .layer::before { left: calc(-20px - var(--rail) / 2 - 7px); }
  .job { padding-top: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .stack::after { animation: none; opacity: 0; }
}

@media print {
  .topbar, .skip, .stack::after { display: none; }
  /* Always print the light palette: from dark mode, browsers only grey out
     the light text (about 3:1 on paper). :root:root outranks the theme rules. */
  :root:root {
    --paper: #fff;
    --ink: #18222b;
    --steel: #4f5b66;
    --rule: #c6cdd3;
    --signal: #e85d04;
    --btn-ink: #fff;
    color-scheme: light;
  }
  .btn-solid { background: none; color: var(--ink); }
}
