:root {
  --ink: #18201d;
  --muted-ink: #5b6761;
  --paper: #fbfaf6;
  --soft: #ece8de;
  --line: #d7d0c2;
  --accent: #2f6b5f;
  --accent-strong: #214c43;
  --sun: #d6a84d;
  --white: #ffffff;
  --shadow: 0 18px 45px rgb(24 32 29 / 12%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgb(215 208 194 / 70%);
  background: rgb(251 250 246 / 90%);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  background: var(--accent);
  font-weight: 800;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted-ink);
  font-size: 0.95rem;
}

.main-nav a {
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--ink);
  background: var(--soft);
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(100svh - 64px);
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-media,
.image-band {
  position: relative;
  overflow: hidden;
  background: #315f46;
}

.hero-media::before,
.hero-media::after,
.image-band::before,
.image-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.hero-media::before,
.image-band::before {
  right: auto;
  width: 62%;
  background-image:
    linear-gradient(90deg, rgb(74 142 88 / 54%), rgb(88 154 96 / 30%)),
    url("chalkboard-formulas.png");
  background-position: center;
  mask-image: linear-gradient(96deg, #000 0 66%, rgb(0 0 0 / 62%) 78%, transparent 100%);
  -webkit-mask-image: linear-gradient(96deg, #000 0 66%, rgb(0 0 0 / 62%) 78%, transparent 100%);
}

.hero-media::after,
.image-band::after {
  left: auto;
  width: 62%;
  background-image:
    linear-gradient(90deg, rgb(15 28 32 / 12%), rgb(15 28 32 / 34%)),
    url("modern-it-network.png");
  background-position: center;
  mask-image: linear-gradient(96deg, transparent 0, rgb(0 0 0 / 62%) 22%, #000 34% 100%);
  -webkit-mask-image: linear-gradient(96deg, transparent 0, rgb(0 0 0 / 62%) 22%, #000 34% 100%);
}

.hero-media {
  position: absolute;
  inset: 0;
  transform: scale(1.02);
}

.platform-logos {
  position: absolute;
  right: clamp(18px, 7vw, 92px);
  bottom: clamp(24px, 5vh, 54px);
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  max-width: min(420px, 44vw);
}

.platform-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid rgb(255 255 255 / 42%);
  border-radius: 8px;
  color: #f8fbff;
  background: rgb(10 19 24 / 52%);
  box-shadow: 0 14px 34px rgb(0 0 0 / 24%);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  backdrop-filter: blur(12px);
}

.platform-logo.apple::before,
.platform-logo.linux::before {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  color: #101820;
  background: #f8fbff;
  font-size: 0.72rem;
  font-weight: 900;
}

.platform-logo.apple::before {
  content: "A";
}

.platform-logo.linux::before {
  content: "L";
}

.microsoft-mark {
  display: block;
  width: 9px;
  height: 9px;
  background: #f25022;
  box-shadow: 11px 0 #7fba00, 0 11px #00a4ef, 11px 11px #ffb900;
}

.hero-content {
  position: relative;
  width: min(760px, calc(100% - 36px));
  margin: 0 clamp(18px, 7vw, 92px) clamp(44px, 10vh, 86px);
  color: var(--white);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f0c36b;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 10ch;
  margin-bottom: 18px;
  font-size: clamp(1.5rem, 4vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(1rem, 2vw, 2.1rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-text,
.section-copy p,
.contact p {
  max-width: 680px;
  color: var(--muted-ink);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
}

.hero-text {
  color: rgb(255 255 255 / 88%);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid rgb(255 255 255 / 42%);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 750;
}

.button.primary {
  color: var(--ink);
  background: var(--white);
}

.button.secondary {
  color: var(--white);
}

.section {
  padding: clamp(64px, 10vw, 118px) clamp(18px, 7vw, 92px);
}

.intro,
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.6fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
}

.quote-panel,
.contact-box,
.topic-card,
.formula-card,
.converter,
.hp41 {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.quote-panel {
  padding: clamp(24px, 4vw, 42px);
  border-left: 6px solid var(--sun);
}

.quote-panel p {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.38;
}

.muted {
  background: var(--soft);
}

.section-heading {
  margin-bottom: 32px;
}

#themen .eyebrow {
  color: var(--sun);
  font-size: 1.56rem;
}

#themen h2 {
  font-size: clamp(0.5rem, 1vw, 1.05rem);
}

.topic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 16px;
  align-items: stretch;
}

.topic-card {
  min-height: 210px;
  padding: 24px;
  scroll-margin-top: 110px;
}

.topic-card#vorstellung {
  grid-row: span 2;
}

#themen .topic-card:not(#vorstellung) {
  min-height: 0;
  padding: 18px;
}

.topic-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: 1.22rem;
  line-height: 1.2;
}

#themen .topic-card:not(#vorstellung) strong {
  margin-bottom: 8px;
  font-size: 1rem;
}

