:root {
  --bg: #ffffff;
  --text: #0f0f0f;
  --muted: #5c5c5c;
  --line: #e4e4e4;
  --accent: #dd3c27;
  --font: "Sora", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 28px;
}
.nav__logo img { height: 32px; width: auto; }
.nav__links {
  display: flex;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 20px;
  line-height: 25px;
  font-weight: 500;
}
.nav__links a {
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
  text-decoration: none;
  transition: color .2s;
}
.nav__links a:hover { color: var(--accent); }
.home .nav__links,
.about-page .nav__links { font-size: 18px; line-height: 23px; }
/* Short underline under the current page */
.nav__links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 24px;
  height: 2px;
  translate: -50% 0;
  background: currentColor;
}

html.menu-open { overflow: hidden; }

/* Hamburger button (shown on small screens only) */
.nav__toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.nav__toggle span {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: transform .25s ease, opacity .2s ease;
}
.nav__toggle span:nth-child(1) { top: 15px; }
.nav__toggle span:nth-child(2) { top: 21px; }
.nav__toggle span:nth-child(3) { top: 27px; }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Hero: 320px tall, text spans 8 of 12 columns */
.hero {
  min-height: 320px;
  display: grid;
  place-items: center;
  padding-top: 60px;
  padding-bottom: 60px;
  text-align: center;
}
.hero h1 {
  max-width: calc(var(--max) * 8 / 12);
  margin: 0;
  font-size: 30px;
  line-height: 38px;
  font-weight: 300;
}
.hero strong { font-weight: 500; }

/* Project grid */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 56px 40px;
  padding-bottom: 80px;
}
.card { text-decoration: none; display: block; }
.card__media {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4%;
  padding: 8%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}
.card__media img {
  max-height: 100%;
  min-width: 0;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  transition: transform .4s ease;
}
.card__media--phones img { border-radius: 14px; }
.card:hover .card__media img { transform: translateY(-6px); }
.card__title {
  margin: 20px 0 4px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 500;
}
.card__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* Home page tiles: 2 columns, title and subtitle below the image */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 72px 40px;
  padding-bottom: 60px;
}
.tile { display: block; text-decoration: none; }
.tile__media {
  position: relative;
  height: 400px;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(225deg, var(--c1, transparent), transparent);
}
.tile__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.tile:hover .tile__cover { transform: scale(1.03); }
.tile__title {
  margin: 24px 0 8px;
  font-size: 22px;
  line-height: 28px;
  font-weight: 500;
  transition: color .2s;
}
.tile:hover .tile__title { color: var(--accent); }
.tile__subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  color: #4a4a4a;
}

