@import url("tokens.css");

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

a:hover {
  background: var(--accent);
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

.placeholder-stripe {
  background: repeating-linear-gradient(135deg, var(--plate-a) 0 6px, var(--plate-b) 6px 12px);
}

/* ---------- layout ---------- */

.page {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  min-height: 100vh;
}

.sidebar {
  width: 32%;
  max-width: 440px;
  flex: none;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--hairline-strong);
  padding: 40px 40px 34px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.main {
  flex: 1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 40px 48px 120px;
}

/* ---------- sidebar identity ---------- */

.identity-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.identity-block h1 {
  margin: 0;
  font-weight: 700;
  font-size: 68px;
  line-height: 0.9;
  letter-spacing: -0.055em;
}

.identity-block .role {
  font-size: 17px;
  letter-spacing: -0.015em;
}

.tagline {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 700;
  max-width: 360px;
}

.bio {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
}

.bio-toggle {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink);
  padding: 0 0 2px;
  margin: 0;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  width: fit-content;
}

.bio-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.bio-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  line-height: 1.55;
}

.bio-text[hidden] {
  display: none;
}

.bio-text p {
  margin: 0;
}

.contact-block {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  padding-top: 12px;
}

.contact-block a {
  width: fit-content;
  border-bottom-color: var(--link-muted);
}

.contact-block span {
  color: var(--muted);
}

.contact-block .cv-note {
  margin-top: 6px;
}

/* ---------- works header + filters ---------- */

.works-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}

.works-label {
  margin: 0 0 0 -4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent);
  padding: 2px 4px;
}

.works-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 18px 0 24px;
}

.chip {
  appearance: none;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 7px 10px;
  cursor: pointer;
  white-space: nowrap;
  background: transparent;
  transition: background 120ms linear;
}

.chip.active {
  background: var(--accent);
}

.chip-count {
  opacity: 0.55;
}

/* ---------- card grid ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px 22px;
}

.project-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--ink);
  outline: none;
}

.project-card:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.card-image-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  background: repeating-linear-gradient(135deg, var(--plate-a) 0 6px, var(--plate-b) 6px 12px);
  outline: 0px solid transparent;
  transition: outline-color 120ms linear;
}

.project-card:hover .card-image-wrap,
.project-card:focus-visible .card-image-wrap {
  outline: 3px solid var(--accent);
}

.card-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 500ms cubic-bezier(.2, .7, .2, 1);
}

.project-card:hover .card-image,
.project-card:focus-visible .card-image {
  transform: scale(1.045);
}

.card-tag {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 92%;
  background: var(--accent);
  border-top: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  padding: 8px 12px 9px 10px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
  text-wrap: balance;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.card-title span {
  padding: 0 3px;
  margin-left: -3px;
  transition: background 120ms linear;
}

.project-card:hover .card-title span,
.project-card:focus-visible .card-title span {
  background: var(--accent);
}

.card-tags {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.5;
}

.card-hidden {
  display: none !important;
}

/* ---------- NDA note ---------- */

.nda-note {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nda-note p {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  max-width: 620px;
}

.nda-note a {
  width: fit-content;
  font-size: 15px;
}

/* ---------- mobile footer (hidden on desktop) ---------- */

.mobile-footer {
  display: none;
}

/* ---------- project panel ---------- */

.project-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  visibility: hidden;
  pointer-events: none;
}

.project-panel.open {
  visibility: visible;
  pointer-events: auto;
}

.panel-backdrop {
  position: absolute;
  inset: 0;
  background: var(--panel-backdrop);
  opacity: 0;
  transition: opacity 200ms ease-out;
}

.project-panel.open .panel-backdrop {
  opacity: 1;
}

.panel-sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(760px, 62vw);
  max-width: 100%;
  background: var(--page-bg);
  border-left: 1px solid var(--ink);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  outline: none;
  opacity: 0;
  transform: translateX(32px);
  transition: transform 220ms cubic-bezier(.2, .7, .2, 1), opacity 220ms cubic-bezier(.2, .7, .2, 1);
}

.project-panel.open .panel-sheet {
  opacity: 1;
  transform: translateX(0);
}

.panel-topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--page-bg);
  border-bottom: 1px solid var(--ink);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
}

.panel-counter {
  padding: 14px 32px;
  display: flex;
  align-items: center;
}

.panel-topbar-actions {
  display: flex;
}

