/* ==========================================================================
   David Southworth — contact card
   Takes its layout from Isotech's printed business card: the name split red
   over charcoal, a hairline rule, red glyphs beside each contact line, and
   the red band with the wordmark from the reverse. One file, no JavaScript.
   ========================================================================== */

:root {
  --red:      #d81e05;
  --red-dark: #b81804;
  --ink:      #2f3337;
  --muted:    #646b72;
  --faint:    #8a9197;
  --card:     #f7f4ed;   /* the ivory stock the cards are printed on */
  --paper:    #e6e2d9;
  --line:     rgba(47, 51, 55, .14);
  --shadow:   0 1px 2px rgba(20,22,24,.06), 0 12px 34px rgba(20,22,24,.12);
  --font:     "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --ease:     cubic-bezier(.2, .7, .3, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --red:      #fa3a1c;
    --red-dark: #d81e05;
    --ink:      #eceef0;
    --muted:    #a7aeb5;
    --faint:    #848b92;
    --card:     #191d21;
    --paper:    #0e1012;
    --line:     rgba(255,255,255,.13);
    --shadow:   0 2px 6px rgba(0,0,0,.5), 0 16px 40px rgba(0,0,0,.42);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 44px);
  padding-bottom: calc(clamp(16px, 4vw, 44px) + env(safe-area-inset-bottom));
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }

:where(a, button):focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 6px;
}

/* --- the card ----------------------------------------------------------- */

.card {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding: 30px 26px 26px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* The red spine, lifted from the reverse of the printed card */
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: var(--red);
}

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-left: 6px;
}

.photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(128,128,128,.18);
  box-shadow: 0 0 0 1px var(--line);
}

.logo { width: 118px; height: auto; margin-top: 4px; }

/* --- name, set the way it is printed ------------------------------------ */

.id { margin: 20px 0 0 6px; }

.name {
  font-size: clamp(34px, 9vw, 44px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.022em;
}
.name .fore { color: var(--red); display: block; }
.name .sur  { color: var(--ink); display: block; }

.role {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
}
.org {
  margin-top: 2px;
  font-size: 14.5px;
  color: var(--faint);
}

/* --- contact lines ------------------------------------------------------ */

.rows {
  margin: 22px 0 0 6px;
  padding-left: 18px;
  border-left: 1px solid var(--line);   /* the vertical rule on the printed card */
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.row {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 46px;
  padding: 4px 8px 4px 0;
  border-radius: 8px;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.row svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  color: var(--red);
  fill: currentColor;
}
.row span {
  font-size: 15.5px;
  word-break: break-word;
}
.row:hover { color: var(--red); background: rgba(216,30,5,.06); }

/* --- actions ------------------------------------------------------------ */

.acts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 1 1 160px;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  transition: background .18s var(--ease), border-color .18s var(--ease),
              color .18s var(--ease), transform .12s var(--ease);
}
.btn svg { width: 19px; height: 19px; fill: currentColor; }
.btn--save {
  flex: 1 1 100%;
  background: var(--red);
  color: #fff;
}
.btn--save:hover { background: var(--red-dark); }
.btn--ghost {
  border: 1px solid var(--line);
  color: var(--muted);
}
.btn--ghost:hover { border-color: var(--red); color: var(--red); }
.btn:active { transform: scale(.99); }

/* --- the reverse of the card -------------------------------------------- */

.cal {
  margin: 26px 0 0 6px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.cal__h {
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
}
.cal__list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
}
.cal__list li + li { margin-top: 2px; }

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--faint);
}
.foot a:hover { color: var(--red); }

@media (min-width: 560px) {
  .card { padding: 34px 32px 30px; }
  .photo { width: 112px; height: 112px; }
}

@media print {
  body { background: #fff; padding: 0; }
  .card { box-shadow: none; max-width: 100%; }
  .acts { display: none; }
}
