/* Portfolio styles. Colours and fonts are set here. */
:root {
  --ink: #0f1b2d;
  --ink-2: #1d3557;
  --text: #1f2733;
  --muted: #5f6b7a;
  --line: #e3e7ed;
  --bg: #f5f6f8;
  --card: #ffffff;
  --accent: #e08a52;          /* copper, from the renders */
  --accent-2: #f2b48a;
  --pro: #e08a52;
  --uni: #5b8def;
  --personal: #3bb08f;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15,27,45,.06), 0 8px 24px rgba(15,27,45,.06);
  --shadow-lg: 0 2px 4px rgba(15,27,45,.08), 0 24px 48px rgba(15,27,45,.14);
  --head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font: 400 17px/1.65 var(--body); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 .5em; color: var(--ink); }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
p { margin: 0 0 1em; }
.wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: #fff; padding: 8px 14px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Buttons and labels */
.btn { display: inline-flex; align-items: center; gap: .5em; padding: .85em 1.4em; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; transition: transform .15s, background .15s, box-shadow .15s; box-shadow: 0 6px 18px rgba(224,138,82,.35); }
.btn:hover { background: #cf7740; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn--ghost:hover { background: rgba(255,255,255,.08); }
.btn--small { padding: .5em 1.1em; font-size: .92rem; box-shadow: none; }
.eyebrow { font: 600 .8rem/1.4 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 1.2em; }
.eyebrow--dark { color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .55em; vertical-align: middle; position: relative; top: -1px; }
.dot--professional { background: var(--pro); }
.dot--university { background: var(--uni); }
.dot--personal { background: var(--personal); }
.tags { list-style: none; padding: 0; margin: 1.2em 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: .82rem; font-weight: 500; padding: .35em .85em; border-radius: 999px; background: #eef1f5; color: var(--ink-2); }
.tags--lg li { font-size: .92rem; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }

/* Nav */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; background: rgba(255,255,255,.9); backdrop-filter: blur(12px); color: var(--ink); transition: box-shadow .25s; }
.nav.is-solid { box-shadow: 0 1px 0 var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav__brand { display: flex; align-items: center; gap: .7em; font: 600 1.05rem var(--head); text-decoration: none; }
.mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; font-size: .9rem; letter-spacing: .02em; }
.nav ul { list-style: none; display: flex; gap: 28px; align-items: center; margin: 0; padding: 0; }
.nav a { text-decoration: none; font-weight: 500; font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--accent); }

/* Intro */
.intro { padding: 150px 0 8px; }
.intro h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin-bottom: .2em; }
.intro__role { font-weight: 600; color: var(--accent); font-size: 1rem; letter-spacing: .02em; margin-bottom: 1.2em; }
.intro__body { font-size: 1.15rem; max-width: 62ch; color: var(--text); }

/* Work */
.work { padding: 56px 0 90px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.section-head h2 { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 .92rem var(--body); border: 0; cursor: pointer; padding: .6em 1.15em; border-radius: 999px; background: var(--card); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); transition: all .15s; }
.chip:hover { box-shadow: inset 0 0 0 1px var(--ink-2); }
.chip.is-active { background: var(--ink); color: #fff; box-shadow: none; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .25s, box-shadow .25s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card.is-hidden { display: none; }
.card__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; background: #e9ecf1; }
.card__media { position: relative; }
.card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: transform .5s; }
.card:hover .card__media img { transform: scale(1.02); }
.card__body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.card__context { font-size: .82rem; font-weight: 500; color: var(--muted); margin-bottom: .6em; }
.card__title { font-size: 1.35rem; margin-bottom: .35em; }
.card__summary { color: var(--muted); font-size: .96rem; flex: 1; }
.card__more { font-weight: 600; font-size: .92rem; color: var(--accent); }
.card--featured:nth-child(-n+2) { grid-column: span 1; }
@media (min-width: 1000px) {
  .grid .card--featured:first-child { grid-column: span 2; grid-row: span 2; }
  .grid .card--featured:first-child .card__media { aspect-ratio: auto; flex: 1; min-height: 380px; }
  .grid .card--featured:first-child .card__title { font-size: 1.8rem; }
  .grid .card--featured:first-child .card__body { flex: 0; }
}

/* About */
.about { padding: 100px 0; background: var(--card); border-block: 1px solid var(--line); }
.about__grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 80px; }
.about p { font-size: 1.08rem; max-width: 60ch; }
.minor { font: 600 .8rem var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 2.4em 0 1em; }
.minor--first { margin-top: .6em; }
.skills { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.skills li { padding-left: 1.4em; position: relative; }
.skills li::before { content: ""; position: absolute; left: 0; top: .62em; width: 10px; height: 2px; background: var(--accent); }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 30px 28px; display: flex; flex-direction: column; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); }
.timeline li:first-child::before { background: var(--accent); }
.tl__dates { font-size: .82rem; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.timeline strong { font-family: var(--head); font-size: 1.1rem; color: var(--ink); line-height: 1.3; margin: .2em 0; }
.timeline span:last-child { color: var(--muted); }

.footer { background: var(--ink); color: #6f7d90; font-size: .88rem; padding: 32px 0; text-align: center; }

/* Project detail (no-JS: shown inline below the grid; JS: shown in a dialog) */
.projects { padding-bottom: 60px; }
.js .projects { display: none; }
.project { padding: 48px 0; border-top: 1px solid var(--line); }
.project__context { font-size: .85rem; font-weight: 500; color: var(--muted); }
.project h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.project__header { max-width: 70ch; margin-bottom: 32px; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.gallery figure { margin: 0; background: var(--card); display: flex; flex-direction: column; justify-content: space-between; border-radius: 14px; overflow: hidden; cursor: zoom-in; }
.gallery figure:first-child { grid-column: 1 / -1; }
.gallery .frame { flex: 1; display: grid; place-items: center; }
.gallery img { width: auto; max-width: 100%; max-height: 70vh; }
.gallery figcaption { font-size: .85rem; color: var(--muted); padding: 10px 14px; background: var(--card); align-self: stretch; }

.modal { width: min(1080px, 100% - 32px); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 24px; box-shadow: var(--shadow-lg); background: var(--bg); color: var(--text); }
.modal::backdrop { background: rgba(10,18,30,.72); backdrop-filter: blur(4px); }
.modal[open] { animation: rise .28s ease-out; }
.modal__content .project { border: 0; padding: 48px clamp(20px, 5vw, 56px); }
.modal__close, .lightbox__close { position: sticky; top: 16px; float: right; margin: 16px 16px 0 0; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(10,18,30,.94); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: calc(100vh - 48px); width: auto; border-radius: 12px; background: #fff; }
.lightbox__close { position: fixed; top: 16px; right: 16px; margin: 0; background: #fff; color: var(--ink); }
body.no-scroll { overflow: hidden; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .about__grid { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .nav ul li:not(:last-child) { display: none; }
  .nav__brand span:last-child { display: none; }
  .intro { padding-top: 110px; }
  .intro__body { font-size: 1.05rem; }
  .grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .skills { grid-template-columns: 1fr; }
  .work, .about { padding: 72px 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
