/* ==========================================================
   css_vegard.css
   Vegard Foyn – digital business card
   ========================================================== */

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

* { box-sizing: border-box; }

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

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; }
ul, ol { list-style: none; margin: 0; padding: 0; }

/* 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);
  box-shadow: 0 8px 30px rgba(28, 43, 51, 0.12);
}

.portrait {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  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 (all content centered) */
.section {
  padding: 4rem 1.25rem;
  max-width: 760px;
  margin: 0 auto;
}
.alt { background: var(--bg-alt); max-width: none; }
.alt > * { max-width: 700px; margin-left: auto; margin-right: auto; }

/* Keep paragraphs a readable width, centered */
.section p { max-width: 60ch; margin-left: auto; margin-right: auto; }

.space-top { margin-top: 2.5rem; }

/* Condition tiles */
.tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}
.tiles li {
  background: var(--bg);
  border-radius: var(--radius);
  border-top: 4px solid var(--accent-light);
  padding: 1rem;
  display: flex;
  align-items: center;       /* centers the text vertically */
  justify-content: center;   /* centers the text horizontally */
}

/* Focus-area chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.chips li {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--bg-alt);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Education list */
.plain { margin-bottom: 1.5rem; }
.plain li { padding: 0.7rem 0; border-bottom: 1px solid var(--bg-alt); }
.plain li:last-child { border-bottom: 0; }

/* First-visit steps (a real sequence, so numbered) */
.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}
.steps li {
  counter-increment: step;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.steps li::before {
  content: counter(step);
  width: 2.1rem;
  height: 2.1rem;
  margin: 0 auto 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.steps p { margin: 0 auto; }

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

footer {
  padding: 1.5rem 1.25rem;
  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. Reveal animation
   Content fades up once, smoothly, when it scrolls into view.
   (A small script in index.html adds the class "in".)
   Without JavaScript the content is simply visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
  will-change: opacity, transform;
}
.js .reveal.in {
  opacity: 1;
  transform: none;
  will-change: auto;   /* release the GPU layer once finished */
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: 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; }
  .tiles, .steps { grid-template-columns: 1fr 1fr; }
}
