/* Master Algebra — business-card site. Plain CSS, no build step. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1f24;
  --muted: #5b6270;
  --line: #e3e1da;
  --accent: #1f4e8c;
  --accent-ink: #ffffff;
  --accent-soft: #e8eef7;
  --radius: 10px;
  --wrap: 1040px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --surface: #1a1d22;
    --text: #e7e8ea;
    --muted: #a0a6b1;
    --line: #2c3038;
    --accent: #7fa8e0;
    --accent-ink: #0f1a2a;
    --accent-soft: #1d2735;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 10; }

/* Header and menu */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand span { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; letter-spacing: .01em; }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: .95rem; }
.nav > a, .nav summary {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.nav > a:hover, .nav summary:hover { background: var(--accent-soft); }
.nav details { position: relative; }
.nav summary { list-style: none; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: " ▾"; font-size: .8em; color: var(--muted); }
.nav details[open] summary { background: var(--accent-soft); }
.nav .menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 200px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / .12);
  z-index: 5;
}
.nav .menu a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.nav .menu a:hover { background: var(--accent-soft); }
.nav .menu small { display: block; color: var(--muted); font-size: .8rem; }
.lang { color: var(--muted) !important; }

/* Hero */
.hero { padding: 64px 0 48px; }
.hero h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.15;
  font-weight: 600;
}
.hero h1 .sub { display: block; color: var(--muted); font-size: .55em; font-weight: 400; margin-top: 10px; }
.hero p { max-width: 640px; margin: 0 0 24px; color: var(--muted); font-size: 1.08rem; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { color: var(--accent); }

/* Sections */
section { padding: 40px 0; border-top: 1px solid var(--line); }
h2 { margin: 0 0 20px; font-family: var(--serif); font-size: 1.6rem; font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.card p { margin: 0 0 16px; color: var(--muted); flex: 1; }
.card a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.card a:hover { text-decoration: underline; }

.list { margin: 0; padding-left: 1.2em; }
.list li { margin-bottom: 6px; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 520px) {
  .details { grid-template-columns: 1fr; gap: 2px; }
  .details dd { margin-bottom: 10px; }
  .hero { padding: 40px 0 32px; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 32px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 14px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
