/* ==========================================================
   css_vegard.css
   Digital business card with scroll-reveal (CSS only)
   ========================================================== */

/* 1. Colors and basics */
:root {
  --bg: #f3f1ec;
  --bg-alt: #e4e0d4;
  --text: #1c2b33;
  --accent: #1f4a4f;
  --accent-light: #3f7673;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 8vw, 3rem); margin-bottom: 0.1em; }
h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
h3 { font-size: 1.1rem; margin-bottom: 0.2em; }
p  { margin: 0 0 1em; }
a  { color: var(--accent); }
img { max-width: 100%; display: block; }

/* 2. Hero / business card */
.hero { position: relative; }

.hero-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.card-top {
  position: relative;
  margin: -70px 1.25rem 0;
  padding: 0 1.25rem 1.75rem;
  background: var(--bg);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 8px 30px rgba(28, 43, 51, 0.12);
}

.portrait {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  margin: -65px auto 1rem;
  border: 5px solid var(--bg);
  background: var(--bg-alt);
}

.role { color: var(--accent-light); font-weight: 600; margin-bottom: 0.4em; }
.tagline { max-width: 30ch; margin: 0 auto 1.25rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

/* 3. Sections */
.section {
  padding: 4rem 1.25rem;
  max-width: 720px;
  margin: 0 auto;
}
.alt { background: var(--bg-alt); max-width: none; }
.alt > * { max-width: 680px; margin-left: auto; margin-right: auto; }

figure { margin: 1.5rem 0; }
figure img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.service {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 0.9rem;
}
.service svg {
  flex: none;
  width: 52px;
  height: 52px;
  padding: 10px;
  border-radius: 12px;
  background: var(--accent);
  fill: #fff;
  stroke: #fff;
}
.service p { margin: 0; }

blockquote {
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 4px solid var(--accent-light);
  font-size: 1.1rem;
}

.info p { margin-bottom: 1.1em; }

footer {
  padding: 1.5rem 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--accent-light);
}

/* 4. Buttons */
.button {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}
.button.ghost { background: transparent; color: var(--accent); }

/* 5. Scroll animation: content fades up as it enters the screen */
@keyframes reveal {
  from { opacity: 0; transform: translateY(48px); }
  to   { opacity: 1; transform: translateY(0); }
}

@supports (animation-timeline: view()) {
  .reveal {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }
}

/* 6. Larger screens */
@media (min-width: 768px) {
  .hero-img { height: 340px; }
  .card-top { max-width: 560px; margin: -90px auto 0; }
  .section { padding: 6rem 2rem; }
}