.panel-nav-btn {
  appearance: none;
  background: transparent;
  border: none;
  border-left: 1px solid var(--ink);
  padding: 14px 18px;
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 120ms linear;
}

.panel-nav-btn:hover {
  background: var(--accent);
}

.panel-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.panel-close {
  appearance: none;
  background: transparent;
  border: none;
  border-left: 1px solid var(--ink);
  padding: 14px 20px;
  margin: 0;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 15px;
  cursor: pointer;
  transition: background 120ms linear;
}

.panel-close:hover {
  background: var(--accent);
}

.panel-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: oklch(0.14 0 0);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  flex: none;
}

.panel-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px 32px 0;
  overflow-x: auto;
}

.panel-thumbs:empty {
  display: none;
}

.panel-thumb {
  appearance: none;
  padding: 0;
  margin: 0;
  border: none;
  background-color: var(--plate-b);
  background-size: cover;
  background-position: center;
  position: relative;
  width: 84px;
  aspect-ratio: 3 / 2;
  flex: none;
  overflow: hidden;
  cursor: pointer;
  outline: 1px solid var(--hairline-light);
  outline-offset: 0;
}

.panel-thumb.active {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.panel-info {
  padding: 24px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.panel-client {
  margin: 0;
  background: var(--accent);
  border: 1px solid var(--ink);
  padding: 8px 12px 9px 10px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.panel-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.panel-yearrole {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.panel-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.panel-tags:empty {
  display: none;
}

.panel-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 3px 7px;
  white-space: nowrap;
}

.panel-summary {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  max-width: 600px;
}

.panel-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-links:empty {
  display: none;
}

.panel-links-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 2px;
}

.panel-links a {
  width: fit-content;
  font-size: 14px;
}

.panel-nextproject {
  appearance: none;
  background: transparent;
  border: none;
  border-top: 1px solid var(--ink);
  margin: 14px 0 0;
  padding: 16px 0 0;
  color: inherit;
  font: inherit;
  text-align: left;
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
}

.nextproject-thumb {
  width: 96px;
  aspect-ratio: 3 / 2;
  flex: none;
  overflow: hidden;
  background-color: var(--plate-b);
  background-size: cover;
  background-position: center;
}

.nextproject-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.nextproject-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nextproject-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.nextproject-title span {
  background: var(--accent);
  padding: 0 3px;
  margin-left: -3px;
}

/* ---------- mobile cta ---------- */

.mobile-cta {
  display: none;
}

/* ---------- breakpoints ---------- */

@media (min-width: 1500px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 759px) {
  .page {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-width: none;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--hairline-strong);
    padding: 32px 28px 26px;
    gap: 16px;
  }

  .sidebar .bio--desktop,
  .sidebar .contact-block--desktop {
    display: none;
  }

  .identity-block h1 {
    font-size: 60px;
  }

  .tagline {
    font-size: 19px;
  }

  .main {
    padding: 28px 28px 96px;
  }

  .card-tag {
    font-size: 26px;
  }

  .card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-footer {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 40px;
    padding-top: 22px;
    border-top: 1px solid var(--ink);
  }

  .panel-counter {
    padding: 14px 20px;
  }

  .panel-thumbs {
    padding: 10px 20px 0;
  }

  .panel-info {
    padding: 24px 20px 40px;
  }

  .panel-client {
    font-size: 30px;
  }

  .panel-sheet {
    width: 100%;
    transform: translateY(32px);
    transition: transform 240ms cubic-bezier(.2, .7, .2, 1), opacity 240ms cubic-bezier(.2, .7, .2, 1);
  }

  .project-panel.open .panel-sheet {
    transform: translateY(0);
  }

  .mobile-cta {
    display: flex;
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 90;
    background: var(--accent);
    border: 1px solid var(--ink);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    gap: 10px;
    align-items: center;
    transition: background 120ms linear, color 120ms linear;
  }

  .mobile-cta span {
    font-family: var(--font-mono);
    font-weight: 400;
  }

  .mobile-cta:hover {
    background: var(--ink);
    color: var(--page-bg);
  }
}

@media (min-width: 561px) and (max-width: 759px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 459px) {
  .sidebar {
    padding: 26px 20px 22px;
  }

  .identity-block h1 {
    font-size: 52px;
  }

  .main {
    padding: 24px 20px 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel-backdrop,
  .panel-sheet,
  .card-image,
  .card-image-wrap,
  .card-title span,
  .chip,
  .panel-nav-btn,
  .panel-close {
    transition: none !important;
  }
}