/* Generated device mockups inside tiles */
.mock { position: absolute; inset: 0; transition: transform .5s ease; }
.tile:hover .mock { transform: translateY(-8px); }
.device { position: absolute; }
.device img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.device--laptop .device__lid {
  aspect-ratio: 16 / 10.4;
  padding: 2.4% 2.4% 3%;
  background: #1c1c1e;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 30px 60px rgba(20, 20, 40, .28);
}
.device--laptop .device__lid > div { width: 100%; height: 100%; overflow: hidden; background: #fff; }
.device--laptop .device__base {
  height: 0;
  padding-bottom: 3.2%;
  margin: 0 -8%;
  background: linear-gradient(#d4d4d8, #9d9da3);
  border-radius: 0 0 16px 16px / 0 0 70% 70%;
}
.device--phone {
  aspect-ratio: 9 / 19.5;
  padding: 3.2%;
  background: #1c1c1e;
  border-radius: 16% / 7.4%;
  box-shadow: 0 24px 48px rgba(20, 20, 40, .3);
}
.device--phone > div { width: 100%; height: 100%; overflow: hidden; border-radius: 13% / 6%; background: #fff; }
.mock--light .device--laptop .device__lid,
.mock--light .device--phone { background: #ececef; }

/* Layouts */
.mock--single-middle .device--laptop { left: 10%; right: 10%; top: 50%; translate: 0 -50%; }
.mock--single-slided .device--laptop { left: 14%; width: 96%; top: 24%; }
.mock--single-slided-big .device--laptop { left: 12%; width: 124%; top: 18%; }
.mock--mobile-overlay .device--laptop { left: 7%; width: 80%; top: 50%; translate: 0 -55%; }
.mock--mobile-overlay .device--phone { right: 7%; width: 21%; bottom: 17%; padding: 5px; }
.mock--triple-middle .device--phone { width: 26%; top: 50%; translate: -50% -50%; padding: 5px; }
.mock--triple-middle .device--phone:nth-child(1) { left: 21%; }
.mock--triple-middle .device--phone:nth-child(2) { left: 50%; }
.mock--triple-middle .device--phone:nth-child(3) { left: 79%; }

/* Quote */
.quote {
  padding-top: 100px;
  padding-bottom: 30px;
  text-align: center;
}
.quote blockquote {
  max-width: 760px;
  margin: 0 auto;
  font-size: 20px;
  line-height: 26px;
}
.quote figcaption { margin-top: 16px; font-size: 16px; line-height: 22px; color: var(--muted); }

/* About */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 80px;
}
.about__eyebrow { margin: 0 0 8px; font-size: 16px; letter-spacing: .04em; }
.about h1 { margin: 0 0 24px; font-size: 24px; font-weight: 500; line-height: 1.3; }
.about p, .contact p { margin: 0 0 18px; font-size: 16px; }
.about__photo { order: -1; }
.about__photo img { width: 100%; height: auto; border-radius: 10px; }
.contact > img { border-radius: 10px; }

.button {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 28px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
}
.button:hover { background: var(--accent); color: #fff; }

.logos {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 40px;
  align-items: center;
  padding-top: 0;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--line);
}
.logos img { max-height: 90px; width: auto; margin: 0 auto; }
.logos .logos__wide { width: 80px; max-height: none; }
.logos .logos__paypal { width: 70px; max-height: none; }
.logos .logos__small { max-height: 72px; }
.logos .logos__webex { width: 90px; max-height: none; }
.logos .logos__bill { width: 55px; max-height: none; }

.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding-top: 80px;
  padding-bottom: 100px;
}
.contact h2 { margin: 0 0 16px; font-size: 28px; font-weight: 500; }
.contact__email { font-size: 18px; font-weight: 600; color: var(--accent); }

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 60px;
  padding-bottom: 60px;
  border-top: 1px solid var(--line);
  font-size: 16px;
}
.footer ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer small { color: var(--muted); font-size: 14px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { position: relative; z-index: 30; padding-top: 16px; padding-bottom: 16px; }
  .nav__logo img { height: 26px; }
  .nav__toggle { display: block; }

  /* Full-screen frosted backdrop behind the open menu */
  .nav::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: color-mix(in srgb, var(--bg) 68%, transparent);
    -webkit-backdrop-filter: blur(9.6px);
    backdrop-filter: blur(9.6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s cubic-bezier(.22, .61, .36, 1);
  }
  .nav.is-open::before { opacity: 1; pointer-events: auto; }

  .nav > nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 12px var(--gutter) 32px;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .18s cubic-bezier(.22, .61, .36, 1), transform .2s cubic-bezier(.22, .61, .36, 1);
  }
  .nav.is-open > nav { opacity: 1; transform: none; pointer-events: auto; }
  .nav .nav__links {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    font-size: 20px;
    line-height: 25px;
  }
  .nav__links a { display: block; padding: 8px 0; }
  .nav__links a[aria-current="page"]::after { bottom: 0; }

  .projects { grid-template-columns: 1fr; gap: 44px; }
  .tiles { grid-template-columns: 1fr; gap: 48px; }
  .hero h1 { font-size: 24px; line-height: 30px; }
  .about, .contact { grid-template-columns: 1fr; gap: 32px; }
  .logos { grid-template-columns: repeat(2, 1fr); }
}

/* About and home page background image; scrolls with the page.
   Tiled at a fixed 1800px so both pages show it at the same scale. The
   first copy is drawn on its own so the image starts at the top of the
   page; each seam below fades into the chalkboard color (250px either side). */
