:root {
  --black: #0A0A0A;
  --accent: #43FFA7;
  --dark: #09192B;
  --grey-text: #5C5C5C;
  --grey-panel: #ECECEC;
  --border: #D9D9D9;
  --max-width: 1440px;
  --margin: 44px;
  --gutter: 16px;
  --font-display: "Instrument Sans", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--black);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Header */

.site-header {
  background: var(--dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--margin);
}

.logo {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.logo__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.logo__divider {
  width: 1px;
  height: 34px;
  background: var(--accent);
  opacity: 0.5;
}

.logo__suffix {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--accent);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
}

.main-nav a {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  transition: opacity 0.15s ease;
}

.main-nav a:hover {
  opacity: 0.75;
}

/* Mobile nav toggle */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 0 auto;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle--open .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle--open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle--open .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--dark);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px var(--margin) 24px;
  }

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

  .main-nav a {
    padding: 14px 0;
    font-size: 1.05rem;
  }

  .main-nav .contact-btn {
    background: none;
    border: none;
    border-radius: 0;
    color: #fff !important;
    padding: 14px 0;
    font-size: 1.05rem;
    font-weight: 500;
  }

  .main-nav .contact-btn span {
    display: none;
  }
}

/* Hero */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--margin);
}

.hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  align-items: start;
  padding-top: clamp(32px, 3vw, var(--margin));
  padding-bottom: clamp(36px, 6vw, 56px);
}

.hero h1 {
  grid-column: span 7;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
}

.hero h1 .accent {
  color: inherit;
}

.hero__right {
  grid-column: span 5;
}

.hero-copy {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--black);
  margin: 6px 0 0;
  max-width: 46ch;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  border: 1px solid var(--dark);
  color: var(--black);
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: opacity 0.15s ease;
}

.hero__cta:hover {
  opacity: 0.7;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.divider--dark {
  border-top-color: var(--dark);
}

/* Projects */

.projects {
  padding-top: clamp(28px, 5vw, 44px);
  padding-bottom: clamp(60px, 8vw, 96px);
}

.section-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  color: var(--black);
  margin: 0 0 28px;
}

.projects .section-label {
  font-size: 2rem;
  font-weight: 400;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  row-gap: 40px;
}

.project-card {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
}

.thumb {
  display: block;
  aspect-ratio: 1.4 / 1;
  background: var(--grey-panel);
  margin-bottom: 20px;
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.thumb:hover {
  opacity: 0.92;
}

.thumb--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 4px;
}

.project-detail {
  font-style: normal;
  color: var(--grey-text);
  font-size: 0.95rem;
  margin: 0 0 10px;
}

.view-link {
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  width: fit-content;
}

/* Footer */

footer {
  background: var(--dark);
  color: #fff;
  text-align: center;
  padding: 40px 20px;
  font-size: 1rem;
}

footer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Responsive */

@media (max-width: 900px) {
  :root {
    --margin: 24px;
  }
}

@media (max-width: 720px) {
  .hero {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .hero h1,
  .hero__right {
    grid-column: auto;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    grid-column: auto;
  }
}

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

/* Page hero (About / CV / Contact / Project) */

.page-hero {
  padding-top: clamp(48px, 8vw, 80px);
  padding-bottom: clamp(28px, 5vw, 40px);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.page-hero .hero-copy {
  grid-column: auto;
  max-width: 60ch;
}

.back-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.back-link:hover {
  text-decoration: underline;
}

.download-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* About page */

.about-content {
  padding-top: clamp(28px, 5vw, 44px);
  padding-bottom: clamp(60px, 8vw, 96px);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
}

.about-photo {
  grid-column: span 5;
  aspect-ratio: 4 / 5;
  background: var(--grey-panel);
}

.about-text {
  grid-column: span 7;
}

.about-text p {
  line-height: 1.65;
  color: var(--grey-text);
  max-width: 60ch;
  margin: 0 0 18px;
}

.about-subhead {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  margin: 32px 0 14px;
}

.skills-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
}

.skills-list li {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

/* CV page */

.cv-content {
  padding-top: clamp(28px, 5vw, 44px);
  padding-bottom: clamp(60px, 8vw, 96px);
}

.cv-content .section-label {
  font-size: 2rem;
  font-weight: 400;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.cv-content > .section-label:first-child {
  padding-top: 0;
  border-top: none;
}

.cv-item--about .section-label {
  margin: 0;
}

/* CV hero */

.cv-hero {
  padding-top: clamp(32px, 3vw, var(--margin));
  padding-bottom: clamp(36px, 6vw, 56px);
}

.cv-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}

.cv-hero__download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--dark);
  color: var(--accent);
  padding: 15px 24px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 1rem;
  transition: opacity 0.15s ease;
}

