/* ============================================================
   Caspian Copeland — portfolio
   Minimal, editorial, marketplace-inspired. Light + monochrome.
   ============================================================ */

:root {
  --bg: #ffffff;
  --panel: #f5f4f1;
  --panel-2: #ecebe7;
  --text: #131313;
  --muted: #6a6a6a;
  --faint: #9b9b9b;
  --border: #e6e5e1;
  --line: #131313;
  --radius: 3px;
  --maxw: 1120px;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --track: 0.14em; /* uppercase letter-spacing */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- Icons (self-contained SVG masks) ---------- */
.ic {
  display: inline-block; width: 1.05em; height: 1.05em;
  background: currentColor; vertical-align: -0.15em;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.ic-github { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .5A11.5 11.5 0 0 0 .5 12a11.5 11.5 0 0 0 7.86 10.92c.58.1.79-.25.79-.55v-2c-3.2.7-3.88-1.37-3.88-1.37-.53-1.34-1.3-1.7-1.3-1.7-1.06-.72.08-.71.08-.71 1.17.08 1.79 1.2 1.79 1.2 1.04 1.79 2.73 1.27 3.4.97.1-.75.4-1.27.73-1.56-2.56-.29-5.26-1.28-5.26-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.18a11 11 0 0 1 5.8 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.59.23 2.76.11 3.05.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.28 5.69.41.36.78 1.06.78 2.14v3.17c0 .31.21.66.8.55A11.5 11.5 0 0 0 23.5 12 11.5 11.5 0 0 0 12 .5Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .5A11.5 11.5 0 0 0 .5 12a11.5 11.5 0 0 0 7.86 10.92c.58.1.79-.25.79-.55v-2c-3.2.7-3.88-1.37-3.88-1.37-.53-1.34-1.3-1.7-1.3-1.7-1.06-.72.08-.71.08-.71 1.17.08 1.79 1.2 1.79 1.2 1.04 1.79 2.73 1.27 3.4.97.1-.75.4-1.27.73-1.56-2.56-.29-5.26-1.28-5.26-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.18a11 11 0 0 1 5.8 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.59.23 2.76.11 3.05.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.28 5.69.41.36.78 1.06.78 2.14v3.17c0 .31.21.66.8.55A11.5 11.5 0 0 0 23.5 12 11.5 11.5 0 0 0 12 .5Z'/%3E%3C/svg%3E"); }
.ic-linkedin { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.45 20.45h-3.56v-5.57c0-1.33-.02-3.04-1.85-3.04-1.85 0-2.13 1.44-2.13 2.94v5.67H9.35V9h3.42v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28ZM5.34 7.43a2.06 2.06 0 1 1 0-4.13 2.06 2.06 0 0 1 0 4.13ZM7.12 20.45H3.55V9h3.57v11.45ZM22.22 0H1.77C.8 0 0 .78 0 1.75v20.5C0 23.22.8 24 1.77 24h20.45c.98 0 1.78-.78 1.78-1.75V1.75C24 .78 23.2 0 22.22 0Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.45 20.45h-3.56v-5.57c0-1.33-.02-3.04-1.85-3.04-1.85 0-2.13 1.44-2.13 2.94v5.67H9.35V9h3.42v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28ZM5.34 7.43a2.06 2.06 0 1 1 0-4.13 2.06 2.06 0 0 1 0 4.13ZM7.12 20.45H3.55V9h3.57v11.45ZM22.22 0H1.77C.8 0 0 .78 0 1.75v20.5C0 23.22.8 24 1.77 24h20.45c.98 0 1.78-.78 1.78-1.75V1.75C24 .78 23.2 0 22.22 0Z'/%3E%3C/svg%3E"); }
.ic-mail { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 4h20a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm10 7L2.4 5.5A1 1 0 0 0 2 6v.2l10 5.7 10-5.7V6a1 1 0 0 0-.4-.5L12 11Z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 4h20a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm10 7L2.4 5.5A1 1 0 0 0 2 6v.2l10 5.7 10-5.7V6a1 1 0 0 0-.4-.5L12 11Z'/%3E%3C/svg%3E"); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius);
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: var(--track);
  border: 1px solid var(--line); cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn--sm { padding: 9px 16px; font-size: 0.68rem; }
.btn--primary { background: var(--line); color: #fff; }
.btn--primary:hover { background: #000; }
.btn--ghost { background: transparent; color: var(--text); }
.btn--ghost:hover { background: var(--line); color: #fff; }
.nav .btn--sm { border-color: var(--border); }
.nav .btn--sm:hover { background: var(--line); color: #fff; border-color: var(--line); }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .25s ease;
}
.nav.is-scrolled { border-color: var(--border); }
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 18px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav__brand { font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: var(--track); }
.nav__links { display: flex; gap: 26px; }
.nav__links a {
  color: var(--muted); font-size: 0.7rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: var(--track); position: relative;
}
.nav__links a:hover { color: var(--text); }
.nav__actions { display: flex; align-items: center; gap: 12px; }
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__burger span { width: 22px; height: 1.5px; background: var(--text); transition: .25s ease; }
.nav__burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 72px; border-bottom: 1px solid var(--border); }
.hero__inner { display: grid; grid-template-columns: 1.5fr 1fr; align-items: center; gap: 56px; }
.hero__eyebrow {
  margin: 0 0 20px; color: var(--muted);
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.22em;
}
.hero__name { font-size: clamp(2.6rem, 6.5vw, 4.6rem); line-height: 1.02; margin: 0; letter-spacing: -0.02em; font-weight: 700; }
.hero__pitch { margin: 26px 0 30px; max-width: 48ch; color: var(--muted); font-size: 1.05rem; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__socials { display: flex; gap: 8px; margin-top: 34px; }
.social {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted);
  font-size: 1.05rem; transition: .2s ease;
}
.social:hover { color: var(--text); border-color: var(--line); }

.hero__portrait { display: flex; justify-content: center; }
.portrait-frame { width: 300px; max-width: 100%; }
.portrait-frame img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
}

/* ---------- Sections ---------- */
.section { padding: 72px 0; border-bottom: 1px solid var(--border); }
.section__head { margin-bottom: 44px; }
.section__title {
  font-size: 0.78rem; margin: 0; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.22em;
}

/* ---------- About ---------- */
.about { max-width: 760px; }
.about p { color: #333; margin: 0 0 20px; font-size: 1.16rem; line-height: 1.75; }
.about p:last-child { margin-bottom: 0; }

/* ---------- Work list (experience + education) ---------- */
.worklist { display: flex; flex-direction: column; }
.work {
  display: grid; grid-template-columns: 220px 1fr; gap: 28px;
  padding: 30px 0; border-top: 1px solid var(--border);
}
.work:first-child { border-top: 0; padding-top: 0; }
.work__meta { display: flex; flex-direction: column; gap: 6px; }
.work__date { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: var(--track); color: var(--text); }
.work__org { font-size: 0.82rem; color: var(--faint); }
.work__role { margin: 0; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; }
.work__sub { margin: 3px 0 0; color: var(--muted); font-size: 0.92rem; }
.work__body ul { margin: 16px 0 0; padding-left: 18px; color: #444; }
.work__body li { margin-bottom: 9px; font-size: 0.98rem; }
.work__body li::marker { color: var(--faint); }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.tag {
  font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
  background: transparent; border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 999px;
}

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.pcard {
  grid-column: span 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: border-color .2s ease, transform .2s ease;
}
.pcard--wide { grid-column: span 2; }
.pcard:hover { border-color: var(--line); transform: translateY(-3px); }
.pcard:focus-visible { outline: 1px solid var(--line); outline-offset: 3px; }
.pcard__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--panel); }
.pcard--wide .pcard__media { aspect-ratio: 24 / 9; }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.pcard:hover .pcard__media img { transform: scale(1.04); }
.pcard__media--logo { display: grid; place-items: center; background: #fff; }
.pcard__media--logo img { width: auto; height: 55%; object-fit: contain; }
.pcard__media--plain {
  display: grid; place-items: center; background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.pcard__mark {
  text-align: center; text-transform: uppercase; letter-spacing: 0.18em;
  font-weight: 700; font-size: 1.15rem; line-height: 1.5; color: var(--text);
}
.pcard__body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.pcard__title { margin: 0 0 8px; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.pcard__desc { margin: 0; color: var(--muted); font-size: 0.95rem; flex: 1; }
.pcard .tags { margin-top: 18px; }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--border); }
.skillgroup { padding: 28px 28px 28px 0; border-right: 1px solid var(--border); }
.skillgroup:last-child { border-right: 0; padding-right: 0; }
.skillgroup:not(:first-child) { padding-left: 28px; }
.skillgroup h3 {
  margin: 0 0 16px; font-size: 0.72rem; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: 0.16em;
}
.skillgroup .tags { margin-top: 0; }

/* ---------- Contact ---------- */
.section--contact { border-bottom: 0; padding-bottom: 96px; }
.contact__lead { max-width: 560px; color: var(--muted); font-size: 1.12rem; margin: 0 0 34px; }
.contact__links { display: flex; flex-direction: column; }
.clink {
  display: flex; align-items: center; gap: 16px; max-width: 520px;
  padding: 20px 0; border-top: 1px solid var(--border); color: var(--text);
  font-size: 1rem; transition: padding-left .2s ease, color .2s ease;
}
.clink:last-child { border-bottom: 1px solid var(--border); }
.clink i { color: var(--text); font-size: 1.15rem; }
.clink:hover { padding-left: 8px; color: #000; }

/* ---------- Footer ---------- */
.footer { padding: 28px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; color: var(--faint); font-size: 0.72rem; text-transform: uppercase; letter-spacing: var(--track); }
.footer__top:hover { color: var(--text); }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.is-open { display: block; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(19, 19, 19, 0.42); backdrop-filter: blur(2px); }
.modal__card {
  position: relative; z-index: 1; max-width: 720px; width: calc(100% - 40px);
  max-height: 88vh; overflow-y: auto; margin: 6vh auto 0;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 38px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.35);
  animation: pop .22s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal__close {
  position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: var(--radius);
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  font-size: 1.3rem; line-height: 1; cursor: pointer; transition: .2s ease;
}
.modal__close:hover { color: var(--text); border-color: var(--line); }
.modal__title { margin: 0 40px 4px 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
.modal__meta { margin: 0 0 20px; color: var(--faint); font-size: 0.72rem; text-transform: uppercase; letter-spacing: var(--track); }
.modal__card p { color: #444; }
.modal__card ul { color: #444; padding-left: 20px; }
.modal__card li { margin-bottom: 8px; }
.modal__card li::marker { color: var(--faint); }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 0 0 22px; }
.gallery img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.gallery--logo { grid-template-columns: 1fr; }
.gallery--logo img { background: #fff; padding: 24px; max-width: 240px; margin: 0 auto; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: 52px 0 48px; }
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .hero__portrait { order: -1; justify-content: flex-start; }
  .portrait-frame { width: 220px; }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav__links.is-open { max-height: 360px; }
  .nav__links a { padding: 15px 28px; border-top: 1px solid var(--border); }
  .nav__burger { display: flex; }
  .projects { grid-template-columns: 1fr; }
  .pcard--wide { grid-column: span 1; }
  .pcard--wide .pcard__media { aspect-ratio: 16 / 10; }
  .work { grid-template-columns: 1fr; gap: 12px; }
  .work__meta { flex-direction: row; align-items: baseline; gap: 14px; }
  .skills { grid-template-columns: 1fr; }
  .skillgroup { border-right: 0; border-bottom: 1px solid var(--border); padding: 24px 0; }
  .skillgroup:not(:first-child) { padding-left: 0; }
  .skillgroup:last-child { border-bottom: 0; }
  .section { padding: 56px 0; }
}
@media (max-width: 460px) {
  .modal__card { padding: 26px 22px; }
}
