:root {
  --bg: #ffffff;
  --soft: #f6f5f2;
  --text: #1c1c1c;
  --muted: #5f5f5f;
  --line: #e7e5e0;
  --accent: #d9481e;
  --accent-dark: #b63a16;
  --radius: 12px;
  --head: "Poppins", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--head); line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 30px; }
h3 { font-size: 19px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.wrap { width: min(1080px, 100% - 40px); margin: 0 auto; }
section { padding: 72px 0; scroll-margin-top: 64px; }
.band { background: var(--soft); }
.section-intro { color: var(--muted); max-width: 620px; margin-bottom: 32px; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.name { font-family: var(--head); font-weight: 600; font-size: 18px; color: var(--text); text-decoration: none; }
.top nav { display: flex; gap: 22px; font-size: 15px; }
.top nav a { color: var(--text); text-decoration: none; }
.top nav a:hover { color: var(--accent); }

/* buttons */
.btn { display: inline-block; padding: 12px 22px; border-radius: 8px; font-weight: 600; text-decoration: none; border: 2px solid var(--accent); }
.btn.fill { background: var(--accent); color: #fff; }
.btn.fill:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.line { color: var(--accent); }
.btn.line:hover { background: var(--accent); color: #fff; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* hero */
.hero { padding: 84px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(38px, 6vw, 58px); margin-bottom: 8px; }
.hero .role { font-size: 20px; color: var(--accent); font-weight: 600; margin-bottom: 18px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 560px; }
.hero .photo { justify-self: center; width: min(320px, 100%); aspect-ratio: 3 / 4; border-radius: 16px; object-fit: cover; object-position: top; background: var(--soft); box-shadow: 0 12px 30px rgba(0,0,0,.12); }

/* projects */
/* flex instead of grid so a half-full last row is centred */
.cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.cards .card { flex: 0 0 calc((100% - 48px) / 3); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.card img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-bottom: 1px solid var(--line); background: var(--soft); }
/* project cover: small browser window in the project's own colour */
.cover { aspect-ratio: 2 / 1; background: color-mix(in srgb, var(--c) 12%, #fff); border-bottom: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center; padding: 22px 26px 0; overflow: hidden; }
.cover .window { width: 100%; height: 100%; background: #fff; border-radius: 10px 10px 0 0; box-shadow: 0 -2px 18px rgba(0,0,0,.07); display: flex; flex-direction: column; transition: transform .2s; }
.card:hover .cover .window { transform: translateY(-4px); }
.cover .bar { display: flex; gap: 5px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.cover .bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.cover .screen { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.cover .screen strong { font-family: var(--head); font-size: 19px; color: var(--c); line-height: 1.2; }
.cover .screen span { font-size: 13.5px; color: var(--muted); }
.cover .lines { display: flex; gap: 6px; margin-top: 10px; }
.cover .lines b { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--c) 22%, #fff); }
.cover .lines b:nth-child(1) { width: 34%; background: var(--c); }
.cover .lines b:nth-child(2) { width: 22%; }
.cover .lines b:nth-child(3) { width: 16%; }
.card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin-bottom: 6px; }
.card .year { font-weight: 400; color: var(--muted); font-size: 15px; }
.card p { font-size: 15.5px; color: var(--muted); }
.card .used { font-size: 14px; color: var(--muted); margin-top: auto; margin-bottom: 10px; }
.card .more { font-weight: 600; text-decoration: none; font-size: 15px; }
.card .more:hover { text-decoration: underline; }

/* internship highlight */
.highlight { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; align-items: start; }
.highlight .box { background: #fff; border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 26px 28px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.highlight .when { color: var(--accent); font-weight: 600; font-size: 15px; display: block; margin-bottom: 6px; }

/* cv */
.cv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--line); }
.timeline li { position: relative; margin-bottom: 24px; }
.timeline li::before { content: ""; position: absolute; left: -29px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }
.timeline .when { display: block; font-size: 14px; color: var(--muted); }
.timeline strong { display: block; font-size: 17px; }
.timeline p { margin: 4px 0 0; color: var(--muted); font-size: 15.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 8px; list-style: none; }
.chips li { padding: 6px 14px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: 15px; }

/* about */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }

/* contact */
.contact { background: var(--text); color: #fff; text-align: center; }
.contact h2 { font-size: 34px; }
.contact p { color: #d6d6d6; max-width: 560px; margin: 0 auto 26px; }
.contact .btn.fill { font-size: 18px; }
.contact .links { margin-top: 20px; font-size: 15px; }
.contact .links a { color: #fff; }

footer { padding: 22px 0; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; }
footer a { color: var(--muted); }

/* project page */
.back { font-size: 15px; }
.shot { margin: 20px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.text { margin-bottom: 24px; max-width: 720px; }
.pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 16px; font-size: 15px; }

@media (max-width: 900px) {
  .cards .card { flex-basis: calc((100% - 24px) / 2); }
}
@media (max-width: 680px) {
  section { padding: 52px 0; }
  .hero { padding: 48px 0; }
  .hero .wrap, .highlight, .cv-grid, .about { grid-template-columns: 1fr; gap: 28px; }
  .cards .card { flex-basis: 100%; }
  .hero .photo { width: 220px; order: -1; justify-self: start; }
  .top nav { gap: 14px; }
}
