/* ==========================================================================
   Koen Hommers — business card
   Design tokens adapted from the "Modernist" design system.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;600;800&display=swap');

:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  --color-accent: #ec3013;
  --color-divider: color-mix(in srgb, #201e1d 40%, transparent);

  --color-neutral-600: #7d7979;
  --color-neutral-700: #605d5d;

  --color-accent-400: #ff9783;
  --color-accent-600: #dd2b0f;
  --color-accent-700: #ae1800;

  --font-heading: "Archivo", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;

  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;

  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);
}

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

html, body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--color-accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--color-accent-700); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* ── layout shell ─────────────────────────────────────────────────────── */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 2px solid var(--color-divider);
}

.mark {
  width: 20px;
  height: 20px;
  flex: none;
  background: var(--color-accent);
  transform-origin: bottom;
}
.mark.pulse { animation: mark-pulse 0.56s ease-in-out; }
@keyframes mark-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

.brand {
  margin-right: auto;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.01em;
  line-height: 1;
}

.location {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
  line-height: 1;
  white-space: nowrap;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ── flip card ────────────────────────────────────────────────────────── */

.card-stage {
  perspective: 1600px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.card {
  position: relative;
  width: 100%;
  aspect-ratio: 1.62;
  transform-style: preserve-3d;
  cursor: pointer;
  transition: transform 0.85s cubic-bezier(0.65, 0, 0.35, 1);
}
.card.is-flipped { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 5.5vw, 28px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.card-face--front {
  background: var(--color-text);
  color: var(--color-bg);
}

.card-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  pointer-events: none;
}
.card-grid > div { border-right: 1px solid rgba(243, 242, 242, 0.18); }
.card-grid > div:last-child { border-right: 0; }

.card-kicker {
  font-size: clamp(10px, 2vw, 11px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent-400);
}

.card-name {
  margin-top: auto;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(32px, 9vw, 44px);
  line-height: 0.9;
  letter-spacing: -0.035em;
}

.card-rule {
  height: 2px;
  background: var(--color-accent);
  width: 64px;
  margin: 16px 0 12px;
}

.card-tagline {
  font-size: clamp(12px, 3vw, 13px);
  line-height: 1.5;
  color: rgba(243, 242, 242, 0.74);
}

.card-face--back {
  background: var(--color-surface);
  transform: rotateY(180deg);
  flex-direction: row;
  align-items: center;
  gap: clamp(14px, 4vw, 28px);
}

.card-back-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 4vw, 20px);
}

.card-back-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent-700);
}

.card-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: clamp(12px, 3.4vw, 14px);
  line-height: 1.25;
}
.card-contact-row { display: flex; flex-direction: column; }
.card-contact-row span {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
}

.card-back-qr {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.card-qr {
  flex: none;
  width: clamp(88px, 26vw, 120px);
  height: clamp(88px, 26vw, 120px);
  background: #f3f2f2;
}
.card-qr svg { display: block; width: 100%; height: 100%; }
.card-qr svg rect { fill: #f3f2f2; }
.card-qr svg path { fill: var(--color-text); }

@media (min-width: 880px) {
  .card-qr { width: 140px; height: 140px; }
}
.card-qr-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
  text-align: center;
  white-space: nowrap;
}

/* ── actions ──────────────────────────────────────────────────────────── */

.actions {
  display: flex;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  padding: 10px 16px;
  border-radius: 0;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { flex: 1; justify-content: flex-start; background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover:not(:disabled) { background: var(--color-accent-600); }
.btn-primary:active:not(:disabled) { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }

.hint {
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
}

/* ── desktop side panel ──────────────────────────────────────────────── */

.side-panel { display: none; }

@media (min-width: 880px) {
  .main {
    flex-direction: row;
    align-items: center;
    gap: 64px;
    padding-top: 56px;
  }
  .card-column {
    flex: 1.15;
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .card-stage { max-width: none; }
  .card-column .actions,
  .card-column .hint { display: none; }

  .side-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .side-kicker {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-neutral-600);
    margin-bottom: 16px;
  }
  .side-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: -0.03em;
  }
  .hr {
    height: 2px;
    border: 0;
    margin: 24px 0;
    background: var(--color-divider);
  }
  .side-table { display: flex; flex-direction: column; }
  .side-table-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-divider);
    font-size: 15px;
  }
  .side-table-row span:first-child {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-neutral-600);
    align-self: center;
  }
  .side-panel .actions { margin-top: 24px; max-width: none; }
}

/* ── entrance animation ──────────────────────────────────────────────── */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up {
  animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.card-face--front .card-kicker { animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both; }
.card-face--front .card-name { animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both; }
.card-face--front .card-rule { animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both; }
.card-face--front .card-tagline { animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.38s both; }

@media (prefers-reduced-motion: reduce) {
  .card, .fade-up, .card-face--front .card-kicker,
  .card-face--front .card-name, .card-face--front .card-rule,
  .card-face--front .card-tagline, .mark.pulse {
    animation: none !important;
    transition: none !important;
  }
}
