/* ============================================================
   Daniel Milgård — CV site (calm redesign)
   A kind letter, not a poster: northern morning light,
   soft surfaces, sentence-case type, quiet motion.
   Type: Bricolage Grotesque (display) · Schibsted Grotesk (body)
         · IBM Plex Mono (small meta labels)
   ============================================================ */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/bricolage-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/bricolage-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/schibsted-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/schibsted-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/plexmono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/plexmono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --snow: #faf9f5;
  --horizon: #f0e7d8;
  --mist: #f1ece1;
  --hairline: #ddd6c9;
  --ink: #2a2b26;
  --text: #55564e;
  --lake: #3d6b8e;
  --lake-deep: #315877;
  --hilla: #d97c00;
  --white: #ffffff;
  --font-display: 'Bricolage Grotesque', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --font-body: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 40rem;
  --radius: 14px;
  --shadow-soft: 0 10px 30px rgba(42, 43, 38, 0.07);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--snow);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--lake); }
:focus-visible { outline: 3px solid var(--lake); outline-offset: 3px; border-radius: 2px; }

.mono { font-family: var(--font-mono); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem var(--gutter);
  background: rgba(250, 249, 245, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.topbar__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}
.topbar__nav { display: flex; flex-wrap: wrap; gap: clamp(0.75rem, 2vw, 1.5rem); font-size: 0.9rem; }
.topbar__nav a { color: var(--text); text-decoration: none; }
.topbar__nav a:hover { color: var(--lake); text-decoration: underline; text-underline-offset: 0.3em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--lake); color: var(--white); }
.btn--solid:hover { background: var(--lake-deep); }
.btn--quiet { color: var(--lake); border-color: var(--hairline); background: var(--white); }
.btn--quiet:hover { border-color: var(--lake); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--snow) 0%, var(--horizon) 100%);
  border-bottom: 1px solid var(--hairline);
}
.hero__inner {
  max-width: 68rem;
  margin-inline: auto;
  padding: clamp(3rem, 8vh, 6rem) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero__text { padding-bottom: clamp(3rem, 8vh, 6rem); }
.hero__title {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 1.25rem;
  animation: soft-in 900ms ease both;
}
.hei { position: relative; display: inline-block; }
.hei__wave {
  position: absolute;
  left: 0;
  bottom: -0.12em;
  width: 100%;
  height: 0.18em;
  color: var(--hilla);
  overflow: visible;
}
.hei__wave path {
  stroke-dasharray: 130;
  stroke-dashoffset: 130;
  animation: draw 900ms ease 500ms forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes soft-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hero__lede {
  max-width: var(--measure);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  margin-bottom: 1.75rem;
  animation: soft-in 900ms ease 150ms both;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; animation: soft-in 900ms ease 280ms both; }
.hero__meta { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--hilla); animation: soft-in 900ms ease 400ms both; }

.hero__portrait {
  align-self: center;
  justify-self: center;
  width: min(100%, 21rem);
  border-radius: 999px 999px var(--radius) var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  animation: soft-in 900ms ease 250ms both;
  margin-bottom: clamp(3rem, 8vh, 6rem);
}
.hero__portrait img { display: block; width: 100%; height: auto; }
@media (max-width: 780px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__text { padding-bottom: 0; }
  .hero__portrait { width: min(80%, 18rem); }
}

/* ---------- Sections (shared) ---------- */
.section { max-width: 68rem; margin-inline: auto; padding: clamp(4rem, 10vh, 7rem) var(--gutter) 0; }
.section:last-of-type { padding-bottom: clamp(4rem, 10vh, 7rem); }
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--hilla);
  margin-bottom: 0.9rem;
}
.section__title {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 46rem;
  margin-bottom: clamp(1.75rem, 4vh, 2.75rem);
}
.section__lede { max-width: var(--measure); margin-top: -1rem; margin-bottom: clamp(1.75rem, 4vh, 2.75rem); }

/* ---------- Minusta ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.about__text p { max-width: var(--measure); font-size: 1.02rem; }
.about__text p + p { margin-top: 1.2rem; }
.about__text strong { color: var(--ink); font-weight: 600; }
.facts {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 0.75rem;
  box-shadow: var(--shadow-soft);
  font-size: 0.92rem;
}
.facts__row { padding-bottom: 0.9rem; margin-bottom: 0.9rem; border-bottom: 1px solid var(--mist); }
.facts__row:last-child { border-bottom: none; }
.facts__row dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--hilla);
  margin-bottom: 0.15rem;
}
.facts__row dd { color: var(--ink); }
@media (max-width: 780px) { .about { grid-template-columns: 1fr; } }

/* ---------- Työt ---------- */
.featured { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--lake);
  box-shadow: 0 16px 36px rgba(42, 43, 38, 0.11);
}
/* Mini browser chrome above screenshots: reads as "a live website" */
.chrome {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.5rem 0.8rem;
  background: var(--mist);
  border-bottom: 1px solid var(--hairline);
}
.chrome i { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline); flex-shrink: 0; }
.chrome__url {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text);
  background: var(--white);
  border-radius: 999px;
  padding: 0.1rem 0.7rem;
  margin-left: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.card:hover .chrome__url, .mini:hover .chrome__url { color: var(--lake); }

