:root {
  --bg: #fbfbfb;
  --ink: #342e2e;
  --muted: #7b7370;
  --line: #e2dfde;
  --accent: #1a5563;
  --accent-deep: #10404b;
  --accent-tint: #eef4f5;
  --accent-line: #cfe0e3;
  --white: #fff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 28px; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(155deg, #1c5f6c 0%, #10404b 60%, #0c3038 100%);
  color: #f2f7f8;
  position: relative;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, #dda76b 0%, #86b6bd 42%, #1a5563 100%);
}
.hero .wrap { padding-top: 20px; padding-bottom: 46px; }

.lang { display: flex; justify-content: flex-end; gap: 14px; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.lang button {
  border: 0; background: none; padding: 3px 0; cursor: pointer;
  color: rgba(242, 247, 248, 0.62);
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  border-bottom: 1.5px solid transparent;
}
.lang button:hover { color: #fff; }
.lang button[aria-current="true"] { color: #fff; border-bottom-color: #dda76b; }

.masthead { display: flex; align-items: center; gap: 34px; margin-top: 30px; }
.masthead .text { flex: 1 1 auto; min-width: 0; }
h1 {
  font-family: "Crimson Pro", Georgia, serif; font-weight: 300;
  font-size: clamp(36px, 7.5vw, 54px); line-height: 1.06; letter-spacing: 0.005em;
  margin: 0 0 12px; color: #fff;
}
.role {
  color: #9fc4cb; font-size: 13px; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase; margin: 0;
}
/* yhteystiedot herossa */
.handles { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.handles li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; line-height: 1.3; }
.handles svg {
  flex: 0 0 auto; width: 15px; height: 15px; stroke: #9fc4cb; stroke-width: 1.6;
  fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: .95;
}
.handles a { color: rgba(242, 247, 248, 0.82); border-bottom: 1px solid rgba(159, 196, 203, 0.35); }
.handles a:hover { color: #fff; border-bottom-color: #dda76b; }

.portrait {
  flex: 0 0 auto; width: 168px; height: 168px; border-radius: 50%;
  background: #e6e3e1 url("portrait.jpg") center/cover no-repeat;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 10px 30px rgba(0, 0, 0, 0.28);
}
@media (max-width: 560px) {
  .masthead { flex-direction: column; align-items: flex-start; gap: 22px; }
  .portrait { width: 124px; height: 124px; }
}

/* subpage hero is slimmer, no portrait */
.hero.slim .masthead { margin-top: 22px; }
.hero.slim .wrap { padding-bottom: 30px; }
.hero.slim h1 { font-size: clamp(30px, 6vw, 42px); margin-bottom: 6px; }
.back {
  display: inline-block; margin: 10px 0 0; color: #9fc4cb;
  font-size: 14px; text-decoration: none; border: 0;
}
.back:hover { color: #fff; text-decoration: underline; }

/* ---------- content ---------- */
main.wrap { padding-top: 14px; padding-bottom: 20px; }
section { margin: 44px 0 0; }
section:first-child > p:first-of-type { font-size: 18.5px; line-height: 1.62; }
h2 {
  font-family: "Crimson Pro", Georgia, serif; font-weight: 400;
  font-size: 26px; line-height: 1.2; margin: 0 0 6px; color: var(--accent-deep);
}
h2::after {
  content: ""; display: block; width: 38px; height: 2px;
  background: var(--accent); margin: 10px 0 18px; opacity: 0.8;
}
p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-line); }
a:hover { border-bottom-color: var(--accent); }

/* generic list */
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain > li { padding: 14px 0; border-bottom: 1px solid var(--line); }
ul.plain > li:first-child { border-top: 1px solid var(--line); }
.item-title { display: block; font-weight: 500; }
.item-meta { display: block; color: var(--muted); font-size: 14.5px; }

/* project cards */
.cards { display: grid; gap: 14px; }
.card {
  display: block; background: var(--white); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 3px;
  padding: 16px 18px; text-decoration: none; color: inherit;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.card:hover { box-shadow: 0 4px 16px rgba(16, 64, 75, 0.10); transform: translateY(-1px); border-color: var(--accent-line); border-left-color: var(--accent-deep); }
.card .t { display: flex; align-items: center; gap: 9px; font-weight: 600; color: var(--accent-deep); margin-bottom: 2px; }
.card .tag {
  font-size: 10.5px; font-weight: 600; font-style: normal;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: #8a5a1c; background: #fbf1e2; border: 1px solid #eeddc2;
  border-radius: 99px; padding: 2px 8px; line-height: 1.5; white-space: nowrap;
}
.card .d { display: block; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.card .u { display: block; color: var(--accent); font-size: 13px; margin-top: 6px; letter-spacing: 0.01em; }

/* publications */
ol.pubs { list-style: none; margin: 0; padding: 0; counter-reset: p; }
ol.pubs > li {
  display: grid; grid-template-columns: 58px 1fr; gap: 4px 16px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
ol.pubs > li:first-child { border-top: 1px solid var(--line); }
.year {
  font-family: "Crimson Pro", Georgia, serif; font-size: 21px; font-weight: 400;
  color: var(--accent); line-height: 1.5;
}
.pub-body .t { display: block; font-weight: 500; line-height: 1.45; margin-bottom: 3px; }
.pub-body .a { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; }
.pub-body .j { display: block; color: var(--accent); font-size: 14px; font-style: italic; }
.pubs-note { margin-top: 18px; color: var(--muted); font-size: 13.5px; }
@media (max-width: 480px) {
  ol.pubs > li { grid-template-columns: 1fr; gap: 2px; }
  .year { font-size: 16px; }
}

/* contact strip */
.contact {
  margin-top: 44px; background: var(--accent-tint); border: 1px solid var(--accent-line);
  border-radius: 3px; padding: 18px 20px; font-size: 15.5px;
}
.contact .l { display: block; color: var(--muted); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }

footer.site {
  margin-top: 52px; background: #f4f2f1; border-top: 1px solid var(--line);
}
footer.site .wrap { padding-top: 24px; padding-bottom: 34px; color: var(--muted); font-size: 13px; line-height: 1.7; }
footer.site a { color: var(--muted); border-bottom-color: var(--line); }
footer.site a:hover { color: var(--accent); }
