:root {
  color-scheme: light;
  font-size: 24px;
  --green: #188f81;
  --contact-green: #146b61;
  --page-surface: var(--green);
  --panel-opacity: 92.2%;
  --panel-duration: 360ms;
  --panel-easing: cubic-bezier(0.22, 0.61, 0.36, 1);
  --body-text: rgb(255 255 255 / 72.2%);
  --space: 1.5rem;
  --side-padding: 2.75rem;
  --top-padding: 1.875rem;
  --contact-space: 1.875rem;
}

:root.contact-active {
  --page-surface: var(--contact-green);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 3rem 0 3rem 1.375rem;
  overflow-x: clip;
  background: #fff;
  color: var(--body-text);
  font-family: "Inconsolata", monospace;
  font-weight: 400;
  line-height: 1.75;
}

.site-footer {
  position: absolute;
  inset: auto 0 0;
  padding: 0.5rem 1.5rem;
  background: rgb(255 255 255 / 90%);
  color: #30504b;
  font-size: 0.625rem;
  line-height: 1.6;
  text-align: center;
}

/* This decorative layer becomes the image strip on smaller screens. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("assets/bg.jpg") center / cover no-repeat;
  pointer-events: none;
}

.panel-slot {
  position: relative;
  display: grid;
  width: 39rem;
  max-width: 100%;
  flex-shrink: 0;
  border-radius: 0.75rem 0 0 0.75rem;
  overflow: hidden;
  isolation: isolate;
}

.panel {
  /* Both full cards share one grid cell, keeping the slot stable in either state. */
  grid-area: 1 / 1;
  min-width: 0;
  width: 100%;
  border-radius: inherit;
  background: rgb(24 143 129 / var(--panel-opacity));
}

.panel-general {
  transform: translateX(0);
}

.panel-contact {
  display: flex;
  align-items: center;
  background: rgb(20 107 97 / var(--panel-opacity));
  color: rgb(255 255 255 / 85%);
  transform: translateX(-100%);
  visibility: hidden;
}

.panel-contact .panel-content {
  width: 100%;
  align-content: center;
}

.panel-slot.is-contact .panel-general {
  transform: translateX(100%);
  visibility: hidden;
}

.panel-slot.is-contact .panel-contact {
  transform: translateX(0);
  visibility: visible;
}

.panel-content {
  display: grid;
  gap: var(--space);
  padding: var(--top-padding) var(--side-padding);
  overflow-wrap: break-word;
}

p,
h1,
h2,
ul {
  margin: 0;
}

.identity,
h1 {
  width: calc(100% + var(--tracking));
  color: #fff;
  letter-spacing: var(--tracking);
}

.identity {
  --tracking: 0.175rem;
  font-family: "Reddit Mono", monospace;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.25;
}

h1 {
  --tracking: 0.325rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.625;
}

.services {
  padding: 0;
  list-style: none;
  text-align: left;
}

.services li {
  position: relative;
  padding-left: 1.4453125rem;
}

.services li + li {
  margin-top: 0.5rem;
}

.services li::before {
  content: "";
  position: absolute;
  top: 0.75rem;
  left: 0.205078125rem;
  width: 0.41015625rem;
  height: 0.41015625rem;
  border-radius: 50%;
  background: currentColor;
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  width: 13.625rem;
  max-width: 100%;
  min-height: 3.25rem;
  margin-top: max(0px, calc(var(--contact-space) - var(--space)));
  padding: 0.5rem 0.5rem 0.5rem 0.825rem;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--green);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.325rem;
  text-align: center;
  text-decoration: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.contact-link:focus-visible,
.email-link:focus-visible,
.back-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.panel-contact h2 {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.625;
}

.panel-contact h2:focus {
  /* This heading is a focus destination, rather than an interactive control. */
  outline: none;
}

.whatsapp-link {
  width: auto;
  color: var(--contact-green);
  padding: 0.75rem 1rem;
  letter-spacing: normal;
  line-height: 1.4;
}

.email-link {
  min-width: 0;
  color: #fff;
  overflow-wrap: anywhere;
  text-underline-offset: 0.2em;
}