#formelsammlung strong {
  color: #0b2f6b;
}

.topic-card p {
  margin: 0;
  color: var(--muted-ink);
  white-space: pre-line;
}

#themen .topic-card:not(#vorstellung) p {
  font-size: 0.95rem;
  line-height: 1.45;
}

.topic-links {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.topic-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
  background: #f5f7f2;
  font-weight: 750;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.topic-links a:hover {
  border-color: var(--accent);
  background: #edf6f1;
}

.section-lead {
  max-width: 760px;
  color: var(--muted-ink);
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
}

.formula-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tab-button,
.swap-button,
.mode-row button,
.keypad button {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.tab-button {
  min-height: 42px;
  padding: 8px 14px;
  color: var(--muted-ink);
  background: var(--white);
}

.tab-button.is-active {
  color: var(--white);
  border-color: var(--accent);
  background: var(--accent);
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.formula-card {
  padding: 22px;
}

.formula-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.12rem;
}

.formula-card code {
  display: block;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 8px;
  color: #10221d;
  background: #eef5f1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  white-space: normal;
}

.formula-card p {
  margin: 0;
  color: var(--muted-ink);
}

.tools {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
  background: #f3f7f4;
}

.converter {
  display: grid;
  grid-template-columns: 1fr 1fr auto 1fr;
  gap: 14px;
  align-items: end;
  padding: clamp(22px, 4vw, 34px);
}

.converter label {
  display: grid;
  gap: 6px;
  color: var(--muted-ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.converter input,
.converter select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
}

.swap-button {
  width: 46px;
  height: 46px;
  color: var(--white);
  background: var(--accent);
}

.conversion-result {
  grid-column: 1 / -1;
  min-height: 66px;
  padding: 16px;
  border-radius: 8px;
  color: var(--white);
  background: var(--accent-strong);
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 850;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.tool-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.92rem;
}

.calculator-section {
  background: #232826;
  color: var(--white);
}

.calculator-section .eyebrow {
  color: #f0c36b;
}

.calculator-section .section-lead {
  color: rgb(255 255 255 / 76%);
}

.hp41 {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 28px);
  color: #f5f1e8;
  border-color: #111614;
  background: linear-gradient(160deg, #373c39, #1b201e);
  box-shadow: 0 28px 70px rgb(0 0 0 / 28%);
}

.hp41-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: #d7d0c2;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.hp41-top strong {
  color: #f0c36b;
}

.stack-display {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #6f756f;
  border-radius: 8px;
  color: #17201b;
  background: #b9c9b2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.stack-display div {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
}

.stack-display span {
  color: #465245;
  font-weight: 800;
}

.stack-display output {
  text-align: right;
  overflow-wrap: anywhere;
}

.x-row {
  font-size: 1.45rem;
  font-weight: 850;
}

.mode-row,
.keypad {
  display: grid;
  gap: 8px;
}

.mode-row {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 8px;
}

.keypad {
  grid-template-columns: repeat(4, 1fr);
}

.mode-row button,
.keypad button {
  min-height: 44px;
  color: #f5f1e8;
  border-color: #59605c;
  background: #2a302d;
}

.keypad button[data-rpn-digit],
.keypad button[data-rpn-action="enter"] {
  background: #424a45;
}

.keypad button[data-rpn-op] {
  color: #18201d;
  background: #f0c36b;
}

.hp41 .tool-status {
  margin-top: 12px;
  color: rgb(255 255 255 / 72%);
}

.split {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1fr);
  gap: clamp(30px, 6vw, 78px);
  align-items: center;
}

.image-band {
  min-height: clamp(360px, 44vw, 560px);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.contact {
  background: var(--accent-strong);
  color: var(--white);
}

.contact .eyebrow {
  color: #f0c36b;
}

.contact h2 {
  font-size: clamp(3rem, 7vw, 5.6rem);
}

.contact p {
  color: rgb(255 255 255 / 82%);
}

.contact-box {
  display: grid;
  gap: 10px;
  padding: 28px;
  color: var(--ink);
}

.contact-box a {
  color: var(--accent-strong);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.contact-box span {
  color: var(--muted-ink);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 26px clamp(18px, 7vw, 92px);
  color: var(--muted-ink);
  background: var(--paper);
}

.site-footer a {
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    justify-content: flex-start;
  }

  h1 {
    max-width: 9ch;
  }

  .intro,
  .contact,
  .split,
  .tools {
    grid-template-columns: 1fr;
  }

  .topic-grid,
  .formula-grid {
    grid-template-columns: 1fr;
  }

  .topic-card#vorstellung {
    grid-row: auto;
  }

  .platform-logos {
    right: 18px;
    bottom: 22px;
    justify-content: flex-end;
    max-width: calc(100% - 36px);
  }

  .converter {
    grid-template-columns: 1fr;
  }

  .swap-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 620px;
  }

  .button {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
  }
}
