/* ==========================================
   THEME TOKENS (aligned with digitaler-pflegezwilling-landingpage)
   ========================================== */
:root {
  --primary: #00695c;
  --primary-rgb: 0, 105, 92;
  --primary-light: #26a69a;

  --radius-sm: 8px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  --bg: #060a09;
  --text-primary: #eef4f2;
  --text-secondary: rgba(238, 244, 242, 0.68);
  --text-muted: rgba(238, 244, 242, 0.42);
  --border: rgba(255, 255, 255, 0.10);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(0, 105, 92, 0.25), transparent 60%),
    radial-gradient(1200px 600px at 100% 110%, rgba(38, 165, 154, 0.15), transparent 60%),
    var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 40px;
}

.portal-header {
  text-align: center;
  max-width: 640px;
}

.portal-eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-light);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
}

.portal-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 14px;
}

.portal-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.5;
}

/* ==========================================
   TWIN ACCORDION
   Hover (or tap) a panel to expand it; click the expanded
   panel to go to that twin's page. Keyboard: arrow keys.
   ========================================== */
.twin-accordion {
  --ag-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ag-duration: 0.6s;
  --ag-gap: 10px;

  display: flex;
  gap: var(--ag-gap);
  width: 100%;
  max-width: 1400px;
  height: clamp(420px, 70vh, 640px);
  perspective: 1400px;
}

.ag-panel {
  position: relative;
  flex: 1 1 0%;
  flex-grow: var(--ag-grow, 1);
  min-width: 0;
  overflow: hidden;
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transform: rotateY(var(--ag-rot, 0deg));
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: flex-grow var(--ag-duration) var(--ag-ease), transform var(--ag-duration) var(--ag-ease), border-color 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.ag-panel:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}

.ag-panel__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

/* Background photo layer.
   Set per-panel via inline style="--bg-image:url('...')" — replace with your own image.
   Works fine (falls back to brand gradient) even if no image is set yet. */
.ag-panel__media {
  position: absolute;
  inset: 0;
  background-color: var(--primary);
  background-image: var(--bg-image, linear-gradient(155deg, #0d2c27, #00695c 60%, #26a69a));
  background-size: cover;
  background-position: center;
  filter: grayscale(var(--ag-gray, 1));
  transform: scale(1.12);
}

.ag-panel__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.88) 100%),
    rgba(0, 0, 0, var(--ag-dim, 0.4));
  transition: background 0.4s ease;
}

.ag-panel__logo {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  filter:
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 10px color-mix(in srgb, var(--ag-accent, var(--primary-light)) 65%, transparent));
}

.ag-panel__label {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.ag-panel.is-active .ag-panel__label {
  opacity: 1;
  transform: translateX(0);
}

.ag-panel__bar {
  flex: 0 0 auto;
  width: 3px;
  height: calc(24px + (var(--ag-grow, 1) - 1) * 7.11px);
  border-radius: 3px;
  background: var(--ag-accent, var(--primary-light));
  box-shadow: 0 0 12px color-mix(in srgb, var(--ag-accent, var(--primary-light)) 60%, transparent);
}

.ag-panel__text {
  min-width: 0;
}

.ag-panel__tag {
  display: block;
  font-family: var(--font-heading);
  font-size: calc(0.625rem + (var(--ag-grow, 1) - 1) * 0.0833rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ag-accent, var(--primary-light));
  margin-bottom: 2px;
}

.ag-panel__title {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: calc(1rem + (var(--ag-grow, 1) - 1) * 0.3333rem);
  line-height: 1.2;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 960px) {
  body {
    padding: 32px 16px;
    gap: 28px;
  }
  .twin-accordion {
    height: clamp(360px, 55vh, 520px);
  }
  .ag-panel__logo {
    width: 34px;
    height: 34px;
  }
  .ag-panel__title {
    font-size: 1rem;
  }
}

@media (max-width: 680px) {
  .twin-accordion {
    flex-direction: column;
    height: auto;
    perspective: none;
  }
  .ag-panel {
    flex: 0 0 76px;
    transform: none !important;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
  }
  .ag-panel__logo {
    position: static;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
  }
  .ag-panel__label {
    position: static;
    opacity: 1;
    transform: none;
    flex: 1 1 auto;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ag-panel,
  .ag-panel__media,
  .ag-panel__label {
    transition: none !important;
  }
}
