/* ==========================================================================
   Variable Declarations
   ========================================================================== */

:root {
/* Type steps */
/* @link https://utopia.fyi/type/calculator?c=320,18,1.2,1600,24,1.333,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6|8|10,s-l&g=s,l,xl,12 */

  --step--2: clamp(0.7813rem, 0.7655rem + 0.0787vw, 0.8442rem);
  --step--1: clamp(0.9375rem, 0.8906rem + 0.2347vw, 1.1253rem);
  --step-0: clamp(1.125rem, 1.0313rem + 0.4688vw, 1.5rem);
  --step-1: clamp(1.35rem, 1.1876rem + 0.8119vw, 1.9995rem);
  --step-2: clamp(1.62rem, 1.3587rem + 1.3067vw, 2.6653rem);
  --step-3: clamp(1.944rem, 1.5418rem + 2.0111vw, 3.5529rem);
  --step-4: clamp(2.3328rem, 1.732rem + 3.004vw, 4.736rem);
  --step-5: clamp(2.7994rem, 1.9209rem + 4.3922vw, 6.3131rem);

/* Typography */
  --font-family-title: "Instrument Serif", sans;
  --font-family-default: "Plus Jakarta Sans", sans;
  --font-family-secondary: "Plus Jakarta Sans", sans;
  --font-family-tertiary: "Plus Jakarta Sans", sans;
  --lineheight-text-small: 1.2;
  --lineheight-text-default: 1.5;
  --lineheight-text-long: 1.7;
  --lineheight-text-headline: 1.4;
  --lineheight-header-default: 1;
  --lineheight-text-alt: .9;

/* Colour */
  --color-background: #F4F1F1; /* was #FCEFF7;, changed to harmonize with tailwind pink-100 */
  --color-background2: #fdf2f8; /* pink-50 in tailwindcss */
  --color-content: #3E0011;
  --color-background-selection: #fff;

  --color-link: #1968DC;
  --color-highlight: #DE003E;
  --color-highlight-secondary: #FFB82E;

  --fa-primary-color: #FFB82E;
  --fa-primary-opacity: 1.0;
  --fa-secondary-color: #DE003E;
  --fa-secondary-opacity: 1.0;

/* Spacing pairs */
/* @link https://utopia.fyi/space/calculator?c=320,16,1.2,1600,24,1.333,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6|8|10,s-l&g=s,l,xl,12 */

  --space-3xs: clamp(0.25rem, 0.2188rem + 0.1563vw, 0.375rem);
  --space-2xs: clamp(0.5rem, 0.4375rem + 0.3125vw, 0.75rem);
  --space-xs: clamp(0.75rem, 0.6563rem + 0.4688vw, 1.125rem);
  --space-s: clamp(1rem, 0.875rem + 0.625vw, 1.5rem);
  --space-m: clamp(1.5rem, 1.3125rem + 0.9375vw, 2.25rem);
  --space-l: clamp(2rem, 1.75rem + 1.25vw, 3rem);
  --space-xl: clamp(3rem, 2.625rem + 1.875vw, 4.5rem);
  --space-2xl: clamp(4rem, 3.5rem + 2.5vw, 6rem);
  --space-3xl: clamp(6rem, 5.25rem + 3.75vw, 9rem);
  --space-4xl: clamp(8rem, 7rem + 5vw, 12rem);
  --space-5xl: clamp(10rem, 8.75rem + 6.25vw, 15rem);

  /* One-up pairs */
  --space-3xs-2xs: clamp(0.25rem, 0.125rem + 0.625vw, 0.75rem);
  --space-2xs-xs: clamp(0.5rem, 0.3438rem + 0.7813vw, 1.125rem);
  --space-xs-s: clamp(0.75rem, 0.5625rem + 0.9375vw, 1.5rem);
  --space-s-m: clamp(1rem, 0.6875rem + 1.5625vw, 2.25rem);
  --space-m-l: clamp(1.5rem, 1.125rem + 1.875vw, 3rem);
  --space-l-xl: clamp(2rem, 1.375rem + 3.125vw, 4.5rem);
  --space-xl-2xl: clamp(3rem, 2.25rem + 3.75vw, 6rem);
  --space-2xl-3xl: clamp(4rem, 2.75rem + 6.25vw, 9rem);
  --space-3xl-4xl: clamp(6rem, 4.5rem + 7.5vw, 12rem);
  --space-4xl-5xl: clamp(8rem, 6.25rem + 8.75vw, 15rem);

  /* Custom pairs */
  --space-l-2xl: clamp(2.25rem, 1.3125rem + 4.6875vw, 6rem); /* space from section header to content */
  --space-2xl-4xl: clamp(4.5rem, 2.625rem + 9.375vw, 12rem); /* space between sections */

/* Borders */
  --border-width-thin: 1px;

/* Layout */
  --grid-column-gap: 1rem;
  --grid-row-gap: 1rem;
  --max-width: 80rem;
  --full-width: 100%;
  --skinny-width: 48rem;

/* Spacing */
  --spacing-small: 0.5rem;
  --spacing-default: 1rem;
  --spacing-medium: 1.5rem;
  --spacing-large: 2rem;
  --spacing-larger: 2.5rem;
  --spacing-xlarge: 3rem;

/* Transitions */
  --transition-linear: linear 0.3s;
/*  --transition-zoom: cubic-bezier(0.19,1,0.22,1) 2s; */
}

