/* ============================================
   Design tokens — change these to update the look
   ============================================ */
:root {
  --color-bg: #121016;
  --color-surface: #1a1622;
  --color-surface-2: #221c2c;
  --color-border: #2a2433;
  --color-text: #f5f3f7;
  --color-text-muted: #b8b2c4;
  --color-accent: #a78bfa;
  --color-accent-strong: #7c3aed;
  --color-accent-bg: rgba(167, 139, 250, 0.12);

  --font-heading: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --max-width: 1080px;
  --radius: 14px;
  --radius-sm: 8px;
}

/* ============================================
   Reset & base
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 2.5em;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.3em;
}

p {
  color: var(--color-text-muted);
  margin: 0 0 1em;
}

/* ============================================
   Header / nav
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 16, 22, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-accent);
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .site-nav {
    gap: 18px;
  }
}

/* ============================================
   Buttons & tags
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-accent);
  color: #16121e;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--color-accent-strong);
  color: #fff;
}

.btn-ghost {
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.project-links .btn-ghost {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.project-links .btn-ghost:hover {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
  color: #fff;
}

.hero-actions,
.project-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.project-tags,
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
}

.tag,
.skills-list li {
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--color-accent-bg);
  color: var(--color-accent);
  white-space: nowrap;
}

/* ============================================
   Hero (startsida)
   ============================================ */
.hero {
  padding: 90px 24px 60px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--color-accent);
  margin: 0 0 0.8em;
}

.hero h1 {
  opacity: 0;
  animation: hero-name-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

@keyframes hero-name-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1 {
    animation: none;
    opacity: 1;
  }
}

.hero-lede {
  max-width: 620px;
  font-size: 1.15rem;
}

.section-title {
  margin-top: 0;
}

/* ============================================
   Project grid & cards
   ============================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 60px;
}

.project-card {
  display: block;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
}

.project-card-image {
  aspect-ratio: 4 / 3;
  background: var(--color-surface-2);
  position: relative;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card-body {
  padding: 20px 22px 24px;
}

.project-card-body h3 {
  margin-bottom: 0.25em;
}

.project-card-body p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* ============================================
   Image placeholder (shown when an image is missing)
   ============================================ */
.project-card-image.is-empty,
.project-cover.is-empty,
.section-image.is-empty,
.gallery-item.is-empty,
.about-photo.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--color-border);
}

.section-image.is-empty {
  aspect-ratio: 16 / 9;
}

.gallery-item.is-empty {
  aspect-ratio: 4 / 3;
}

.project-card-image.is-empty::after,
.project-cover.is-empty::after,
.section-image.is-empty::after,
.gallery-item.is-empty::after,
.about-photo.is-empty::after {
  content: "Image missing";
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ============================================
   Projektsida (case study)
   ============================================ */
.project-hero {
  padding-top: 56px;
}

.back-link {
  display: inline-block;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

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

.project-meta {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 2em;
}

.project-cover {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 9 / 8;
  background: var(--color-surface);
  margin-bottom: 20px;
}

.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-sections {
  padding: 20px 24px 40px;
  max-width: 760px;
}

.project-section {
  margin-bottom: 3em;
}

.section-image {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
  margin: 16px auto 0;
  display: flex;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
}

.section-image img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 800px;
  object-fit: contain;
  display: block;
}

.section-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
  display: flex;
  align-items: center;
}

.gallery-item img {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
}

.section-image-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
  width: 100vw;
  max-width: 960px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 24px;
  box-sizing: border-box;
}

.image-row-item {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
}

.image-row-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-links-top {
  margin: 4px 0 32px;
}

.project-not-found {
  padding: 100px 24px;
  text-align: center;
}

/* ============================================
   Om mig
   ============================================ */
.about-page {
  padding: 60px 24px 80px;
  max-width: 940px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
}

.about-photo {
  width: 280px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-surface);
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 75%;
  transform: scale(1.15);
}

@media (max-width: 640px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
  .about-page {
    grid-template-columns: 1fr;
  }
  .about-photo {
    width: 180px;
  }
}

/* ============================================
   CV & Kontakt
   ============================================ */
.cv-page {
  padding: 60px 24px 80px;
  max-width: 720px;
}

.cv-download {
  margin: 24px 0 40px;
}

.hint {
  font-size: 0.85rem;
  margin-top: 8px;
}

.timeline-item {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-period {
  font-size: 0.85rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4em;
}

.contact-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.contact-links a {
  text-decoration: none;
  color: var(--color-accent);
  font-size: 1.05rem;
}

.contact-links a:hover {
  color: var(--color-accent-strong);
}

.contact-form {
  margin-top: 28px;
  max-width: 480px;
}

.form-field {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.form-field label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.form-field input,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.contact-form .hint {
  color: var(--color-text-muted);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 60px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 28px 24px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  text-decoration: none;
  color: var(--color-text-muted);
}

.footer-links a:hover {
  color: var(--color-accent);
}