.cv-hero__download:hover {
  opacity: 0.85;
}

/* Skillset tags */

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-tag {
  background: #E7E7E7;
  color: #0E0E0E;
  font-size: 1rem;
  padding: 8px 18px;
}

.section-label--spaced {
  margin-top: 48px;
}

.cv-list {
  display: flex;
  flex-direction: column;
}

.cv-item {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  padding: 24px 0;
}

.cv-item__meta {
  grid-column: span 3;
}

.cv-item__body {
  grid-column: span 9;
}

.cv-item__dates {
  font-size: 0.9rem;
  color: var(--grey-text);
}

.cv-item__body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 4px;
}

.cv-item__body .project-detail {
  margin-bottom: 10px;
}

.cv-item__body .project-detail + p {
  color: var(--grey-text);
  line-height: 1.6;
  max-width: 60ch;
  margin: 0;
}

.cv-item__body p + .cv-bullets {
  margin-top: 12px;
}

.cv-bullets {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
  max-width: 60ch;
}

.cv-bullets li {
  color: var(--grey-text);
  line-height: 1.6;
  margin-bottom: 6px;
}

.cv-bullets li:last-child {
  margin-bottom: 0;
}

/* Contact page */

.contact-content {
  padding-top: clamp(28px, 5vw, 44px);
  padding-bottom: clamp(60px, 8vw, 96px);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
}

.contact-details {
  grid-column: span 5;
}

.contact-form {
  grid-column: span 7;
}

.contact-details p {
  margin: 0 0 10px;
}

.contact-details a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-form {
  display: flex;
  flex-direction: column;
}

.contact-form label {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  margin-top: 18px;
}

.contact-form label:first-child {
  margin-top: 0;
}

.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--black);
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--black);
  outline-offset: 1px;
}

.submit-button {
  margin-top: 24px;
  align-self: flex-start;
  background: var(--black);
  color: #fff;
  border: none;
  padding: 13px 28px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.submit-button:hover {
  opacity: 0.85;
}

/* Project detail page */

.project-detail-content {
  padding-top: clamp(28px, 5vw, 44px);
  padding-bottom: clamp(60px, 8vw, 96px);
}

.project-hero-image {
  background: var(--grey-panel);
  margin-bottom: clamp(32px, 5vw, 48px);
}

.project-hero-image img {
  width: 100%;
  display: block;
}

.project-meta-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  row-gap: 16px;
  padding-bottom: clamp(28px, 5vw, 44px);
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(28px, 5vw, 44px);
}

.project-meta-grid > div {
  grid-column: span 4;
}

.project-meta-grid p {
  margin: 0;
}

.project-body p {
  line-height: 1.65;
  color: var(--grey-text);
  max-width: 68ch;
  margin: 0 0 18px;
}

.project-detail-content .back-link {
  margin-top: 24px;
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .about-grid,
  .contact-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .about-photo,
  .about-text,
  .contact-details,
  .contact-form {
    grid-column: auto;
  }

  .cv-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .cv-item__meta,
  .cv-item__body {
    grid-column: auto;
  }

  .project-meta-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .project-meta-grid > div {
    grid-column: auto;
  }
}

/* Hero carousel removed — brand strip sits directly below hero divider */

.brand-strip {
  padding: clamp(20px, 3vw, 32px) 0;
  margin-top: clamp(8px, 1.5vw, 16px);
}

.brand-strip__label {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--margin);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.375rem;
  color: var(--black);
}