html {
  background-color: var(--color-background);
  color: var(--color-content);
  font-family: var(--font-family-default);
  font-style: normal;
  font-weight: 300;
  line-height: var(--lineheight-text-default);
}

body {
  min-height:  100%;
}

a:focus {
  outline: none;
  border-bottom: 5px solid var(--color-highlight);
  background-color: var(--color-highlight);
}

a:active {
  background-color: transparent;
  border-bottom: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--lineheight-header-default);
  font-family: var(--font-family-title);
  font-weight: normal;
  margin-block-start: 0;
  margin-block-end: 0;
}

.preamble-column > h1, .contact-div > h1 {
  font-family: var(--font-family-title);
  font-size: var(--step-5);
  color: var(--color-highlight);
}

h1 {font-size: var(--step-4);}
h2 {font-size: var(--step-3);}
h3 {font-size: var(--step-2);}
h4 {font-size: var(--step-1);}
p  {font-size: var(--step-0);}

p+p, p+img, p+video, p+.case-screen, p+.flx-embed, .caption+p, p+h2 {margin-top: var(--space-xs);}


.center {
  text-align: center;
}

.space-2xl-top {
  margin-top: var(--space-2xl-4xl);
}

/* ==========================================================================
 Primitive Declarations
 ========================================================================== */

p, ul, ol, dl {
  font-family: var(--font-family-secondary);
  margin: 0;
}

a {
  color: var(--color-link);
  font-weight: 500;
  font-family: var(--font-family-secondary);
  text-decoration: none;
  border-style: none;
  outline: none;
  -webkit-transition: all .25s ease;
  transition: all .25s ease; }
  a:hover {
    background-color: var(--color-highlight-secondary);
    color: var(--color-content);
    transition: all 0.2s ease;
}

p > a {
  text-decoration: underline;
  text-decoration-color: var(--color-highlight-secondary);
  text-decoration-thickness: 0.25rem;
}

img {
  border-width: 0;
  height: auto;
  content-visibility: auto;
  max-width: 100%;
  vertical-align: middle;
}

i {
  color: var(--color-content);
}

