:root {
  color-scheme: light;
  --bg: #f8f8f6;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: #101114;
  --muted: #666b73;
  --line: #e7e4df;
  --accent: #f20505;
  --accent-soft: #ffe7e7;
  --shadow: 0 16px 46px rgba(20, 18, 17, 0.1);
  --shadow-soft: 0 8px 22px rgba(20, 18, 17, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101114;
    --surface: #191b20;
    --surface-strong: #202329;
    --ink: #f6f2ed;
    --muted: #b5b0aa;
    --line: #2d3037;
    --accent: #ff3434;
    --accent-soft: rgba(255, 52, 52, 0.14);
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
    --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.28);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101114;
  --surface: #191b20;
  --surface-strong: #202329;
  --ink: #f6f2ed;
  --muted: #b5b0aa;
  --line: #2d3037;
  --accent: #ff3434;
  --accent-soft: rgba(255, 52, 52, 0.14);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(242, 5, 5, 0.08), transparent 34rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  transition: background-color 180ms ease, color 180ms ease;
}

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

button {
  font: inherit;
}

.page-shell {
  width: min(100%, 740px);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 34px) clamp(18px, 5vw, 38px) 34px;
}

.theme-toggle {
  position: fixed;
  z-index: 10;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  outline: none;
}

.theme-icon {
  color: var(--accent);
  font-size: 1rem;
}

.profile {
  display: grid;
  justify-items: center;
  padding: 34px 0 24px;
  text-align: center;
}

.profile-logo {
  width: clamp(132px, 30vw, 220px);
  height: auto;
  margin-bottom: 16px;
}

.profile-kicker,
.section-kicker,
.site-footer p {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.profile-kicker {
  margin: 0 0 8px;
}

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

h1 {
  margin-bottom: 10px;
  font-family: "Orbitron", "Eurostile Extended", "Microgramma D Extended", "Arial Black", sans-serif;
  font-size: clamp(2.45rem, 8.6vw, 4.95rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.profile-copy {
  width: min(100%, 520px);
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.8vw, 1.16rem);
}

.link-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 36px;
}

.link-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 10px 18px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.link-card:hover,
.link-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: var(--shadow);
  outline: none;
}

.link-card.primary,
.link-card.patreon {
  background:
    linear-gradient(90deg, var(--accent-soft), transparent 52%),
    var(--surface);
}

.link-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #15171b;
  color: #ffffff;
}

.link-icon svg,
.link-icon img,
.social-row svg {
  display: block;
  width: 27px;
  height: 27px;
  fill: currentColor;
}

.link-icon img {
  object-fit: contain;
}

.link-icon.makerworld {
  overflow: hidden;
  border: 1px solid var(--line);
  background: #ffffff;
}

.link-icon.patreon {
  border: 1px solid #101114;
  background: #101114;
  color: #ffffff;
}

.link-icon.makerworld img {
  width: 48px;
  height: 48px;
}

.link-icon.patreon svg {
  width: 31px;
  height: 31px;
}

.link-icon.instagram {
  background: linear-gradient(135deg, #ffd600, #ff3d67 48%, #7b2cff);
}

.link-icon.instagram svg,
.social-row a[aria-label="Instagram"] svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.link-icon.youtube,
.link-icon.email {
  background: var(--accent);
}

.link-icon.thingiverse {
  background: #2187ff;
}

.link-icon.thangs {
  background: #ff7a18;
}

.link-icon.facebook {
  background: #1877f2;
}

.link-content {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.link-content strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: clamp(1.05rem, 3.6vw, 1.32rem);
  line-height: 1.15;
}

.link-content small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.25;
}

.link-arrow {
  justify-self: end;
  color: var(--accent);
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1;
}

.portfolio-section {
  display: grid;
  gap: 18px;
  padding: 26px 0 18px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.section-kicker {
  margin: 0;
  font-size: 0.76rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 5vw, 2.3rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.section-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portfolio-card {
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.portfolio-media {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-strong);
}

.portfolio-media img,
.portfolio-placeholder {
  width: 100%;
  height: 100%;
}

.portfolio-media img {
  display: block;
  object-fit: cover;
  transition: transform 180ms ease;
}

.portfolio-media:hover img,
.portfolio-media:focus-visible img {
  transform: scale(1.035);
}

.portfolio-placeholder {
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: clamp(1.65rem, 6vw, 3rem);
  font-weight: 900;
}

.portfolio-card-body {
  display: grid;
  flex: 1;
  gap: 10px;
  padding: 13px;
}

.portfolio-meta,
.portfolio-badges,
.portfolio-card p {
  display: none;
}

.portfolio-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.portfolio-card h3 a:hover,
.portfolio-card h3 a:focus-visible {
  color: var(--accent);
  outline: none;
}

.portfolio-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.portfolio-stats div {
  display: grid;
  min-width: 56px;
  gap: 1px;
}

.portfolio-stats dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.portfolio-stats dd {
  margin: 0;
  color: var(--accent);
  font-size: 0.94rem;
  font-weight: 900;
}

.portfolio-empty {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.portfolio-empty p {
  margin: 0;
}

.text-link {
  justify-self: center;
  color: var(--accent);
  font-weight: 800;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
}

.text-link:hover,
.text-link:focus-visible {
  border-bottom-color: currentColor;
  outline: none;
}

.site-footer {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 28px 0 8px;
  text-align: center;
}

.site-footer p {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: 0.72rem;
}

.site-footer p::before,
.site-footer p::after {
  display: block;
  width: clamp(50px, 18vw, 118px);
  height: 1px;
  background: var(--accent);
  content: "";
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.social-row a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.social-row svg {
  width: 20px;
  height: 20px;
}

.social-row a:hover,
.social-row a:focus-visible {
  background: var(--accent);
  color: #ffffff;
  outline: none;
}

@media (max-width: 640px) {
  .theme-toggle {
    position: absolute;
  }

  .profile {
    padding-top: 54px;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .page-shell {
    padding-inline: 14px;
  }

  .link-card {
    grid-template-columns: 48px minmax(0, 1fr) 20px;
    gap: 12px;
    min-height: 72px;
    padding-right: 14px;
  }

  .link-icon {
    width: 44px;
    height: 44px;
  }

  .link-content small {
    font-size: 0.8rem;
  }

  .portfolio-card h3 {
    font-size: 0.9rem;
  }

  .site-footer p {
    gap: 10px;
  }
}