.brand-strip__list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--margin);
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-strip__list.brand-strip__list--dupe {
  display: none;
}

.brand-strip__item {
  display: flex;
  align-items: center;
  opacity: 0.55;
}

.brand-strip__item img {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  filter: grayscale(1);
  display: block;
}

@media (max-width: 720px) {
  .brand-strip__viewport {
    display: flex;
    overflow: hidden;
    width: 100%;
  }

  .brand-strip__list {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0 20px 0 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 40px;
    animation: brand-scroll 22s linear infinite;
  }

  .brand-strip__list.brand-strip__list--dupe {
    display: flex;
  }

  .brand-strip__item img {
    height: 24px;
  }
}

@keyframes brand-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-strip__list {
    animation: none;
  }
}

/* Header contact button */

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--black) !important;
  padding: 9px 18px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: background-color 0.6s ease, color 0.6s ease;
}

.contact-btn:hover {
  background: transparent;
  color: var(--accent) !important;
}

.contact-btn span {
  font-size: 0.95em;
}

/* Project hero (new template) */

.project-hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  align-items: start;
  padding-top: clamp(40px, 7vw, 64px);
  padding-bottom: clamp(28px, 5vw, 40px);
}

.project-hero__text {
  grid-column: span 6;
}

.project-hero__desc {
  grid-column: span 6;
}

.project-hero__text h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.project-hero__subtitle {
  color: var(--black);
  font-size: 1rem;
  margin: 0;
  max-width: 32ch;
}

.project-hero__desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--black);
  margin: 0;
  max-width: 46ch;
}

.contact-hero__details {
  margin-top: 20px !important;
}

.contact-hero__details a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Contact page (dark) */

body:has(.contact-page) {
  background: var(--dark);
}

.contact-page {
  background: var(--dark);
  color: #fff;
  max-width: none;
  padding: 0;
  min-height: calc(100vh - 119px);
}

.contact-hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(48px, 9vw, 120px) var(--margin) clamp(60px, 8vw, 96px);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
}

.contact-hero > * {
  grid-column: 4 / span 6;
}

.contact-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 5.5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 20px;
}

.contact-hero__intro {
  font-size: 1.2rem;
  line-height: 1.5;
  color: #fff;
  margin: 0 0 48px;
}

.contact-hero__item {
  margin-bottom: 32px;
}

.contact-hero__label {
  font-size: 1.1rem;
  color: #fff;
  margin: 0 0 6px;
}

.contact-hero__value {
  font-size: 1.1rem;
  margin: 0;
}

.contact-hero__value a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.15s ease;
}

.contact-hero__value a:hover {
  opacity: 0.8;
}

@media (max-width: 720px) {
  .contact-hero > * {
    grid-column: 1 / span 12;
  }
}

/* Areas covered */

.areas-covered {
  padding: clamp(24px, 4vw, 36px) 0;
}

.tag-list {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.tag {
  background: var(--grey-panel);
  color: var(--black);
  font-size: 0.85rem;
  padding: 7px 14px;
  border-radius: 999px;
}

/* Project gallery — flexible flat grid.
   Each block is tagged --large (full width, own row) or --small (half width,
   auto-pairs with the next --small). Any order, any count, any mix works. */

.project-gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  padding-top: clamp(20px, 3vw, 32px);
  padding-bottom: clamp(40px, 6vw, 64px);
}

.gallery-block {
  background: #0A1B22;
  overflow: hidden;
}

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

.gallery-block--large {
  grid-column: span 12;
}

.gallery-block--large:empty {
  min-height: 300px;
}

.gallery-block--large img {
  height: auto;
  object-fit: initial;
}

.gallery-block--small {
  grid-column: span 6;
  aspect-ratio: 1 / 1.03;
}

@media (max-width: 720px) {
  .gallery-block--small {
    grid-column: span 12;
  }

  .gallery-block--small img {
    height: auto;
    object-fit: initial;
  }
}

@media (max-width: 720px) {
  .project-hero {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .project-hero__text,
  .project-hero__desc {
    grid-column: auto;
  }
}