section {
  padding: 0 5%;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Class Declarations
   ========================================================================== */

.container {
  max-width: var(--max-width);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.skinny {
  max-width: var(--skinny-width);
}

.container > h2 {
  margin-bottom: var(--space-l-2xl);
}

.container > h3 { 
  margin-bottom: var(--space-xs);
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding-top: var(--space-xs);
  padding-bottom: var(--space-xs);
  max-width: var(--full-width);
  z-index: 10;
  transition: all 0.3s ease;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content:space-between;
}

/* Or target the logo specifically */
.navbar-inner a:hover {
  background-color: transparent;
  color: inherit;
}

.top-path {
  transition: transform 0.2s ease, fill 0.2s ease;
  cursor: pointer;
}

.top-path:hover {
  transform: translateY(3px);
  fill: #FFB82E;
}

.top-path:active {
  transform: translateY(8px);
  fill: #FFB82E;
}

/* Ensure the object doesn't prevent clicks on the parent link */
.navbar-inner object:hover {
  pointer-events: auto;
}

.navbar.scrolled {
  background-color: rgba(244, 241, 241, 0.80); /* Using color-background2 with opacity */
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 0px 8px -1px rgba(0, 0, 0, 0.1), 
              0 0px 16px -1px rgba(0, 0, 0, 0.06);
}

.active {
  border-bottom: 3px solid var(--color-highlight);
}

.logo {
  min-height: 4rem;
  min-width: 4rem;
  max-height: 4rem;
  height: 100%;
}

.menu {
  display: flex;
  list-style: none;
}

.menu > li {
  font-family: var(--font-family-default);
  font-weight: 400;
  padding-left: 2rem;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.menu > li > h3 {
  font-style: normal;
  font-size: var(--step-0);
}

.menu > li > h3 > a {
  color: var(--color-link);
  font-family: var(--font-family-default);
}

.menu > li > h3 > a:hover {
  background-color: var(--color-highlight-secondary);
  color: var(--color-content);
}

.hero {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
  padding-top: var(--space-4xl-5xl); /* Account for fixed navbar */
}

.gradient-blob {
  position: absolute;
  width: 400px;
  height: 30vh;
  border-radius: 50%;
  filter: blur(96px);
  opacity: 0.25;
  pointer-events: none;
  z-index: -1;
  mix-blend-mode: multiply;
}

.blob-left {
  background: #FF622E;
  left: 10%;
  top: 45%;
  transform: translateY(-50%) rotate(25deg);
}

.blob-middle {
  background: #FF3C72;
  left: 15%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(118deg);
}

.blob-right {
  background: #FFB82E;
  left: 20%;
  top: 55%;
  transform: translateY(-50%) rotate(44deg);
}

/* Ensure hero content stays above blobs */
.hero .container {
  position: relative;
  z-index: 1;
}

.scroll-indicator {
  position: absolute;
  bottom: 0rem;
  left: 50%;
  transform: translateX(-50%);
  animation: float 2s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.6s ease;
  cursor: pointer;
}

.scroll-indicator:hover {
  transform: translateX(-50%) translateY(5px);
}

.scroll-indicator.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}

@keyframes float {
  0%, 100% {
      transform: translateX(-50%) translateY(0);
  }
  50% {
      transform: translateX(-50%) translateY(-10px);
  }
}

.scroll-indicator i {
  animation: float 2s ease-in-out infinite;
}

.preamble, .contact-div {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
  gap: var(--space-l);
  min-height: var(--space-3xl);
}

.preamble-column, .contact-column {
  flex: 1;
}

.preamble-column h1, .contact-column h1, .container h1 {
  color: var(--color-highlight);
  letter-spacing: -0.05rem;
}

.compact .container {  width: var(--skinny-width);}

.compact .container .preamble {
  flex-direction: column;
}

.contact-column > .big-button {
  margin-top: var(--space-l);
}

/* Adjust the existing .hero h1 rule to target inside preamble-column instead */
.hero > div > div > .preamble-column > h1 {
  color: var(--color-highlight);
  letter-spacing: -0.05rem;
}

.glyph {
  display: flex;
  justify-content: center;
  margin-top: 10vh;
}

.highlights > div > h2, .projects > h2  {
  color: var(--color-highlight);
}

.col-2 {
  width: 45%;
}

.col-3 {
  width: 30%;
}

.col-4 {
  width: 23%;
}


.highlight-content {
  margin-top: 1rem;
}

.content-area {
  margin-top: var(--space-2xl-4xl);
  margin-bottom: var(--space-2xl-4xl);
  background-color: var(--color-background-primary);
}

.content-area > .container > p, .blog-post > p {
  line-height: var(--lineheight-text-long);
}

.content-area > div > h2 {
  color: var(--color-highlight);
}

.highlights > p {
  margin-bottom: 2rem;
  line-height: 2rem;
}

.home-blog-index {
  margin-top: var(--space-2xl-4xl);
}

.projects {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.project {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center; 
  flex-wrap: wrap;
  gap: var(--space-l);
}

.project > a {
  display: block;
}

.project-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1 1 30rem; /* was 1 1 20rem */
}

.project-content > h3 {
  color: var(--color-highlight);
  margin-bottom: var(--space-xs);
}

.project-content > h4 {
  margin-bottom: var(--space-l);
  display: flex;
  font-family: var(--font-family-title);
  color: var(--color-content);
}

.project:nth-of-type(2n+1) {
  flex-direction: row-reverse;
}

.flip:nth-of-type(2n+1) {
  flex-direction: row;
}

.screenshot {
  align-items: center;
  background-repeat: no-repeat;
  background-clip: border-box;
  display: flex;
  flex-direction: row;
  min-width: 10rem;
  flex: 2 3 18rem; /* Flex-grow, flex-shrink, flex-basis */
  background-position: left;
  justify-content: flex-end;
  object-fit: cover;
}

.project:nth-of-type(2n+1) > .screenshot {
  background-position: right;
  justify-content: flex-start;
}

.flip {
  flex-direction: row-reverse;
}

.screenshot > img {
  display: block;
  width: 100%;
  height: auto;
  content-visibility: visible; /* Force visibility regardless of viewport */
  contain: none; /* Disable CSS containment which can affect visibility */
}

.screenshot_ {
  aspect-ratio: 1008 / 800;
}

.screenshot0 {
  aspect-ratio: 1624 / 1738;
}

.screenshot1 {
  aspect-ratio: 1624 / 1738;
}

.screenshot2 {
  aspect-ratio: 1627 / 1624;
}

.screenshot3 {
  aspect-ratio: 1624 / 1738;
}

.screenshot4 {
  aspect-ratio: 1600 / 1003;
}

.screenshot5 {
  aspect-ratio: 1624 / 1738;
}

.screenshot6 {
  aspect-ratio: 1788 / 1032;
}

.screenshot7 {
  aspect-ratio: 1600 / 709;
}

.screenshot8 {
  aspect-ratio: 1600 / 709;
}

.screenshot9 {
  aspect-ratio: 1600 / 709;
}

.screenshot10 {
  aspect-ratio: 1600 / 708;
}

.screenshot11 {
  aspect-ratio: 1600 / 995;
}

.lil-button {
  position: relative;
  display: flex;
  justify-content: flex-start;
  margin-top: var(--space-l);
}

.lil-button > a {
  border: 4px solid var(--color-highlight-secondary);
  font-size: var(--step--1);
  padding: var(--space-2xs) var(--space-s);
  border-radius: var(--space-l);
  background-color: white;
  color: var(--color-link);
  display: inline-block;
  
  /* 3D button properties */
  position: relative;
  text-decoration: none;
  transform: translateY(0px);
  box-shadow: 0 5px 0 var(--color-highlight);
}

.lil-button > a:hover, .lil-button > a:focus {
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--color-highlight);
  cursor: pointer;
  background-color: var(--color-highlight-secondary);
  color: var(--color-content);
}

.lil-button > a:active {
  transform: translateY(4px);
  box-shadow: 0 0px 0 var(--color-highlight);
}

.big-button {
  /* Container needs relative positioning for the transform to work properly */
  position: relative;
  /* Right alignment that maintains document flow */
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-top: var(--space-xl-2xl);
}

.big-button > a {
  border: 4px solid var(--color-highlight-secondary);
  padding: var(--space-xs) var(--space-m);
  background-color: white;
  font-size: var(--step-0);
  line-height: var(--step-0);
  margin-left: 0;
  margin-right: 0;
  border-radius: var(--space-l);
  color: var(--color-link);
  
  /* 3D button properties */
  position: relative;
  display: inline-block;
  text-decoration: none;
  transform: translateY(0px);
  box-shadow: 0 8px 0 var(--color-highlight);  
}

.big-button > a:hover, .big-button > a:focus {
  transform: translateY(3px);
  box-shadow: 0 5px 0 var(--color-highlight);
  cursor: pointer;
  background-color: var(--color-highlight-secondary);
  color: var(--color-content);
}

.big-button > a:active {
  transform: translateY(8px);
  box-shadow: 0 0px 0 var(--color-highlight); 
}

.caption {
  font-size: 0.8rem;
  margin-top:0.4rem;
  line-height: 1rem;
}

.case-screen {
  margin-bottom: 2rem;
}

.footer {
  padding-bottom: 2rem;
  padding-top: 2rem;
  background-color: var(--color-highlight-secondary);
  color: var(--color-content);
  height: 100%;
}

.copyright {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--color-content);
}

