:root {
  --bg: #f2f0e9;
  --surface: #fbfaf6;
  --ink: #101c17;
  --muted: #657069;
  --line: #cbd0ca;
  --accent: #155e40;
  --dark: #101c17;
  --radius: 28px;
  --shadow: 0 24px 70px rgba(16, 28, 23, .12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: .35;
  pointer-events: none;
  background-image: radial-gradient(rgba(16, 28, 23, .14) .6px, transparent .6px);
  background-size: 7px 7px;
  mask-image: linear-gradient(to bottom, #000, transparent 42%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-150%);
  background: var(--surface);
  border: 1px solid var(--ink);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: .8rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--surface);
  background: var(--dark);
  font-size: .68rem;
  letter-spacing: .04em;
}

.controls {
  display: flex;
  gap: 8px;
}

.switcher {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 250, 246, .75);
}

.switch-button {
  min-height: 32px;
  padding: 4px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: .7rem;
  cursor: pointer;
}

.switch-button:hover {
  background: rgba(21, 94, 64, .08);
}

.switch-button.active {
  color: #fff;
  background: var(--accent);
}

.hero {
  max-width: 930px;
  padding: 130px 0 120px;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .17em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  letter-spacing: -.055em;
}

h1 {
  max-width: 900px;
  margin-bottom: 28px;
  font-size: clamp(4rem, 8vw, 7.2rem);
  font-weight: 650;
  line-height: .94;
}

.hero-text {
  max-width: 580px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.6;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.text-link {
  display: inline-flex;
  gap: 20px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--ink);
  font-size: .78rem;
  font-weight: 740;
}

.text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.projects-section {
  padding: 100px 0 120px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 46px;
}

.section-heading .eyebrow {
  margin-bottom: 8px;
}

h2 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.6rem);
  font-weight: 640;
  line-height: 1;
}

.project {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(16, 28, 23, .11);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.project-divider {
  margin: 118px 0 96px;
  border-top: 1px solid var(--line);
}

.project-visual {
  position: relative;
  min-height: 690px;
  margin: 0;
  overflow: hidden;
  padding: 58px 58px 38px;
  background:
    radial-gradient(circle at 86% 15%, rgba(88, 225, 207, .2), transparent 25%),
    #0a1422;
}

.project-screen {
  display: block;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, .42);
}

.project-screen-main {
  width: min(100%, 920px);
  margin-left: auto;
}

.project-screen-secondary {
  position: absolute;
  bottom: 72px;
  left: 58px;
  width: min(36%, 390px);
}

.project-visual figcaption {
  position: absolute;
  right: 58px;
  bottom: 20px;
  color: rgba(255, 255, 255, .56);
  font: .62rem ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.babylon-visual {
  min-height: 720px;
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(107, 202, 126, .28), transparent 30%),
    linear-gradient(145deg, #1f583c, #0d2118);
}

.babylon-gallery {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 24px;
  margin: 0 auto;
}

.babylon-screen {
  width: 100%;
  display: block;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .3);
}

.babylon-screen:nth-child(2) {
  transform: translateY(36px);
}

.clan-visual {
  background:
    radial-gradient(circle at 82% 14%, rgba(245, 190, 39, .34), transparent 23%),
    linear-gradient(145deg, #c9dfeb, #769ab3);
}

.project-content {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr);
  gap: 80px;
  padding: 48px 52px 52px;
}

.project-lead {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tech-list li {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: .64rem ui-monospace, SFMono-Regular, Menlo, monospace;
}

.project-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: -20px;
}

.button {
  min-height: 49px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 0 20px;
  border: 1px solid var(--dark);
  border-radius: 999px;
  font-size: .77rem;
  font-weight: 720;
  transition: transform 160ms ease, background-color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #fff;
  background: var(--dark);
}

.button-primary:hover {
  background: var(--accent);
}

.button-secondary {
  border-color: var(--line);
  background: transparent;
}

.site-footer {
  min-height: 112px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .7rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  justify-self: end;
}

/* Alternate version: a restrained, monochrome early-web weblog. */
body[data-theme="retro"] {
  --bg: #f7f7f3;
  --surface: #fff;
  --ink: #111;
  --muted: #444;
  --line: #111;
  --accent: #111;
  --dark: #111;
  --radius: 0;
  --shadow: 5px 5px 0 #111;
  color: #111;
  background: #f7f7f3;
  font-family: Georgia, "Times New Roman", serif;
}

body[data-theme="retro"]::before {
  display: none;
}

body[data-theme="retro"] .site-shell {
  width: min(760px, calc(100% - 28px));
}

body[data-theme="retro"] .site-header {
  min-height: 76px;
  border-bottom: 3px double #111;
}

body[data-theme="retro"] .brand {
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}

body[data-theme="retro"] .brand-mark {
  border: 1px solid #111;
  border-radius: 0;
  color: #fff;
  background: #111;
}

body[data-theme="retro"] .switcher {
  padding: 2px;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
}

body[data-theme="retro"] .switch-button {
  min-height: 27px;
  border-radius: 0;
  font: .68rem Arial, sans-serif;
}

body[data-theme="retro"] .switch-button:hover {
  background: #eee;
}

body[data-theme="retro"] .switch-button.active {
  color: #fff;
  background: #111;
}

