/* ==========================================================================
   CallRec Desk — callrec.ttdk.eu
   Plain CSS, system fonts only, no external resources.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Theme tokens
   Light is the base. Dark is applied either by the system preference
   (unless the visitor explicitly picked light) or by data-theme="dark".
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  --bg:            #ffffff;
  --bg-alt:        #f3f6fb;
  --surface:       #ffffff;
  --surface-2:     #eef2f9;
  --border:        #dde3ee;
  --border-strong: #c7d0e0;

  --text:          #11161f;
  --text-muted:    #55607a;

  --accent:        #1551c9;
  --accent-hover:  #0f3fa3;
  --accent-soft:   #e7eeff;
  --on-accent:     #ffffff;
  --rec:           #d32f2f;

  --shadow-sm: 0 1px 2px rgba(17, 22, 31, .06), 0 2px 8px rgba(17, 22, 31, .05);
  --shadow-md: 0 2px 6px rgba(17, 22, 31, .07), 0 12px 32px rgba(17, 22, 31, .09);

  --radius:    14px;
  --radius-sm: 9px;
  --wrap:      1140px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
          "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0d1117;
    --bg-alt:        #121a24;
    --surface:       #161f2b;
    --surface-2:     #1d2735;
    --border:        #27323f;
    --border-strong: #3a4756;

    --text:          #e9eef7;
    --text-muted:    #9fabbe;

    --accent:        #6aa5ff;
    --accent-hover:  #8ebcff;
    --accent-soft:   #16263f;
    --on-accent:     #0b1018;
    --rec:           #ff6b5e;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .4), 0 14px 36px rgba(0, 0, 0, .45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #0d1117;
  --bg-alt:        #121a24;
  --surface:       #161f2b;
  --surface-2:     #1d2735;
  --border:        #27323f;
  --border-strong: #3a4756;

  --text:          #e9eef7;
  --text-muted:    #9fabbe;

  --accent:        #6aa5ff;
  --accent-hover:  #8ebcff;
  --accent-soft:   #16263f;
  --on-accent:     #0b1018;
  --rec:           #ff6b5e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .4), 0 14px 36px rgba(0, 0, 0, .45);
}

:root[data-theme="light"] { color-scheme: light; }

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; }
img { height: auto; }

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 .6em;
  letter-spacing: -.015em;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.05rem); }
h3 { font-size: 1.16rem; }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin: .3em 0; }

a { color: var(--accent); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }

code {
  font-family: var(--mono);
  font-size: .87em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .1em .36em;
  overflow-wrap: anywhere;
}

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

.wrap {
  width: min(100% - 2.2rem, var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: .7rem 1.1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  color: var(--on-accent);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .78rem 1.5rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 1.02rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn-sm { padding: .55rem 1.1rem; font-size: .95rem; }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-primary:active { transform: translateY(1px); }

.btn-version { font-weight: 500; opacity: .85; }

.btn-link {
  display: inline-block;
  font-weight: 600;
  padding: .78rem .35rem;
  color: var(--accent);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg); /* fallback for browsers without color-mix() */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--bg); }
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.04rem;
  color: var(--text);
  text-decoration: none;
  flex: none;
}
.brand img { width: 30px; height: 30px; border-radius: 7px; }

.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: .45rem .7rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .95rem;
  font-weight: 550;
  text-decoration: none;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }

.theme-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-left: auto;
  padding: .45rem .8rem;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
}
.site-nav + .theme-toggle { margin-left: .5rem; }
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { flex: none; }

/* Show the icon for the theme you would switch to. */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle[aria-pressed="true"] .icon-sun  { display: block; }
.theme-toggle[aria-pressed="true"] .icon-moon { display: none; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section { padding: clamp(3rem, 2rem + 4vw, 5.5rem) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section > .wrap > h2 { max-width: 22ch; }

.section-lede {
  max-width: 62ch;
  color: var(--text-muted);
  font-size: 1.07rem;
  margin-bottom: 2.4rem;
}

.aside {
  color: var(--text-muted);
  max-width: 66ch;
  margin-top: 1.8rem;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: clamp(2.5rem, 1.5rem + 5vw, 5rem) 0 clamp(3rem, 2rem + 4vw, 5rem);
  background:
    radial-gradient(60rem 30rem at 15% -10%, var(--accent-soft), transparent 70%);
}

.hero-inner {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
}

.hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.3rem;
}

.hero h1 { margin-bottom: .5em; }

.lede {
  font-size: 1.13rem;
  color: var(--text-muted);
  max-width: 54ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1rem;
  margin: 1.8rem 0 1rem;
}

.hero-note {
  color: var(--text-muted);
  font-size: .93rem;
  margin: 0;
}

.hero-media { justify-self: center; }
.hero-media img {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: block;
}

/* --------------------------------------------------------------------------
   How it works — the flow diagram
   -------------------------------------------------------------------------- */

.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: .6rem;
}

.flow-step {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.flow-step h3 { margin-bottom: .35em; font-size: 1.04rem; }
.flow-step p {
  margin: 0;
  font-size: .93rem;
  color: var(--text-muted);
}

.flow-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: .8rem;
}

