/* The page is the card on a table. The card's own colours are fixed (they are the
   2008 art); only the table around it follows light and dark mode. */
:root {
  --table: #ebe8e1;
  --ink: #4a4a44;
  --shadow: rgba(40, 45, 30, 0.28);
  --green: #779152;
  --leaf: #c2e296;
}
@media (prefers-color-scheme: dark) {
  :root {
    --table: #191b16;
    --ink: #b9bdb0;
    --shadow: rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--table);
  color: var(--ink);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 16px;
}

.hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The card fills the window. Its own size and shape are set by card.js (the SVG
   viewBox follows the window); here it is only placed edge to edge. */
.js body { overflow: hidden; }
.js main { display: block; padding: 0; }
.card {
  position: relative;
  width: min(100%, 760px);
  aspect-ratio: 1088 / 638;
}
.js .card {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  perspective: 300vmax;
}

.face {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.face svg { display: block; width: 100%; height: 100%; }

.skills {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Bold", sans-serif;
  font-size: 16.5px;
}

.serif text {
  font-family: "Times New Roman", Times, "Liberation Serif", serif;
}

.front a text { fill: #000000; }
.front a:hover text,
.front a:focus-visible text { fill: var(--green); }

/* Without the script both sides show, one above the other. */
html:not(.js) .card { aspect-ratio: auto; display: grid; gap: 20px; }
html:not(.js) .face { position: relative; aspect-ratio: 1088 / 638; }

/* With it, the card turns over. */
.js .card { cursor: pointer; transform-style: preserve-3d; }
.js .face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.7s cubic-bezier(0.3, 0.1, 0.2, 1);
}
.js .front { transform: rotateY(180deg); }
.js .card.flipped .cover { transform: rotateY(-180deg); }
.js .card.flipped .front { transform: rotateY(0deg); }

@media (prefers-reduced-motion: reduce) {
  .js .face { transition: opacity 0.25s linear; transform: none !important; }
  .js .front { opacity: 0; }
  .js .card.flipped .cover { opacity: 0; }
  .js .card.flipped .front { opacity: 1; }
}

.flip {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
  z-index: 2;
  font: inherit;
  color: #ffffff;
  background: rgba(30, 36, 22, 0.85);
  border: 1px solid var(--leaf);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
}
.flip:not(:focus-visible) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
html:not(.js) .flip { display: none; }
