:root {
  --bg: #15161a;
  --card: #24262b;
  --accent: #b34a4a;
  --text: #e8e6e3;
  --header-text: #ffffff;
  --page-bg: #0b0b0d;
  --content-max: 680px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Inter, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.6;
  text-align: left;
}

/* default link color */
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover, a:focus-visible {
  text-decoration: underline;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px;
}

main.container {
  background: var(--bg);
  position: relative;
  z-index: 1;
}

h1 {
  margin-block-start: 0.4em;
  margin-block-end: 0.6em;
  line-height: 1.1;
}

h1, h2 {
  color: var(--accent)
}

/* bg removed: no background graphic overlay */

/* header */

.site-header {
  background: var(--accent);
  padding: 0;
  color: var(--header-text);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px; /* tighter header height */
}

.logo {
  font-weight: 700;
  color: var(--header-text);
  text-decoration: none;
}

.nav a {
  margin-left: 18px;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
}

/* index / profile */

.profile {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  padding: 28px 0;
  text-align: center;
}

.profile .portrait {
  width: 40%;
  margin-bottom: 12px;
  aspect-ratio: 1/1;
  object-fit: cover;
  height: auto;
  display: block;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.profile .introduction {
  margin-top: 0px;
  margin-bottom: 12px;
}

/* about */

.about .bio p {
  margin-block-end: 1em;
}

.about .bio p:last-child {
  margin-block-end: 0;
}

.about .hiking-figure {
  text-align: center;
  margin-top: 32px;
  padding-top: 20px;
  font-style: italic;
  color: #555;
}

/* about separators */
.about .skills {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 18px;
  padding-top: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 20px;
}

/* portfolio */

.portfolio .projects {
  display: flex;
  flex-direction: column;
  margin-top: 40px;
  gap: 56px;
}

.portfolio .project-card {
  width: 100%;
  margin-bottom: 0;
  background: var(--card);
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

/* subtle top accent bar */
.portfolio .project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 1;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.portfolio .project-card:last-child {
  margin-bottom: 0;
}

.portfolio .project-external-link {
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin-top: 13px;
}

/* tighten project title spacing */
.portfolio .project-card .project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding-bottom: 10px;
  margin: 0 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.portfolio .project-card .project-head h2 {
  margin: 0;
  line-height: 1.2;
}
.portfolio .project-card .project-head .project-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0;
}
.portfolio .project-card .project-external-link {
  margin: 0;
  font-size: 0.92rem;
}
.portfolio .project-card p {
  margin-top: 0.55em;
}

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--header-text);
  border-radius: 8px;
  text-decoration: none;
  border: 0;
  box-shadow: 0 6px 14px rgba(179, 74, 74, 0.12);
}

.btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 10px;
}

.btn .icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
}

/* video embed */

.video-container {
  width: 100%;
  padding-bottom: 56.25%;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* media gallery */

.media-gallery {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 12px;
}
.project-card .media-gallery {
  grid-template-columns: repeat(3, 1fr);
}
.project-card .media-gallery .media-item {
  aspect-ratio: 16/9;
}

@media (max-width: 520px) {
  .project-card .media-gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

.media-gallery .media-item {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16/9;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.media-gallery .media-item iframe,
.media-gallery .media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-gallery .media-item iframe { border: 0; }

@media (max-width: 520px) {
  .media-gallery {
    grid-template-columns: 1fr;
  }
}

/* lightbox (modal) */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox.is-open { display: flex; }

.lightbox-body {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  padding: 4px;
  max-width: 98vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-body img {
  max-width: 100%;
  max-height: calc(92vh - 8px);
  display: block;
}

/* reuse responsive 16:9 wrapper for videos inside lightbox */
.lightbox-body .video-container { width: 98vw; max-width: 1600px; }

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 40px;
  height: 40px;
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: background .18s, box-shadow .18s, transform .18s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.18); }
.lightbox-close:active { background: rgba(255,255,255,0.28); transform: scale(0.94); }
.lightbox-close:focus-visible { box-shadow: 0 0 0 3px rgba(255,255,255,0.35); }