.flow-link {
  margin: 0;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.flow-link::after {
  content: "";
  display: block;
  width: 2.2rem;
  height: 10px;
  background: currentColor;
  opacity: .55;
  clip-path: polygon(0 40%, 70% 40%, 70% 0, 100% 50%, 70% 100%, 70% 60%, 0 60%);
}

.demo {
  margin: 3rem auto 0;
  max-width: 520px;
  text-align: center;
}
.demo img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: block;
}
.demo figcaption {
  margin-top: .9rem;
  font-size: .9rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Features
   -------------------------------------------------------------------------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.8rem, 1rem + 3vw, 3.5rem);
  align-items: center;
  padding: clamp(2rem, 1.2rem + 2.5vw, 3.4rem) 0;
  border-top: 1px solid var(--border);
}
.feature:first-of-type { border-top: 0; padding-top: .5rem; }

.feature-reverse .feature-text { order: 2; }
.feature-reverse .feature-media { order: 1; }

.feature-text p, .feature-text li { color: var(--text-muted); }
.feature-text strong, .feature-text em { color: var(--text); }
.feature-text h3 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.55rem); }

.feature-media img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: block;
}
.feature-media.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.6rem 1.7rem;
  margin: 1rem 0;
  box-shadow: var(--shadow-sm);
}
.panel h3 { margin-bottom: .4em; }
.panel p { margin: 0; color: var(--text-muted); max-width: 72ch; }

/* --------------------------------------------------------------------------
   Cards / steps / releases / FAQ
   -------------------------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1.3rem;
  margin-top: 2rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.2rem;
  box-shadow: var(--shadow-sm);
}
.card p { color: var(--text-muted); margin: 0; }
.card strong { color: var(--text); }

.steps {
  counter-reset: step;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}
.steps > li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 0;
  box-shadow: var(--shadow-sm);
}
.steps > li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: .9rem;
}
.steps p { color: var(--text-muted); }
.steps p:last-child { margin-bottom: 0; }
.steps strong { color: var(--text); }

.release {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.7rem;
  margin-bottom: 1.3rem;
  box-shadow: var(--shadow-sm);
}
.release h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem .8rem;
  margin-bottom: .9em;
}
.release ul { margin: 0; }
.release li { color: var(--text-muted); }
.release strong { color: var(--text); }

.tag {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  padding: .12em .8em;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.tag-muted { background: var(--surface-2); color: var(--text-muted); }

.release-date {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.faq {
  margin-top: 2rem;
  display: grid;
  gap: .7rem;
  max-width: 820px;
}
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer;
  padding: 1rem 1.2rem;
  font-weight: 650;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .8rem;
  border-radius: var(--radius-sm);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "";
  flex: none;
  width: .62rem;
  height: .62rem;
  border-right: 2.2px solid var(--accent);
  border-bottom: 2.2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform .18s ease;
}
.faq details[open] summary::before { transform: rotate(45deg); }
.faq summary:hover { background: var(--surface-2); }
.faq p {
  margin: 0;
  padding: 0 1.2rem 1.2rem;
  color: var(--text-muted);
}
.faq strong, .faq em { color: var(--text); }

.section-cta { background: var(--bg-alt); border-top: 1px solid var(--border); }
.cta { text-align: center; }
.cta h2 { margin-bottom: .3em; max-width: none; }
.cta > p:first-of-type { color: var(--text-muted); font-size: 1.08rem; }
.cta .btn { margin-top: .6rem; }

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

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.footer-brand { display: flex; gap: .9rem; align-items: flex-start; }
.footer-brand img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.footer-name { font-weight: 700; margin: 0 0 .15em; }
.footer-tag { color: var(--text-muted); margin: 0; font-size: .95rem; max-width: 34ch; }

.footer-nav h2 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .9em;
}
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin: .45em 0; }
.footer-nav a { text-decoration: none; font-weight: 550; }
.footer-nav a:hover { text-decoration: underline; }

.footer-bottom {
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .88rem;
}
.footer-bottom p { margin: 0 0 .4em; max-width: 80ch; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .site-nav { display: none; }
  .site-nav + .theme-toggle { margin-left: auto; }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-media img { max-width: 310px; }

  .feature { grid-template-columns: 1fr; }
  .feature-reverse .feature-text,
  .feature-reverse .feature-media { order: initial; }
  .feature-media { max-width: 560px; }

  .flow {
    grid-template-columns: 1fr;
    gap: .35rem;
    max-width: 480px;
  }
  .flow-link { flex-direction: row; gap: .6rem; padding: .15rem 0; }
  .flow-link::after {
    width: 10px;
    height: 1.6rem;
    clip-path: polygon(40% 0, 40% 70%, 0 70%, 50% 100%, 100% 70%, 60% 70%, 60% 0);
  }

  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { width: min(100% - 1.6rem, var(--wrap)); }

  .theme-toggle-label { display: none; }
  .theme-toggle { padding: .45rem .55rem; }

  .brand span { font-size: .98rem; }

  .hero-actions { gap: .2rem .8rem; }
  .btn { width: 100%; }
  .btn-link { width: 100%; text-align: center; }

  .feature-media.pair { grid-template-columns: 1fr; gap: 1.2rem; max-width: 330px; }

  .panel { padding: 1.3rem 1.2rem; border-left-width: 3px; }
  .release { padding: 1.3rem 1.2rem; }
  .steps > li, .card { padding: 1.25rem; }

  .footer-inner { grid-template-columns: 1fr; gap: 1.6rem; }
}