.card__shot { display: block; border-bottom: 1px solid var(--hairline); overflow: hidden; }
.card__shot img { display: block; width: 100%; height: auto; transition: transform 300ms ease; }
.card:hover .card__shot img, .card:focus-visible .card__shot img { transform: scale(1.025); }
.card__body { display: flex; flex-direction: column; gap: 0.8rem; padding: 1.4rem 1.6rem 1.6rem; flex-grow: 1; }
.card__tag {
  align-self: flex-start;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--hilla);
  background: var(--mist);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}
.card__name {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: 1.45rem;
  line-height: 1.1;
  color: var(--ink);
}
.card__desc { font-size: 0.93rem; flex-grow: 1; }
.card__cta {
  align-self: flex-start;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--lake);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.card:hover .card__cta, .card:focus-visible .card__cta {
  background: var(--lake);
  border-color: var(--lake);
  color: var(--white);
}
@media (max-width: 860px) { .featured { grid-template-columns: 1fr; } }

.worklist__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
  margin-top: clamp(2.5rem, 6vh, 4rem);
  margin-bottom: 0.75rem;
}
.minigrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.mini {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.mini:hover {
  transform: translateY(-3px);
  border-color: var(--lake);
  box-shadow: 0 14px 30px rgba(42, 43, 38, 0.1);
}
.mini__shot { display: block; border-bottom: 1px solid var(--hairline); overflow: hidden; }
.mini__shot img { display: block; width: 100%; height: auto; transition: transform 300ms ease; }
.mini:hover .mini__shot img, .mini:focus-visible .mini__shot img { transform: scale(1.025); }
.mini .chrome { padding: 0.4rem 0.65rem; }
.mini .chrome i { width: 6px; height: 6px; }
.mini__body { display: block; padding: 1rem 1.15rem 1.15rem; }
.mini__name { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; font-weight: 600; color: var(--ink); font-size: 0.95rem; margin-bottom: 0.25rem; }
.mini__arrow { color: var(--lake); font-weight: 400; transition: transform 150ms ease; }
.mini:hover .mini__arrow, .mini:focus-visible .mini__arrow { transform: translate(2px, -2px); }
.mini__desc { display: block; color: var(--text); font-size: 0.85rem; line-height: 1.5; }
@media (max-width: 900px) { .minigrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .minigrid { grid-template-columns: 1fr; } }

/* ---------- Osaaminen ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.skills__cell {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}
.skills__cell p { font-size: 0.92rem; }
.skills__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
@media (max-width: 860px) { .skills { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .skills { grid-template-columns: 1fr; } }

/* ---------- Kokemus ---------- */
.timeline { list-style: none; border-top: 1px solid var(--hairline); }
.timeline__row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 0.3fr) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--hairline);
}
.timeline__years { font-size: 0.8rem; letter-spacing: 0.04em; color: var(--hilla); padding-top: 0.25rem; }
.timeline__org { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--ink); margin-bottom: 0.35rem; }
.timeline__role { display: inline-block; font-family: var(--font-body); font-weight: 400; font-size: 0.85rem; color: var(--text); margin-left: 0.4rem; }
.timeline__body p { max-width: var(--measure); font-size: 0.95rem; }
@media (max-width: 580px) { .timeline__row { grid-template-columns: 1fr; gap: 0.4rem; } }

/* ---------- Yhteys (signature: letter sign-off) ---------- */
.contact {
  margin-top: clamp(4rem, 10vh, 7rem);
  background: linear-gradient(180deg, var(--snow) 0%, var(--horizon) 100%);
  border-top: 1px solid var(--hairline);
}
.contact__inner { max-width: 68rem; margin-inline: auto; padding: clamp(4rem, 10vh, 6.5rem) var(--gutter); }
.contact__lede { max-width: var(--measure); margin-top: -1rem; margin-bottom: 2rem; font-size: 1.05rem; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: clamp(2.5rem, 6vh, 4rem); }
.signoff { border-left: 2px solid var(--lake); padding-left: 1.5rem; }
.signoff__closing { color: var(--text); }
.signoff__name {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 2.2rem;
  color: var(--ink);
  line-height: 1.2;
  margin: 0.25rem 0 0.75rem;
}
.signoff__ps { font-size: 0.9rem; color: var(--text); font-style: italic; }

/* ---------- Footer ---------- */
.footer { background: var(--horizon); padding: 1.25rem var(--gutter) 1.75rem; }
.footer p { max-width: 68rem; margin-inline: auto; font-size: 0.72rem; letter-spacing: 0.04em; color: var(--text); }

/* ---------- Scroll reveals ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__title, .hero__lede, .hero__actions, .hero__meta, .hero__portrait { animation: none; }
  .hei__wave path { animation: none; stroke-dashoffset: 0; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .mini, .card__shot img, .mini__shot img, .mini__arrow, .card__cta { transition: none; }
}
