/* ========== Base ========== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f5f5f5;
  color: #141414;
  line-height: 1.6;
}

/* Color system inspired by Scandinavian minimalism */
:root {
  --bg: #f5f5f5;
  --bg-alt: #ffffff;
  --accent: #235b8f;
  --accent-soft: #e0f1ff;
  --border-soft: #e0e0e0;
  --text-main: #141414;
  --text-muted: #6f6f6f;
  --shadow-soft: 0 14px 30px rgba(0, 0, 0, 0.04);
  --radius-card: 18px;
}

/* Layout helpers */

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: #ffffff;
}

.section-header {
  margin-bottom: 2.5rem;
  max-width: 640px;
}

.section-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.9rem;
  letter-spacing: 0.02em;
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
}

/* ========== Header & Nav ========== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(245, 245, 245, 0.9);
  border-bottom: 1px solid rgba(224, 224, 224, 0.7);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-main);
  letter-spacing: 0.04em;
  font-size: 1rem;
}

.logo-main {
  opacity: 0.85;
}

.logo-accent {
  color: var(--accent);
  margin-left: 2px;
}

.logo-dot {
  color: #999;
  margin: 0 1px;
}

.logo-dev {
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-muted);
  position: relative;
  padding-bottom: 4px;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.18s ease;
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--text-main);
}

.main-nav a:hover::after,
.main-nav a:focus::after {
  width: 100%;
}

/* ========== Hero ========== */

.hero {
  padding: 4.5rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.3fr);
  gap: 3rem;
  align-items: center;
}

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

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 3vw, 2.6rem);
  line-height: 1.15;
}

.hero h1 span {
  font-weight: 500;
}

.hero-subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  font-size: 0.8rem;
}

.meta-label {
  display: block;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
}

.meta-value {
  display: block;
}

.link-inline {
  color: var(--accent);
  text-decoration: none;
}

.link-inline:hover {
  text-decoration: underline;
}

/* hero media */

.hero-media {
  display: grid;
  gap: 1.25rem;
}

.photo-card,
.illustration-card {
  background: var(--bg-alt);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 1.25rem;
}

.photo-frame {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 4;
  background: #dfe7f1;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-card figcaption {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* simple abstract avatar illustration */

.avatar-abstract {
  position: relative;
  height: 140px;
  border-radius: 16px;
  background: linear-gradient(135deg, #e6f1fb, #f6fbff);
  overflow: hidden;
}

.avatar-head {
  position: absolute;
  left: 22%;
  top: 23%;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f7e3d3;
}

.avatar-body {
  position: absolute;
  left: 18%;
  top: 46%;
  width: 90px;
  height: 80px;
  border-radius: 60px;
  background: var(--accent);
}

.avatar-dog {
  position: absolute;
  right: 16%;
  bottom: 18%;
  width: 54px;
  height: 38px;
  border-radius: 24px;
  background: #2f2520;
  box-shadow: -18px -22px 0 0 #2f2520;
}

.illustration-caption {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========== Buttons ========== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn.primary:hover {
  filter: brightness(1.03);
}

.btn.ghost {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-soft);
}

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

.btn.small {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

.btn.full-width {
  width: 100%;
}

/* ========== Cards & grids ========== */

.card {
  background: var(--bg-alt);
  border-radius: var(--radius-card);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-soft);
}

/* ========== Projects ========== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.card-media {
  position: relative;
  height: 150px;
  background: #dfe7f1;
}

.card-body {
  padding: 1.3rem 1.5rem 1.4rem;
}

.project-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.project-card p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.tag {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(245, 245, 245, 0.95);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* cover styles – simple muted gradients */

.cover-norgeshistorie {
  background: linear-gradient(120deg, #e4eef9, #e7f6f0);
}

.cover-vaskeliste {
  background: linear-gradient(135deg, #e4f4ff, #f4edff);
}

.cover-codebark {
  background: linear-gradient(135deg, #eaf3ff, #f5f5f5);
}

/* extra text toggle */

.project-extra {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: none;
}

.project-card.expanded .project-extra {
  display: block;
}

/* ========== About / Resume ========== */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.2fr);
  gap: 2.5rem;
  align-items: flex-start;
}

.resume-highlights h3 {
  margin: 1.4rem 0 0.4rem;
  font-size: 0.95rem;
}

.resume-highlights ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.resume-highlights li + li {
  margin-top: 0.25rem;
}

.resume-highlights .btn {
  margin-top: 1.2rem;
}

/* resume side card */

.resume-card {
  background: #f7f8fa;
}

.resume-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem;
  border-left: 1px solid var(--border-soft);
}

.timeline li {
  position: relative;
  padding: 0.35rem 0 0.35rem 0.9rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.7rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-year {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.timeline-label {
  display: block;
  font-size: 0.88rem;
}

.timeline-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* ========== Tech stack ========== */

.tech-groups {
  display: grid;
  gap: 1.5rem;
}

.tech-group h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border-soft);
  font-size: 0.8rem;
  background: #ffffff;
}

.pill-soft {
  background: var(--accent-soft);
  border-color: transparent;
}

/* ========== Blog ========== */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.blog-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.blog-card p {
  margin: 0 0 0.8rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.blog-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========== Contact ========== */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.5fr);
  gap: 2.5rem;
  align-items: flex-start;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  font-size: 0.9rem;
}

.contact-list li {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.8rem;
}

.contact-list span:first-child {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.contact-list a {
  color: var(--accent);
  text-decoration: none;
}

.contact-list a:hover {
  text-decoration: underline;
}

.contact-form h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.form-note {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contact-form label {
  display: block;
  margin-bottom: 0.9rem;
  font-size: 0.85rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  font-family: inherit;
  font-size: 0.9rem;
  background: #fbfbfb;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 1px solid var(--accent);
  background: #ffffff;
}

/* ========== Footer ========== */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 1.7rem 0;
  background: #fafafa;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  gap: 1rem;
}

.footer-dog {
  opacity: 0.9;
}

/* ========== Responsive ========== */

@media (max-width: 900px) {
  .hero-grid,
  .about-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-media {
    order: -1;
  }

  .nav-container {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    height: auto;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 3.5rem 0;
  }

  .hero {
    padding-top: 3.5rem;
  }

  .card {
    padding: 1.2rem 1.2rem;
  }

  .card-body {
    padding: 1.1rem 1.2rem 1.2rem;
  }

  .photo-frame {
    aspect-ratio: 4 / 5;
  }
}
