:root {
  color-scheme: light;
  --ink: #202329;
  --muted: #686d76;
  --paper: #fffaf7;
  --panel: #ffffff;
  --line: #eaded8;
  --coral: #ee6b6e;
  --teal: #0f8b8d;
  --gold: #f4b860;
  --rose: #f29db0;
  --shadow: 0 18px 50px rgba(62, 48, 42, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(244, 184, 96, 0.18), transparent 34rem),
    linear-gradient(180deg, #fff8f4 0%, #ffffff 48%, #f7fbfb 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

img,
.art-canvas {
  display: block;
  max-width: 100%;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.art-canvas:not(.is-loaded) {
  opacity: 0;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 5vw, 4rem);
  background: rgba(255, 250, 247, 0.86);
  border-bottom: 1px solid rgba(234, 222, 216, 0.82);
  backdrop-filter: blur(16px);
}

.brand {
  color: var(--teal);
  font-size: 1.05rem;
  font-weight: 850;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.4rem);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

nav a {
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible,
footer a:hover,
footer a:focus-visible {
  color: var(--coral);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(18rem, 1.12fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 5rem);
  min-height: calc(100vh - 4.5rem);
  padding: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 5vw, 4rem) 3rem;
}

.hero-copy {
  max-width: 42rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.04;
}

h1 {
  color: var(--ink);
  font-size: clamp(4.25rem, 12vw, 10rem);
  font-weight: 950;
}

h2 {
  max-width: 54rem;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  font-weight: 910;
}

h3 {
  font-size: 1.2rem;
}

.hero-copy p:not(.eyebrow),
.lupin-copy p,
.feature-grid p {
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
}

.hero-copy p:not(.eyebrow) {
  max-width: 34rem;
  margin: 1rem 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.7rem;
}

.button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(62, 48, 42, 0.08);
}

.button.primary {
  border-color: transparent;
  background: var(--teal);
  color: #ffffff;
}

.hero-art {
  position: relative;
  align-self: end;
  min-height: 28rem;
  overflow: hidden;
}

.hero-art img,
.hero-art .art-canvas {
  width: min(44rem, 100%);
  aspect-ratio: 1;
  margin-inline: auto;
  filter: drop-shadow(0 32px 36px rgba(38, 40, 42, 0.18));
}

.section {
  padding: clamp(3.5rem, 8vw, 7rem) clamp(1rem, 5vw, 4rem);
}

.section-heading {
  display: grid;
  gap: 0.35rem;
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

.intro-section {
  background: #ffffff;
}

.about-me {
  max-width: 50rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.about-me p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 42rem;
  gap: 1rem;
}

.feature-grid article {
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(62, 48, 42, 0.1);
}

.protected-art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  user-select: none;
  -webkit-touch-callout: none;
}

.protected-art::before,
.gallery-item::before {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  content: "";
  background-image: repeating-linear-gradient(
    -24deg,
    transparent 0 5.25rem,
    rgba(32, 35, 41, 0.12) 5.25rem 5.32rem,
    transparent 5.32rem 10.5rem
  );
  mix-blend-mode: multiply;
}

.protected-art::after,
.gallery-item::after {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 3;
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  color: rgba(32, 35, 41, 0.72);
  content: "Fenrik.dev";
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.gallery-item::after {
  top: 0.75rem;
  right: auto;
  bottom: auto;
  left: 0.75rem;
}

.feature-grid .protected-art {
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(242, 157, 176, 0.16), rgba(15, 139, 141, 0.12));
}

.feature-grid img,
.feature-grid .art-canvas {
  width: 100%;
  min-height: 0;
  aspect-ratio: 1;
  object-fit: contain;
}

.lupin-section {
  display: grid;
  grid-template-columns: minmax(16rem, 0.52fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  background: linear-gradient(135deg, rgba(242, 157, 176, 0.2), rgba(244, 184, 96, 0.13));
}

.lupin-copy {
  max-width: 34rem;
}

.lupin-copy p {
  margin: 1rem 0 0;
}

.lupin-art {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.lupin-art img,
.lupin-art .art-canvas {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  padding: clamp(0.5rem, 2vw, 1.5rem);
}

.couple-section {
  background: #fffdfb;
}

.couple-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1rem;
}

figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

figure .protected-art {
  background: linear-gradient(135deg, rgba(15, 139, 141, 0.1), rgba(238, 107, 110, 0.12));
}

figure img,
figure .art-canvas {
  width: 100%;
  aspect-ratio: 1.2;
  object-fit: contain;
  padding: 0.75rem;
}

figcaption {
  padding: 0.8rem 1rem 1rem;
  font-weight: 850;
}

.gallery-section {
  background: #f7fbfb;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 1rem;
}

.gallery-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(62, 48, 42, 0.09);
  user-select: none;
}

.gallery-item.wide {
  grid-column: span 2;
}

.gallery-item img,
.gallery-item .art-canvas {
  width: 100%;
  height: 100%;
  min-height: 16rem;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 0.75rem;
  transition: transform 180ms ease;
}

.gallery-item.wide img,
.gallery-item.wide .art-canvas {
  aspect-ratio: 1.7;
}

.gallery-item span {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  max-width: calc(100% - 1.3rem);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: rgba(32, 35, 41, 0.78);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 850;
  pointer-events: none;
}

.gallery-item:hover img,
.gallery-item:focus-visible img,
.gallery-item:hover .art-canvas,
.gallery-item:focus-visible .art-canvas {
  transform: scale(1.025);
}

.copy-guard {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(32, 35, 41, 0.18);
  border-radius: 8px;
  background: rgba(32, 35, 41, 0.92);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.copy-guard.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.devtools-open .protected-art img,
.devtools-open .gallery-item img,
.devtools-open .protected-art .art-canvas,
.devtools-open .gallery-item .art-canvas {
  filter: blur(18px);
}

.devtools-open .protected-art::after,
.devtools-open .gallery-item::after {
  content: "Protected artwork";
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem clamp(1rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-weight: 750;
}

footer p {
  margin: 0;
}

footer a {
  text-decoration: none;
}

@media (max-width: 920px) {
  .hero,
  .lupin-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-art {
    min-height: 0;
  }

  .feature-grid,
  .couple-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding-top: 2rem;
  }

  h1 {
    font-size: clamp(3.4rem, 21vw, 5.4rem);
  }

  h2 {
    font-size: clamp(2rem, 13vw, 3.25rem);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item.wide {
    grid-column: span 1;
  }

  .gallery-item img,
  .gallery-item.wide img,
  .gallery-item .art-canvas,
  .gallery-item.wide .art-canvas {
    min-height: 14rem;
    aspect-ratio: 1;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  img,
  .art-canvas,
  .protected-art,
  .gallery-item {
    visibility: hidden;
  }

  .protected-art::after,
  .gallery-item::after {
    visibility: visible;
    content: "Artwork protected by Fenrik.dev";
  }
}
