/* snesjhon.com: a calling card with four doors.
   Colour: white, ink, cobalt, tomato and their pale tints. Type: Fraunces (display) + Familjen Grotesk (text). */
:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #121117);
  --ink: light-dark(#17151f, #f3f1f8);
  --soft: light-dark(#6f6c7b, #a09cae);
  --line: light-dark(#ececf1, #26242e);
  --blue: #2f3cff;
  --red: #ff5b3a;
  --blue-tint: light-dark(#eceeff, #1c1e3d);
  --red-tint: light-dark(#fff0ec, #3a1d17);
  --display: "Fraunces", Georgia, serif;
  --text: "Familjen Grotesk", system-ui, sans-serif;
  --gutter: max(5vw, 16px);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; min-width: 0; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.55 var(--text);
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; border-radius: 8px; }
h1, h2, .door h2 { font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; }

/* ---------- home ---------- */
.is-home {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 40px max(var(--gutter), env(safe-area-inset-right, 0px)) 40px max(var(--gutter), env(safe-area-inset-left, 0px));
}
.home {
  width: min(100%, 1080px);
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.me { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; }
.home h1 { margin: 32px 0 0; font-weight: 700; font-size: clamp(44px, 5.6vw, 72px); line-height: 1; letter-spacing: -.02em; }
.intro { margin: 18px 0 0; font-size: 20px; color: var(--soft); max-width: 30ch; }
.intro strong { color: var(--ink); font-weight: 600; }
.social { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 28px; }
.social a {
  text-decoration: none; font-weight: 600; font-size: 16px;
  padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid color-mix(in oklab, var(--ink), transparent 82%);
}
.social a:hover { border-color: var(--ink); }
.social span { font-size: 15px; color: var(--soft); margin-left: 4px; }

.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.door {
  display: flex; flex-direction: column; justify-content: space-between;
  aspect-ratio: 1 / 1.02; border-radius: 28px; padding: 22px;
  text-decoration: none; overflow: hidden;
  transition: transform .25s cubic-bezier(.3, 1.5, .5, 1);
}
.door:hover { transform: translateY(-4px); }
.door svg { width: 100%; height: auto; max-height: 62%; overflow: visible; }
.door h2 { margin: 0; font-weight: 700; font-size: 30px; line-height: 1; letter-spacing: -.01em; }
.door p { margin: 4px 0 0; font-size: 15px; opacity: .75; }

/* tones, shared by home tiles and page banners */
.blue { background: var(--blue); color: #fff; }
.red { background: var(--red); color: #fff; }
.blue-tint { background: var(--blue-tint); color: var(--ink); }
.red-tint { background: var(--red-tint); color: var(--ink); }
.door.blue { border-radius: 28px 28px 8px 28px; }
.door.red { border-radius: 28px 28px 28px 8px; }

/* the small hover moments inside the drawings */
.sun, .c1, .c3, .q { transition: transform .45s cubic-bezier(.3, 1.5, .5, 1); }
.c1, .c3 { transform-origin: 0 0; }
.q { transform-origin: center; transform-box: fill-box; }
.door:hover .sun { transform: translateY(-10px); }
.door:hover .c1 { transform: rotate(-14deg) translate(-8px, 2px); }
.door:hover .c3 { transform: rotate(14deg) translate(8px, 2px); }
.door:hover .q { transform: scale(1.08) rotate(-4deg); }

/* ---------- inner pages ---------- */
.bar {
  max-width: 1080px; margin: 0 auto;
  padding: 24px max(var(--gutter), env(safe-area-inset-right, 0px)) 24px max(var(--gutter), env(safe-area-inset-left, 0px));
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px;
}
.back { display: flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; }
.back img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.bar nav { display: flex; flex-wrap: wrap; gap: 4px; }
.bar nav a { text-decoration: none; font-weight: 500; padding: 6px 12px; border-radius: 999px; }
.bar nav a:hover { background: var(--line); }
.bar nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

.page {
  max-width: 1080px; margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 64px max(var(--gutter), env(safe-area-inset-left, 0px));
}
.banner { display: flex; align-items: center; gap: 20px; padding-top: 24px; }
.chip {
  flex: none; width: 76px; height: 76px; border-radius: 22px;
  display: grid; place-items: center; padding: 12px; overflow: hidden;
}
.chip svg { width: 140%; max-width: none; height: auto; overflow: visible; }
.chip.red svg { transform: translateY(-8px); }
.banner h1 { margin: 0; font-weight: 700; font-size: clamp(36px, 5vw, 48px); line-height: 1; letter-spacing: -.02em; }
.banner p { margin: 6px 0 0; font-size: 17px; color: var(--soft); }

.prose { max-width: 66ch; margin-top: 48px; }
.prose h2 { font-weight: 700; font-size: 30px; line-height: 1.1; margin: 48px 0 12px; }
.prose p { margin: 0 0 16px; }
.prose a { text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--red); }
.prose a:hover { color: var(--blue); text-decoration-color: var(--blue); }
.prose img { border-radius: 24px; margin: 28px 0; width: 100%; }
.prose ul { list-style: none; margin: 0 0 16px; padding: 0; }
.prose li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.prose li:first-child { border-top: 1px solid var(--line); }
.prose blockquote {
  margin: 0 0 20px; padding: 28px 32px; border-radius: 28px;
  background: var(--blue-tint); font-family: var(--display); font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 600; font-size: 24px; line-height: 1.3;
}
.prose blockquote:nth-of-type(even) { background: var(--red-tint); }
.prose blockquote p { margin: 0 0 8px; }
.prose blockquote p:last-of-type { margin-bottom: 0; }
.prose cite { display: block; margin-top: 12px; font: 500 16px var(--text); color: var(--soft); font-style: normal; }
.prose code { font-size: .9em; background: var(--line); padding: .1em .35em; border-radius: 6px; }

.foot {
  max-width: 1080px; margin: 0 auto;
  padding: 24px max(var(--gutter), env(safe-area-inset-right, 0px)) 48px max(var(--gutter), env(safe-area-inset-left, 0px));
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-size: 15px; color: var(--soft);
}
.foot span { display: flex; gap: 16px; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .home { grid-template-columns: 1fr; }
  .door { padding: 18px; border-radius: 22px; }
  .door h2 { font-size: 24px; }
  .chip { width: 60px; height: 60px; border-radius: 18px; padding: 10px; }
}
@media (max-width: 380px) {
  .doors { gap: 10px; }
  .door p { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
