/* ===== Roger Wienaah — portfolio styles ===== */
:root {
  --bg: #ffffff;
  --surface: #f5f7fa;
  --text: #1d2430;
  --muted: #5b6575;
  --border: #e3e7ee;
  --accent: #0b5d8c;      /* ocean blue */
  --accent-soft: #e6f0f7;
  --on-accent: #ffffff;   /* text on --accent backgrounds */
  --radius: 10px;
  --max: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
html[data-theme="dark"] {
    --bg: #11151c;
    --surface: #1a2029;
    --text: #e6e9ef;
    --muted: #9aa4b2;
    --border: #2a323e;
    --accent: #5eb3e4;
    --accent-soft: #17303f;
    --on-accent: #11151c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  /* keep the footer at the bottom of the window on short pages */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; margin-top: 2.5rem; padding-bottom: .35rem; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--accent); }
.site-header .container > .nav-wrap { display: flex; align-items: center; }
.nav { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav a.active { color: var(--accent); text-decoration: none; }
.nav a.active { border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.theme-toggle {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; margin-left: 1rem;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; color: var(--text); cursor: pointer; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .nav li a { display: block; padding: .8rem 1.25rem; }
  .nav a.active { border-bottom: 0; }
}

main.container { flex: 1 0 auto; width: 100%; padding-top: 2.5rem; padding-bottom: 3rem; }
.page-title { margin-bottom: .25rem; }
.page-intro { color: var(--muted); margin-top: 0; }

/* ---------- Home: profile + about ---------- */
.home-grid { display: grid; grid-template-columns: 280px 1fr; gap: 3rem; align-items: start; }
.home-grid.photo-right { grid-template-columns: 1fr 280px; }
.home-grid.photo-right .profile { order: 2; }
.profile { text-align: center; position: sticky; top: 90px; }
.profile img.avatar {
  width: 230px; aspect-ratio: 3 / 4; height: auto; object-fit: cover; object-position: 8% center; border-radius: 8px;
  margin: 0 auto 1rem; border: 1px solid var(--border);
}
.profile .name { font-size: 1.5rem; font-weight: 700; margin: 0; }
.profile .role { margin: .2rem 0 0; color: var(--muted); }
.profile .affil { margin: 0 0 1rem; color: var(--muted); font-size: .95rem; display: flex; align-items: center; justify-content: center; gap: .4rem; }
.affil-icon { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; }
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.socials a {
  display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.socials a:hover { background: var(--accent); color: var(--on-accent); text-decoration: none; }
.socials svg { width: 19px; height: 19px; fill: currentColor; }

.about p { margin: 0 0 1rem; }
.callout {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  padding: .9rem 1.1rem; border-radius: 6px; margin: 1.25rem 0;
}
.callout p { margin: 0; }
.btn {
  display: inline-block; padding: .55rem 1.1rem; border-radius: 8px; font-weight: 600;
  background: var(--accent); color: var(--on-accent); margin-top: .6rem;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); margin-left: .4rem; }

.interests { list-style: none; padding: 0; margin: 0; }
.interests li { padding: .3rem 0 .3rem 1.6rem; position: relative; }
.interests li::before { content: ""; position: absolute; left: .35rem; top: .9rem; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.interests strong { font-weight: 600; }

@media (max-width: 760px) {
  .home-grid, .home-grid.photo-right { grid-template-columns: 1fr; gap: 1.5rem; }
  .home-grid.photo-right .profile { order: 0; }
  .profile { position: static; }
}

/* ---------- Projects (media left, details right) ---------- */
.project {
  display: grid; grid-template-columns: 260px 1fr; gap: 1.75rem;
  padding: 1.5rem 0; border-bottom: 1px solid var(--border);
}
.project:last-child { border-bottom: 0; }
.project .media img, .project .media video {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.project h3 { margin-bottom: .2rem; }
.project .meta { color: var(--muted); font-size: .92rem; font-style: italic; margin: 0 0 .35rem; }
.links { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 .6rem; padding: 0; list-style: none; }
.links a {
  font-size: .85rem; font-weight: 600; padding: .2rem .65rem; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent);
}
.links a:hover { background: var(--accent); color: var(--on-accent); text-decoration: none; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.tag { font-size: .78rem; background: var(--surface); color: var(--muted); padding: .1rem .55rem; border-radius: 4px; }
@media (max-width: 680px) { .project { grid-template-columns: 1fr; gap: 1rem; } }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; margin-top: .8rem; }
.gallery figure { margin: 0; }
.gallery img, .gallery video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.gallery figcaption { font-size: .82rem; color: var(--muted); margin-top: .3rem; }

/* ---------- Publications ---------- */
.pubs { list-style: none; padding: 0; margin: 0; }
.pub { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.pub .title { font-weight: 600; }
.pub .authors { margin: .15rem 0; }
.pub .authors .me { font-weight: 700; text-decoration: underline; }
.pub .venue { color: var(--muted); font-style: italic; }

/* ---------- Awards / simple dated lists ---------- */
.dated { list-style: none; padding: 0; margin: 0; }
.dated li { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--border); }
.dated li:last-child { border-bottom: 0; }
.dated .date { color: var(--muted); font-size: .92rem; }
@media (max-width: 560px) { .dated li { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Blog ---------- */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-card { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); }
.post-card .date { color: var(--muted); font-size: .9rem; }
article.post { max-width: 720px; }
article.post img { border-radius: var(--radius); margin: 1rem 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.3rem; }
.card h3 { margin-bottom: .3rem; }
.card p { margin: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0; color: var(--muted); font-size: .88rem; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* placeholder hint (remove once real content is in) */
.todo { background: #fff6d6; color: #6b5300; font-size: .78rem; padding: .05rem .4rem; border-radius: 4px; font-weight: 600; }
html[data-theme="dark"] .todo { background: #3b3214; color: #f1d98a; }

/* ---------- Experience: section title left, entries right ---------- */
.xp-section { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; margin-top: 3.25rem; }
.xp-section h2.xp-label { margin: 0; padding: 0; border: 0; font-size: 1.45rem; align-self: start; }
.xp-label::after { content: ""; display: block; width: 28px; height: 2px; margin-top: .6rem; background: var(--accent); }
.xp-list { min-width: 0; }
.xp-item { padding-bottom: 1.15rem; margin-bottom: 1.15rem; border-bottom: 1px solid var(--border); }
.xp-item:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.xp-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .25rem 1rem; }
.xp-head h3 { margin: 0; font-size: 1.08rem; }
.xp-date { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.xp-org { margin: .2rem 0 0; }
.xp-org a { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .65rem 0 0; }
.chips span { font-size: .82rem; padding: .2rem .7rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.chips.highlight span { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.skill-rows { display: grid; grid-template-columns: 120px 1fr; gap: .7rem 1rem; margin: 0; align-items: start; }
.skill-rows dt { color: var(--muted); font-size: .9rem; padding-top: .3rem; }
.skill-rows dd, .skill-rows dd.chips { margin: 0; }
@media (max-width: 760px) {
  .xp-section { grid-template-columns: 1fr; gap: 1rem; margin-top: 2.5rem; }
  .skill-rows { grid-template-columns: 1fr; gap: .25rem; }
  .skill-rows dt { padding-top: .6rem; }
}

/* Galleries of certificates/screenshots: show the whole image, click to open full size */
.dated .gallery { margin-top: .7rem; }
.gallery.fit img { object-fit: contain; background: var(--surface); }
.gallery a { display: block; }
.gallery a:hover img { border-color: var(--accent); }
@media (max-width: 560px) { .dated .gallery { grid-template-columns: repeat(2, 1fr); gap: .5rem; } .dated .gallery figcaption { font-size: .75rem; } }

/* ---------- Gallery page: grid of albums, each a slideshow ---------- */
.album-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 1.5rem; margin-top: 2rem; }
.album { scroll-margin-top: 5rem; min-width: 0; }
@media (max-width: 900px) { .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .album-grid { grid-template-columns: 1fr; } }
/* ---------- Slideshow (one photo at a time) ---------- */
.slideshow { outline: none; }
.slideshow:focus-visible .slides { outline: 2px solid var(--accent); outline-offset: 2px; }
.slideshow .slides { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; background: var(--surface); touch-action: pan-y; }
.slideshow .slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .4s ease; pointer-events: none; }
.slideshow .slide.active { opacity: 1; pointer-events: auto; }
.slideshow .slide a { display: block; height: 100%; }
.slideshow .slide img, .slideshow .slide video { display: block; width: 100%; height: 100%; object-fit: cover; }
.slideshow.fit .slide img { object-fit: contain; }
.slideshow .slide figcaption { display: none; }
.slideshow .slide-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.slideshow .slide-btn:hover { background: rgba(0, 0, 0, .7); }
.slideshow .slide-btn.prev { left: .5rem; }
.slideshow .slide-btn.next { right: .5rem; }
.slideshow .slide-caption { font-size: .85rem; color: var(--muted); margin: .45rem 0 0; min-height: 1.2em; }
.slideshow .slide-dots { display: flex; justify-content: center; gap: .45rem; margin-top: .45rem; }
.slideshow .slide-dots button { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: 0; background: var(--border); cursor: pointer; }
.slideshow .slide-dots button[aria-current="true"] { background: var(--accent); }

.photos-link { font-size: .9rem; white-space: nowrap; }
.dated li { scroll-margin-top: 5rem; }

/* Gallery cards: thin caption bar over the bottom of each slideshow frame */
.album { --bar-h: 40px; }
.album .slideshow { position: relative; }
.album .album-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: var(--bar-h);
  display: flex; align-items: center; gap: .6rem; padding: 0 .8rem; color: #fff; pointer-events: none;
  background: rgba(0, 0, 0, .42); }
/* certificates/screenshots: whole image sits above the bar, on a blurred copy of itself (same look as GTA) */
.album .slideshow.fit .slides { background: #1b1f26; }
.album .slideshow.fit .slide-bg { position: absolute; inset: -20px; background-position: center; background-size: cover; background-repeat: no-repeat;
  filter: blur(18px) brightness(.75); }
.album .slideshow.fit .slide a { position: relative; height: calc(100% - var(--bar-h)); }
.album .album-bar h2 { margin: 0; padding: 0; border: 0; color: #fff; font-size: .95rem; font-weight: 600; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.album .album-date { flex: none; margin-left: auto; font-size: .78rem; color: rgba(255, 255, 255, .8); white-space: nowrap; }

.album .slide-btn { top: calc(50% - var(--bar-h) / 2); }
.card .socials { justify-content: flex-start; }