.copyright > p {
  display:flex;
  justify-content: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding-bottom: 2rem;
}

.social-links > a > i {
color: var(--color-content);
}

.social-links > a > i:hover {
  color: var(--color-highlight);
}

.social-links > a:focus {
  background-color: var(--color-highlight);
}

.masonry {
  margin-top: var(--space-l);
  display: flex;
  flex-direction: row;
  justify-content:space-between;
  gap: var(--space-m);
}

.blog-index > .masonry {
  flex-direction: column;
}

.brick-column {
  display: flex;
  flex-direction: column;
}

.skinny-col {
  width: 30%;
}

.medium-col {
  width: 40%;
}

.fat-col {
  width: calc(50% - 1.5rem);
}

.brick {
  background-color: white; 
  border-radius: var(--spacing-larger); 
  padding: var(--spacing-medium);  
  margin-bottom: var(--space-m);
}

.brick > i {
  float: right;
  position: relative;
  padding-right: var(--space-2xs);
  font-size: var(--step-0);
  line-height: var(--space-m);
}

.brick > h3 {
  color: var(--color-highlight);
  margin-bottom: var(--space-3xs);
}

.brick > p {
  font-size: var(--step--1);
  line-height: 1.32; /* using a 'weird' number here so the bottom edges align on the brick layout */
}

