:root {
    color-scheme: light dark;
    --bg: #fff;
    --ink: #1A1310;
    --red: #B3241C;
    --red-deep: #6E1512;
    --red-soft: #E7B7AC;
    --content-max: 1100px;
    --content-pad: 2rem;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html {
    scroll-behavior: smooth;
    background-color: #fff;
  }
  body {
    background-color: #fff;
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
  }

  /* Explicit light palette when OS/browser prefers dark (Samsung Internet reads this) */
  @media (prefers-color-scheme: dark) {
    :root {
      color-scheme: light dark;
      --bg: #fff;
      --ink: #1A1310;
    }

    html,
    body,
    nav,
    .next-section,
    .offers,
    .work-section,
    .about-section,
    .connect-section,
    .footer-cta {
      background-color: #fff !important;
      color: #1A1310 !important;
    }

    nav {
      border-bottom-color: rgba(26, 19, 16, 0.08) !important;
    }

    .hero-headline,
    .offer-text h3,
    .work-project-title,
    .about-text p strong,
    .role-row .role-title,
    .skills-col h4,
    .connect-links a,
    .connect-cta-title,
    .footer-cta-title {
      color: inherit;
    }
  }

  .site-container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding-left: var(--content-pad);
    padding-right: var(--content-pad);
  }

  nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(26, 19, 16, 0.08);
    padding: 1.1rem 0;
  }
  .nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  nav .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
  }
  nav .brand-logo {
    height: 1.85em;
    width: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;
  }
  nav .name {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
  }

  .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--red);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.85rem 1.6rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s ease;
    white-space: nowrap;
  }
  .btn-primary:hover {
    background: var(--red-deep);
  }
  .nav-cta {
    font-size: 0.95rem;
    padding: 0.8rem 1.5rem;
  }

  @media (max-width: 520px) {
    .nav-cta {
      font-size: 0.85rem;
      padding: 0.7rem 1.1rem;
    }
  }

  .hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8rem 1.5rem 2rem;
    position: relative;
  }

  .hero-headline {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 8.5vw, 6.8rem);
    line-height: 0.94;
    letter-spacing: -0.02em;
    color: var(--red);
    white-space: nowrap;
    width: 100%;
    text-align: center;
    margin: 0 auto;
  }

  .drip-wrap {
    position: relative;
    height: 20px;
    width: 20px;
    margin-top: 1.5rem;
    overflow: visible;
  }
  .drip-dot {
    position: absolute;
    top: 0;
    left: 50%;
    width: 9px;
    height: 9px;
    background: var(--red);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform: translateX(-50%);
  }

  .illustration-row {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    margin-top: -1.5rem;
    width: 100%;
    max-width: var(--content-max);
  }

  .illu {
    width: 380px;
    max-width: 42vw;
    height: auto;
    will-change: transform, opacity;
    transition: transform 0.05s linear;
  }

  .next-section {
    background: var(--bg);
  }

  .offers {
    padding-top: 7rem;
    padding-bottom: 8rem;
  }

  .offers-eyebrow,
  .work-section-eyebrow,
  .about-eyebrow,
  .connect-eyebrow {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--red-deep);
    font-weight: 600;
    margin-bottom: 3rem;
  }

  .offer-row {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 1.75rem;
    align-items: start;
    padding: 2.6rem 0;
    border-top: 1px solid rgba(26, 19, 16, 0.14);
  }
  .offer-row:last-child {
    border-bottom: 1px solid rgba(26, 19, 16, 0.14);
  }

  .offer-mark {
    width: 42px;
    height: 42px;
    margin-top: 0.3rem;
    background: var(--red);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform: rotate(-8deg);
    flex-shrink: 0;
  }
  .offer-row:nth-child(3) .offer-mark { transform: rotate(4deg); }
  .offer-row:nth-child(4) .offer-mark { transform: rotate(-16deg); }

  .offer-text h3 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3.2vw, 2.5rem);
    letter-spacing: -0.01em;
    line-height: 1.12;
    margin-bottom: 0.7rem;
  }
  .offer-text p {
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(26, 19, 16, 0.62);
    max-width: 68ch;
  }

  @media (max-width: 620px) {
    .offer-row {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
  }

  .work-section {
    background: #fff;
    padding: 4rem 0 6rem;
  }

  .work-inner {
    display: flex;
    flex-direction: column;
  }

  .work-projects {
    display: flex;
    flex-direction: column;
    gap: 6rem;
  }

  .work-project-header {
    padding: 0 0 1rem;
  }

  .work-project:first-child .work-project-header {
    padding-top: 0;
  }

  .work-project-header-grid {
    display: flex;
    flex-direction: column;
  }

  .work-project.has-testimonial:not(.work-project--thesis) {
    display: flex;
    flex-direction: column;
  }

  .work-project.has-testimonial .work-project-intro {
    display: contents;
  }

  .work-project.has-testimonial:not(.work-project--thesis) .work-project-header {
    order: 1;
    padding-bottom: 0.75rem;
  }

  .work-project.has-testimonial:not(.work-project--thesis) .work-project-media {
    order: 2;
  }

  .work-project.has-testimonial:not(.work-project--thesis) .work-project-testimonial {
    order: 3;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(26, 19, 16, 0.12);
  }

  .work-project--thesis.has-testimonial .work-project-testimonial {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }

  /* Thesis — headline + quotes, then image */
  .work-project--thesis.has-testimonial {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "testimonial"
      "media";
    row-gap: 1.25rem;
  }

  .work-project--thesis .work-project-intro,
  .work-project--thesis .work-project-header,
  .work-project--thesis .work-project-header-grid {
    display: contents;
  }

  .work-project--thesis .work-project-main {
    grid-area: main;
  }

  .work-project--thesis .work-project-testimonial {
    grid-area: testimonial;
  }

  .work-project--thesis .work-project-media {
    grid-area: media;
    margin-top: 0;
  }

  .work-project-logo {
    display: block;
    width: min(100%, 20rem);
    height: auto;
    margin-bottom: 1.25rem;
    filter: brightness(0);
  }

  .work-project-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1.15;
    color: var(--ink);
    margin-bottom: 1rem;
  }

  .work-project-title-muted {
    display: block;
    font-weight: 500;
    color: rgba(26, 19, 16, 0.45);
    margin-bottom: 0.15em;
  }

  .work-project-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
  }

  .work-project-title a:hover {
    color: var(--red);
  }

  .work-project-title a:hover .work-project-title-muted {
    color: rgba(179, 36, 28, 0.55);
  }

  .work-project-meta {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(26, 19, 16, 0.45);
    max-width: 36rem;
    margin-bottom: 1.25rem;
  }

  .work-project-status {
    display: block;
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 300;
    color: rgba(26, 19, 16, 0.45);
  }

  .work-project-status-sep {
    margin: 0 0.35em;
  }

  .work-project-status a {
    color: rgba(26, 19, 16, 0.55);
    text-decoration: underline;
    text-decoration-color: rgba(26, 19, 16, 0.25);
    text-underline-offset: 0.15em;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
  }

  .work-project-status a:hover {
    color: var(--red);
    text-decoration-color: var(--red);
  }

  .work-project-quote {
    font-size: 1rem;
    font-weight: 300;
    font-style: italic;
    line-height: 1.7;
    color: rgba(26, 19, 16, 0.45);
    margin: 0;
  }

  .work-project-quote-author {
    display: block;
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 500;
    font-style: normal;
    color: var(--ink);
  }

  @media (min-width: 1024px) {
    .work-project-quote-author {
      margin-top: 1.25rem;
    }
  }

  .work-project-quote-role {
    display: block;
    margin-top: 0.15rem;
    font-size: 1rem;
    font-weight: 300;
    font-style: normal;
    color: rgba(26, 19, 16, 0.45);
  }

  .work-project-testimonial {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .work-project-testimonial-item:not(:last-child) {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(26, 19, 16, 0.12);
  }

  .work-project--thesis .work-project-testimonial-item:not(:last-child) {
    margin-bottom: 1.75rem;
    padding-bottom: 0;
    border-bottom: none;
  }

  @media (min-width: 1024px) {
    .work-project--thesis .work-project-testimonial-item:not(:last-child) {
      margin-bottom: 2rem;
    }
  }

  .work-project-media {
    overflow: hidden;
    border-radius: 12px;
    isolation: isolate;
    clip-path: inset(0 round 12px);
    margin-top: 1.5rem;
  }

  .work-project--thesis .work-project-media {
    margin-top: 0;
  }

  .work-project-media a {
    display: block;
    text-decoration: none;
    overflow: hidden;
    border-radius: 12px;
  }

  .work-project-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    vertical-align: top;
  }

  .work-project-media--placeholder {
    aspect-ratio: 16 / 10;
    background: repeating-linear-gradient(
      135deg,
      rgba(26, 19, 16, 0.05),
      rgba(26, 19, 16, 0.05) 10px,
      rgba(26, 19, 16, 0.025) 10px,
      rgba(26, 19, 16, 0.025) 20px
    );
    border-radius: 12px;
  }

  @media (min-width: 1024px) {
    .work-section {
      padding: 5rem 0 7rem;
    }

    .work-projects {
      gap: 7rem;
    }

    .work-project-header {
      padding-bottom: 1.25rem;
    }

    .work-project:first-child .work-project-header {
      padding-top: 0;
    }

    .work-project.has-testimonial:not(.work-project--thesis) {
      display: block;
    }

    .work-project--thesis.has-testimonial {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-areas:
        "main testimonial"
        "media media";
      column-gap: 4rem;
      row-gap: 1rem;
    }

    .work-project--thesis .work-project-media {
      grid-column: 1 / -1;
    }

    .work-project--thesis .work-project-testimonial {
      display: flex;
      flex-direction: column;
      gap: 0;
    }

    .work-project.has-testimonial:not(.work-project--thesis) .work-project-intro {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-areas:
        "logo ."
        "main testimonial";
      column-gap: 4rem;
      align-items: start;
      padding-bottom: 0;
    }

    .work-project:not(.work-project--thesis) .work-project-media {
      margin-top: 2rem;
    }

    .work-project.has-testimonial:not(.work-project--thesis) .work-project-header,
    .work-project.has-testimonial:not(.work-project--thesis) .work-project-header-grid {
      display: contents;
    }

    .work-project.has-testimonial:not(.work-project--thesis) .work-project-logo {
      grid-area: logo;
    }

    .work-project.has-testimonial:not(.work-project--thesis) .work-project-main {
      grid-area: main;
    }

    .work-project.has-testimonial:not(.work-project--thesis) .work-project-testimonial {
      grid-area: testimonial;
      order: unset;
      margin-top: 0;
      padding-top: 0;
      border-top: none;
    }

    .work-project-header-grid:not(:has(.work-project-testimonial)) {
      display: flex;
      flex-direction: column;
    }

    .work-project-logo {
      width: auto;
      height: 3rem;
      max-width: 22rem;
      margin-bottom: 1.5rem;
    }

    .work-project-title {
      font-size: 3rem;
      letter-spacing: -0.03em;
      line-height: 1.1;
      margin-bottom: 1.25rem;
    }

    .work-project-meta {
      margin-bottom: 1.5rem;
    }

    .work-project-status {
      margin-top: 1rem;
      margin-bottom: 1.5rem;
    }
  }

  .about-section {
    background: var(--bg);
    padding: 7rem 0 8rem;
  }
  .about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 5rem;
    align-items: center;
  }
  .about-text p {
    font-size: 1.15rem;
    line-height: 1.6;
    color: rgba(26, 19, 16, 0.55);
    margin-bottom: 1.6rem;
    max-width: 46ch;
  }
  .about-text p strong {
    color: var(--ink);
    font-weight: 600;
  }
  .about-text a {
    color: rgba(26, 19, 16, 0.55);
    text-decoration-color: rgba(26, 19, 16, 0.35);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
  }
  .about-text a:hover {
    color: var(--red);
    text-decoration-color: var(--red);
  }
  .about-divider {
    border: none;
    border-top: 1px solid rgba(26, 19, 16, 0.14);
    margin: 2rem 0 1.6rem;
    max-width: 46ch;
  }
  .about-roles {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }
  .role-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.6rem;
    font-size: 1.1rem;
  }
  .role-row .role-title {
    font-weight: 700;
    color: var(--ink);
  }
  .role-row .role-dash {
    color: rgba(26, 19, 16, 0.35);
  }
  .role-row .role-company {
    color: rgba(26, 19, 16, 0.5);
  }

  .about-portrait {
    aspect-ratio: 3 / 4;
    overflow: hidden;
  }
  .about-portrait .portrait-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 18%;
  }

  @media (max-width: 860px) {
    .about-grid {
      grid-template-columns: 1fr;
      gap: 2.5rem;
    }
    .about-portrait { order: -1; max-width: 320px; margin: 0 auto; }
  }

  .connect-section {
    padding: 3rem 0 8rem;
    background: #fff;
  }
  .connect-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 4rem;
    align-items: start;
  }
  .skills-columns {
    display: flex;
    gap: 3rem;
  }
  .skills-col h4 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.9rem;
  }
  .skills-col ul {
    list-style: none;
  }
  .skills-col li {
    color: rgba(26, 19, 16, 0.6);
    font-size: 0.98rem;
    line-height: 1.9;
  }
  .connect-inner p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(26, 19, 16, 0.6);
    max-width: 44ch;
    margin-bottom: 1.6rem;
  }
  .connect-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
  }
  .connect-links a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: rgba(26, 19, 16, 0.3);
    width: fit-content;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
  }
  .connect-links a:hover {
    color: var(--red);
    text-decoration-color: var(--red);
  }

  .connect-cta {
    padding-top: 0.25rem;
  }

  .connect-cta-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 500;
    font-size: clamp(1.45rem, 3.2vw, 2.1rem);
    letter-spacing: -0.03em;
    line-height: 1.08;
    color: var(--ink);
  }

  .connect-cta-muted {
    color: rgba(26, 19, 16, 0.45);
  }

  .connect-cta-actions {
    margin-top: 1.25rem;
  }

  .footer-cta {
    padding: 6rem 0 8rem;
    background: #fff;
  }

  .footer-cta-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 500;
    font-size: clamp(2.5rem, 8vw, 6rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--ink);
  }

  .footer-cta-muted {
    color: rgba(26, 19, 16, 0.45);
  }

  .footer-cta-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
  }

  .footer-cta-actions {
    margin-top: 2.5rem;
  }

  @media (max-width: 860px) {
    .connect-grid {
      grid-template-columns: 1fr;
      gap: 3rem;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .illu { transition: none !important; }
  }

  /* Samsung Internet force-dark applies a proprietary color transform.
     When detected, counter-invert the page and re-invert media assets. */
  html.is-samsung-internet.samsung-night-correction {
    filter: invert(1) hue-rotate(180deg);
    -webkit-filter: invert(1) hue-rotate(180deg);
    background-color: #000 !important;
  }

  html.is-samsung-internet.samsung-night-correction img,
  html.is-samsung-internet.samsung-night-correction video,
  html.is-samsung-internet.samsung-night-correction picture,
  html.is-samsung-internet.samsung-night-correction svg,
  html.is-samsung-internet.samsung-night-correction iframe,
  html.is-samsung-internet.samsung-night-correction canvas {
    filter: invert(1) hue-rotate(180deg);
    -webkit-filter: invert(1) hue-rotate(180deg);
  }