.about-page,
.home { position: relative; }
.about-page::before,
.home::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(24, 25, 26, 0), #18191a) center bottom / 100% 500px no-repeat,
    linear-gradient(rgba(0, 0, 0, .45), rgba(0, 0, 0, .45)),
    linear-gradient(90deg, #2c2e2f, rgba(44, 46, 47, 0) 250px, rgba(44, 46, 47, 0) 1550px, #2c2e2f) center top / 1800px 100% repeat-x,
    linear-gradient(rgba(44, 46, 47, 0) 1550px, #2c2e2f 1800px) center top / 100% 1800px no-repeat,
    url("img/peppers-bg.jpg") center top / 1800px auto no-repeat,
    linear-gradient(#2c2e2f, rgba(44, 46, 47, 0) 250px, rgba(44, 46, 47, 0) 1550px, #2c2e2f) center top / 100% 1800px repeat-y,
    #2c2e2f url("img/peppers-bg.jpg") center top / 1800px auto repeat;
  pointer-events: none;
}

/* White nav and headings over the dark background image */
.home .nav__links a,
.about-page .nav__links a,
.home .nav__toggle,
.about-page .nav__toggle,
.home .hero h1,
.about-page .about h1 { color: #fff; }
.home .nav__links a:hover,
.about-page .nav__links a:hover { color: var(--accent); }

/* The open phone menu sits on a white wash, so switch back to dark there */
@media (max-width: 760px) {
  .home .nav.is-open .nav__links a,
  .about-page .nav.is-open .nav__links a,
  .home .nav.is-open .nav__toggle,
  .about-page .nav.is-open .nav__toggle { color: var(--text); }
}

/* All remaining text white over the background image; secondary text slightly dimmed */
.home,
.about-page { color: #fff; }
.home .tile__subtitle,
.home .quote figcaption,
.home .footer small,
.about-page .footer small { color: rgba(255, 255, 255, .72); }

/* About page: an extra 50% black layer on top of the shared darkening */
.about-page::before {
  background:
    linear-gradient(rgba(12, 13, 13, 0), #0c0d0d) center bottom / 100% 500px no-repeat,
    linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, .5)),
    linear-gradient(rgba(0, 0, 0, .45), rgba(0, 0, 0, .45)),
    linear-gradient(90deg, #2c2e2f, rgba(44, 46, 47, 0) 250px, rgba(44, 46, 47, 0) 1550px, #2c2e2f) center top / 1800px 100% repeat-x,
    linear-gradient(rgba(44, 46, 47, 0) 1550px, #2c2e2f 1800px) center top / 100% 1800px no-repeat,
    url("img/peppers-bg.jpg") center top / 1800px auto no-repeat,
    linear-gradient(#2c2e2f, rgba(44, 46, 47, 0) 250px, rgba(44, 46, 47, 0) 1550px, #2c2e2f) center top / 100% 1800px repeat-y,
    #2c2e2f url("img/peppers-bg.jpg") center top / 1800px auto repeat;
}

/* About page: logo row spacing */
.about-page { overflow-x: clip; }
.about-page .logos {
  position: relative;
  isolation: isolate;
  padding-top: 40px;
  padding-bottom: 40px;
  border-bottom: 0;
}

/* Color swatch strip pinned to the page's top-right corner */
.swatches {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 40;
  width: 24px;
  height: 144px;
  pointer-events: none;
}

/* Keep the navigation at least 30px clear of the swatch strip (24px wide) */
.home .nav,
.about-page .nav { padding-right: max(var(--gutter), 54px); }

/* About page: each company logo on its own 120px white tile */
.logo-tile {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, .95);
}
.logo-tile img { max-width: 96px; max-height: 96px; margin: 0; }

/* Home page: drop shadow on the intro paragraph and quote so they lift off the background */
.home .hero h1,
.home .quote blockquote,
.home .quote figcaption { text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }

/* Home and about: header hides while scrolling down and returns pinned when
   scrolling up (see nav.js). Transparent at the top of the page; once away
   from the top it gets a dark bar so the white links stay readable. */
.home .nav,
.about-page .nav {
  position: sticky;
  top: 0;
  z-index: 50;
  max-width: none;
  padding-left: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  padding-right: max(54px, calc((100% - var(--max)) / 2 + var(--gutter)));
  transition: transform .25s ease, background-color .25s ease;
}
.home .nav.is-scrolled,
.about-page .nav.is-scrolled { background-color: rgba(20, 21, 22, .94); }
.home .nav.is-open,
.about-page .nav.is-open { background-color: transparent; }
.home .nav.is-hidden,
.about-page .nav.is-hidden { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) {
  .home .nav,
  .about-page .nav { transition: none; }
}