/* Blog grid layout */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-l);
  margin-top: var(--space-l);
}

.blog-entry {
  display: block;
}

.blog-entry > a {
  width: 100%;
  height: 100%;
  display: block;
  text-decoration: none;
}

.blog-excerpt {
  margin-top: var(--space-xs);
  color: var(--color-content);
}

.post-date {
  color: var(--color-content);
  opacity: 0.8;
  margin: var(--space-2xs) 0 var(--space-xs) 0;
}

.blog-entry > a > h4 {
  align-self: flex-end;
  /* Add transparent padding to maintain consistent dimensions */
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  font-family: var(--font-family-secondary);
}

.blog-entry p+h3, .blog-entry p+h4, .skinny p+h3, .skinny p+h4 {
  margin-top: var(--space-m);
}

.blog-entry > a > img {
  border-radius: 1rem;
  margin-top: var(--space-xs);
}

/* Hover state for the entire blog entry link */
.blog-entry > a:hover,
.blog-entry > a:focus {
    background-color: transparent !important;
}

.blog-entry > a:hover > img,
.blog-entry > a:focus > img {
    outline: 4px solid var(--color-highlight-secondary);
    outline-offset: 0px;
    border-radius: 1rem;
    transition: outline 0.2s ease;
}

.blog-entry > a:hover > h4,
.blog-entry > a:focus > h4 {
    background-color: var(--color-highlight-secondary);
    color: var(--color-content);

}

.blog-post h2 {
  margin-bottom: var(--space-xs);
  margin-top: var(--space-m);
}

.blog-post .big-button {
  margin-top: var(--space-m);
  justify-content: center;
}


/* ==========================================================================
 Responsive Declarations
 ========================================================================== */

@media screen and (max-width: 55rem) {

  .enlarge {
    font-size: 8rem; /* bigger because these icons are small */
  }

  .preamble {
    flex-direction: column;
  }

  .contact-div {
    flex-direction: column;
  }

  .highlight {
    width: 100%;
    flex-direction: row;
  }

  .highlight-content {
    margin-left: 1rem;
    margin-bottom: 2rem;
  }

  .project {
    gap: 1rem;
    margin-bottom: 0;
  }

  .masonry {
    flex-direction: column;
    gap: 0;
  }

  .skinny-col, .medium-col, .fat-col {
    width: 100%;
  }

  .col-2, .col-3, .col-4 {
    width: auto;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: var(--space-m);
  }

  .blog-entry {
    margin-top: var(--space-m);
  }

}

@media screen and (max-height: 26.75rem) { /* landscape mobile */

  .navbar {
    height: 3rem;
    position: static;
  }

  .logo {
    height: 4rem;
  }

  .project {
    margin-bottom: 0rem;
  }
}

@media screen and (max-width: 26.75rem) { /* targeting mobile */

  .project {
    margin-bottom: 1rem;
  }

  .navbar {
    height: 4rem;
  }

  .logo {
    height: 4rem;
  }

  .menu > li {
    padding-left: 1rem;
  }
}