.back-link {
  justify-self: start;
  padding: 0.25rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 1680px) {
  :root {
    font-size: calc(52px / 3);
  }
}

@media (min-width: 981px) {
  :root {
    --panel-duration: 700ms;
    --panel-easing: cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Clip at the viewport edges, with each card anchored to its own side. */
  .panel-slot {
    width: calc(100% + 1.375rem);
    max-width: none;
    border-radius: 0;
  }

  .panel {
    width: 39rem;
    max-width: calc(100% - 1.375rem);
  }

  .panel-general {
    justify-self: end;
    border-radius: 0.75rem 0 0 0.75rem;
  }

  .panel-contact {
    /* Let the original card determine the shared height. */
    contain: size;
    width: 34rem;
    justify-self: start;
    border-radius: 0 0.75rem 0.75rem 0;
  }

  .panel-contact .panel-content {
    row-gap: 1.75rem;
    /* A small optical offset balances the denser heading and primary action. */
    padding-top: calc(var(--top-padding) + 0.375rem);
    padding-bottom: calc(var(--top-padding) - 0.375rem);
  }
}

@media (max-width: 980px) {
  :root {
    font-size: calc(44px / 3);
    --panel-opacity: 100%;
  }

  html {
    background: var(--page-surface);
  }

  body {
    display: block;
    padding: 0;
    background: var(--page-surface);
  }

  body::before {
    position: relative;
    inset: auto;
    display: block;
    height: 45vh;
    height: 45svh;
  }

  .panel-slot {
    width: 100%;
    min-height: 55vh;
    min-height: 55svh;
    border-radius: 0;
  }

  .panel {
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 55vh;
    min-height: 55svh;
    text-align: center;
  }

  .panel-general {
    background: var(--green);
  }

  .panel-content {
    align-content: start;
    width: 100%;
    max-width: 75%;
  }

  .contact-link {
    justify-self: center;
  }

  .back-link {
    justify-self: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .email-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .site-footer {
    position: relative;
    inset: auto;
    padding: 1rem var(--side-padding) calc(1rem + env(safe-area-inset-bottom, 0px));
    background: var(--page-surface);
    color: rgb(255 255 255 / 85%);
    font-size: 0.8rem;
  }
}

@media (max-width: 736px) {
  :root {
    --side-padding: 2rem;
    --contact-space: 1.40625rem;
  }

  .panel-content {
    max-width: 100%;
  }

  .identity {
    --tracking: 0.153125rem;
  }

  h1 {
    --tracking: 0.284375rem;
  }
}

@media (max-width: 480px) {
  :root {
    --space: 1.3125rem;
  }

  .contact-link {
    width: 100%;
  }
}

@media (max-width: 360px) {
  :root {
    --side-padding: 1.5rem;
    --top-padding: 1.40625rem;
    --space: 1.125rem;
  }
}

/* Content is visible by default; motion is an optional CSS enhancement. */
@media (prefers-reduced-motion: no-preference) {
  .panel-slot {
    animation: panel-enter 1s ease both;
  }

  .panel {
    transition: transform var(--panel-duration) var(--panel-easing), visibility 0s linear var(--panel-duration);
  }

  /* Finish the outgoing card before starting the incoming card. */
  .panel-general {
    transition-delay: var(--panel-duration), 0s;
  }

  .panel-slot.is-contact .panel-contact {
    transition-delay: var(--panel-duration), var(--panel-duration);
  }

  .panel-slot.is-contact .panel-general {
    transition-delay: 0s, var(--panel-duration);
  }

  .identity {
    animation: identity-enter 2s ease both;
  }
}

@media (max-width: 980px) and (prefers-reduced-motion: no-preference) {
  .panel-slot {
    animation: none;
  }

  .panel-general .panel-content {
    animation: content-enter 1s ease-in-out both;
  }
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateX(1.6875rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes content-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes identity-enter {
  from {
    opacity: 0;
    filter: blur(0.28125rem);
  }
  to {
    opacity: 1;
    filter: none;
  }
}
