/* =============================================================
   RASMUS PERSSON — Portfolio
   Font: Helvetica Neue (systemfont)
============================================================= */

/* ----- RESET ----------------------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ----- TOKENS ---------------------------------------------- */

:root {
  --ink:    #0d0d0d;
  --white:  #ffffff;
  --ink-55: rgba(13,13,13,0.55);
  --ink-30: rgba(13,13,13,0.30);
  --ink-10: rgba(13,13,13,0.10);

  --font:   'Helvetica Neue', Helvetica, Arial, sans-serif;
  --accent: #E3001B;

  --sidebar-w:  220px;
  --mob-head-h: 56px;
}

/* ----- BASE ------------------------------------------------ */

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a  { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ----- LEFT SIDEBAR ---------------------------------------- */

.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  border-right: 1px solid var(--ink-10);
  background: var(--white);
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  gap: 28px;
  z-index: 50;
}

.sidebar-top { flex-shrink: 0; }

.sidebar-name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Nav links */

.sidebar-nav { flex-shrink: 0; }

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
}

.nav-link {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--ink-30);
  padding: 3px 0;
  text-align: left;
  transition: color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
}

/* Contact links in sidebar */

.sidebar-contact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.sidebar-contact a {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-30);
  transition: color 0.15s ease;
  line-height: 1.5;
}

.sidebar-contact a:hover {
  color: var(--ink);
}

/* Push meta to bottom */

.sidebar-bottom { margin-top: auto; }

.sidebar-meta {
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--ink-30);
  line-height: 1.5;
}

/* ----- MAIN CONTENT ---------------------------------------- */

.main-content {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  overflow-y: auto;
}

/* ----- PAGE SWITCHING -------------------------------------- */

.page        { display: none; }
.page.active { display: block; }

/* ----- ABOUT PAGE ------------------------------------------ */

.about-inner {
  padding: clamp(48px, 6vw, 80px) clamp(40px, 5vw, 72px);
  max-width: 800px;
}

/* Display heading */

.about-display {
  font-size: clamp(2.8rem, 6vw, 6.5rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 56px;
}

.accent { color: var(--accent); }

/* Bio */

.about-bio {
  margin-bottom: 48px;
}

.about-bio .lead {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.7;
  margin-bottom: 18px;
}

.about-bio p:not(.lead) {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.75;
  margin-bottom: 18px;
}

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

/* Rule between bio and merits */

.about-rule {
  width: 100%;
  height: 1px;
  background: var(--ink-10);
  margin-bottom: 48px;
}

/* Merit categories */

.about-merits {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-bottom: 80px;
}

.merit-cat-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(13,13,13,0.18);
}

.merit-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ink-10);
  align-items: baseline;
}

.merit-year {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-30);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.merit-desc {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.5;
}

/* ----- WORK PAGE ------------------------------------------- */

.work-inner {
  padding: clamp(48px, 6vw, 80px) clamp(40px, 5vw, 64px);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 24px;
}

.work-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.work-card-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  background-size: cover;
  background-position: center;
  background-color: var(--ink-10);
  transition: opacity 0.3s ease;
}

.work-card:hover .work-card-img {
  opacity: 0.75;
}

.work-card-body {
  padding: 13px 0 0;
}

.work-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  transition: opacity 0.2s ease;
  padding-top: 12px;
}

.work-card:hover .work-card-title {
  opacity: 0.45;
}

/* ----- MOBILE HEADER --------------------------------------- */

.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--mob-head-h);
  background: var(--white);
  border-bottom: 1px solid var(--ink-10);
  align-items: center;
  justify-content: space-between;
  padding-inline: 24px;
  z-index: 100;
}

.mobile-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.22s ease;
  transform-origin: center;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* ----- MOBILE NAV OVERLAY ---------------------------------- */

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--mob-head-h);
  left: 0; right: 0; bottom: 0;
  background: var(--white);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
  z-index: 99;
}

.mobile-nav.open { display: flex; }

.mobile-nav .nav-link {
  font-size: 1.05rem;
  color: var(--ink-30);
  padding: 6px 0;
}

.mobile-nav .nav-link.active { color: var(--ink); }

.mobile-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--ink-10);
  width: 200px;
}

.mobile-contact a {
  font-size: 0.8rem;
  color: var(--ink-55);
  transition: color 0.18s ease;
}

.mobile-contact a:hover { color: var(--ink); }

/* =============================================================
   RESPONSIVE
============================================================= */

@media (max-width: 960px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .mobile-header { display: flex; }
  .sidebar       { display: none; }

  .main-content {
    left: 0;
    top: var(--mob-head-h);
  }

  .about-inner {
    padding: 32px 20px 56px;
    max-width: 100%;
  }

  .work-inner {
    padding: 32px 20px 48px;
  }

  .work-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ----- Focus ------------------------------------------ */
*:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}