body[data-theme="retro"] .hero {
  padding: 62px 0 70px;
}

body[data-theme="retro"] .hero::before {
  display: block;
  margin-bottom: 30px;
  padding: 7px;
  border-top: 1px solid #111;
  border-bottom: 1px solid #111;
  content: "GREGOR'S SOFTWARE WEBLOG";
  text-align: center;
  font: bold .76rem "Courier New", monospace;
  letter-spacing: .12em;
}

body[data-theme="retro"] .eyebrow {
  color: #111;
  font: bold .73rem "Courier New", monospace;
  letter-spacing: 0;
}

body[data-theme="retro"] h1,
body[data-theme="retro"] h2 {
  color: #111;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

body[data-theme="retro"] h1 {
  max-width: 680px;
  font-size: clamp(2.7rem, 9vw, 4.5rem);
  line-height: 1.04;
}

body[data-theme="retro"] .hero-text {
  color: #222;
  font-size: 1.02rem;
}

body[data-theme="retro"] .text-link {
  color: #111;
  border-bottom: 0;
  font: 1rem "Times New Roman", serif;
  text-decoration: underline;
}

body[data-theme="retro"] .profile-links {
  gap: 20px;
}

body[data-theme="retro"] .projects-section {
  padding: 55px 0 70px;
  border-top: 3px double #111;
}

body[data-theme="retro"] .section-heading {
  display: block;
  margin-bottom: 28px;
}

body[data-theme="retro"] h2 {
  font-size: clamp(2.4rem, 7vw, 3.5rem);
  text-decoration: underline;
}

body[data-theme="retro"] .project {
  overflow: visible;
  padding: 7px;
  border: 2px solid #111;
  background: #fff;
}

body[data-theme="retro"] .project-divider {
  margin: 72px 0 56px;
  border-top: 3px double #111;
}

body[data-theme="retro"] .project-visual {
  min-height: auto;
  padding: 12px 12px 34px;
  border: 1px solid #111;
  background: #e9e9e9;
}

body[data-theme="retro"] .project-screen,
body[data-theme="retro"] .babylon-screen {
  border: 1px solid #111;
  border-radius: 0;
  box-shadow: none;
}

body[data-theme="retro"] .project-screen-main {
  width: 100%;
}

body[data-theme="retro"] .project-screen-secondary {
  display: none;
}

body[data-theme="retro"] .babylon-visual {
  background: #e9e9e9;
}

body[data-theme="retro"] .project-visual figcaption {
  right: 12px;
  bottom: 10px;
  color: #111;
  font-size: .58rem;
}

body[data-theme="retro"] .project-content {
  display: block;
  padding: 28px 20px 22px;
}

body[data-theme="retro"] .project-lead {
  margin-bottom: 24px;
  color: #111;
  font-size: 1rem;
  line-height: 1.55;
}

body[data-theme="retro"] .tech-list {
  margin-bottom: 25px;
}

body[data-theme="retro"] .tech-list li {
  border-radius: 0;
  border-color: #111;
  color: #111;
  background: #fff;
}

body[data-theme="retro"] .project-links {
  display: flex;
  margin-top: 0;
}

body[data-theme="retro"] .button {
  min-height: 34px;
  padding: 5px 12px;
  border: 2px outset #ccc;
  border-radius: 0;
  color: #111;
  background: #ddd;
  font: .78rem Arial, sans-serif;
}

body[data-theme="retro"] .button:hover {
  transform: none;
  background: #eee;
}

body[data-theme="retro"] .site-footer {
  min-height: auto;
  padding: 28px 0;
  border-top: 3px double #111;
  color: #111;
  font: .72rem "Courier New", monospace;
}

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    align-items: flex-start;
    padding: 16px 0;
  }

  .brand > span:last-child {
    display: none;
  }

  .controls {
    align-items: flex-end;
    flex-direction: column-reverse;
  }

  .hero {
    padding: 80px 0;
  }

  h1 {
    font-size: clamp(3.4rem, 16vw, 5.2rem);
  }

  .projects-section {
    padding: 72px 0 80px;
  }

  .section-heading {
    display: block;
  }

  .project-visual {
    min-height: auto;
    padding: 18px 18px 52px;
  }

  .project-divider {
    margin: 80px 0 65px;
  }

  .project-screen-main {
    width: 100%;
  }

  .project-screen-secondary {
    bottom: 30px;
    left: 18px;
    width: 40%;
  }

  .project-visual figcaption {
    right: 18px;
    bottom: 14px;
  }

  .project-content {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 30px 24px 34px;
  }

  .babylon-visual {
    min-height: auto;
    padding: 24px 12px 46px;
  }

  .babylon-gallery {
    gap: 8px;
  }

  .babylon-screen {
    border-radius: 10px;
  }

  .babylon-screen:nth-child(2) {
    transform: translateY(14px);
  }

  .project-links {
    grid-column: 1;
    margin-top: 0;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
    padding: 28px 0;
  }

  .site-footer p:nth-child(2) {
    display: none;
  }

  body[data-theme="retro"] .project-visual {
    padding: 8px 8px 30px;
  }

  body[data-theme="retro"] .babylon-visual {
    padding: 10px 8px 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
  }
}
