/* ============================================================
   matthiaspoetsch.at — styles
   Single centered column, hierarchy through color.
   ============================================================ */

/* ---------- Fonts: self-hosted Inter (variable, weights 100–900) ---------- */
/* Served locally — no third-party request, no IP leak, works offline. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Color — light (default) */
  --color-bg: #fcfcfc;
  --color-heading: #212121;
  --color-body: #636363;
  --color-card-hover: rgba(0, 0, 0, 0.045);

  /* Typography */
  --font: 'Inter', -apple-system, system-ui, sans-serif;
  --size-heading: 20px;   /* weight 500 */
  --size-body: 16px;      /* weight 400 */
  --size-meta: 12px;      /* small all-caps meta labels (work credit lines) */

  /* Layout */
  --column-width: 640px;
  --column-padding: 24px;
  --line-height: 1.6;
}

/* Dark mode — automatic via OS setting, unless the user forced light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #111111;
    --color-heading: #ededed;
    --color-body: #9a9a9a;
    --color-card-hover: rgba(255, 255, 255, 0.06);
  }
}

/* Manual override via the footer toggle (persisted in localStorage). */
:root[data-theme="dark"] {
  --color-bg: #111111;
  --color-heading: #ededed;
  --color-body: #9a9a9a;
  --color-card-hover: rgba(255, 255, 255, 0.06);
}

/* ---------- Reset ---------- */

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

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

body {
  background-color: var(--color-bg);
  color: var(--color-body);
  font-family: var(--font);
  font-size: var(--size-body);
  font-weight: 400;
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* On-brand selection; drop the grey tap flash since we own the press states. */
::selection {
  background: var(--color-heading);
  color: var(--color-bg);
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Shared interactive surface ---------- */

/* A quiet rounded background that appears on hover, with press feedback and a
   keyboard focus ring. Used by project cards AND footer items so every
   clickable element behaves identically — one affordance, no underlines. */
.hover-card {
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
  transition: background-color 0.2s ease, transform 0.16s ease-out;
}

/* Gate hover motion to real pointers — touch taps fire false hovers. */
@media (hover: hover) and (pointer: fine) {
  .hover-card:hover {
    background-color: var(--color-card-hover);
  }
}

/* Subtle press feedback — confirms the tap/click was heard. */
.hover-card:active {
  transform: scale(0.98);
}

.hover-card:focus-visible {
  outline: 2px solid var(--color-heading);
  outline-offset: 3px;
}

/* Reduced motion: keep focus/hover affordances, drop the press movement. */
@media (prefers-reduced-motion: reduce) {
  .hover-card:active {
    transform: none;
  }
}

/* ---------- Layout: single centered column ---------- */

.column {
  max-width: var(--column-width);
  margin: 0 auto;
  padding: 0 var(--column-padding);
}

/* ---------- Header ---------- */

.site-header {
  padding-top: 120px;
}

.site-name {
  color: var(--color-heading);
  font-size: var(--size-heading);
  font-weight: 500;
  line-height: 1.3;
}

.site-role {
  color: var(--color-body);
  font-size: var(--size-body);
  font-weight: 400;
}

/* ---------- About — short bio ---------- */

.about {
  margin-top: 48px;
}

.about p {
  color: var(--color-body);
  max-width: 36em;
  text-wrap: pretty;
}

/* ---------- Work — Today + Before ---------- */

.work {
  margin-top: 72px;
}

/* Section eyebrow — shares the small all-caps meta style with work credits,
   giving the page one consistent label language. */
.section-label {
  color: var(--color-body);
  font-size: var(--size-meta);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* A second group label within a section needs breathing room above. */
.work-list + .section-label,
.cv-list + .section-label {
  margin-top: 56px;
}

.work-list {
  list-style: none;
}

.work-item + .work-item {
  margin-top: 36px;
}

.work-title {
  color: var(--color-heading);
  font-size: var(--size-body);
  font-weight: 500;
}

/* Card layout: padding bleeds out via negative margin so text keeps its
   position and rhythm. Interactive behaviour comes from .hover-card. */
.work-card {
  display: block;
  padding: 16px 20px;
  margin: -16px -20px;
  border-radius: 12px;
}

/* Year now trails the credit line; keep its range from wrapping. */
.work-year {
  white-space: nowrap;
}

.work-credit {
  color: var(--color-body);
  margin-top: 6px;
  font-size: var(--size-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.work-desc {
  color: var(--color-body);
  margin-top: 8px;
  max-width: 36em;
  text-wrap: pretty;
}

/* ---------- CV — Experience + Education ---------- */

.cv {
  margin-top: 72px;
}

.cv-list {
  list-style: none;
}

.cv-item {
  display: flex;
  gap: 16px;
}

.cv-item + .cv-item {
  margin-top: 10px;
}

/* Muted year in a fixed-width left column; rows align across the list. */
.cv-year {
  color: var(--color-body);
  flex-shrink: 0;
  width: 96px;
}

.cv-detail {
  color: var(--color-heading);
}

/* Experience rows: company stands out, role/extra stays muted. */
.cv-company {
  color: var(--color-heading);
}

.cv-role {
  color: var(--color-body);
}

/* ---------- Contact / Footer ---------- */

.site-footer {
  margin-top: 72px;
  padding-bottom: 120px;
}

.contact-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 24px;
}

/* Mail + LinkedIn stay left; the theme toggle is pushed to the right. */
.contact-toggle {
  margin-left: auto;
}

/* Footer items use the shared .hover-card surface with tighter padding.
   The negative margin bleeds the hover background out so the labels keep
   their position — "Mail" stays flush with the column edge. */
.contact-list .hover-card {
  padding: 6px 10px;
  margin: -6px -10px;
}

/* Reset the toggle button so it reads like the text links beside it. */
.theme-toggle {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
