/* NOTE: General styles */

@property --background {
  inherits: true;
  syntax: "<color>";
  initial-value: #f7f5f0;
}

@property --foreground {
  inherits: true;
  syntax: "<color>";
  initial-value: #191918;
}

@property --muted {
  inherits: true;
  syntax: "<color>";
  initial-value: #62615d;
}

@property --line {
  inherits: true;
  syntax: "<color>";
  initial-value: #d4d2cc;
}

:root {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  --line: #d4d2cc;
  --muted: #62615d;
  color-scheme: light;
  font-synthesis: none;
  --background: #f7f5f0;
  --foreground: #191918;
  color: var(--foreground);
  --theme-duration: 1125ms;
  background: var(--background);
  -webkit-text-size-adjust: 100%;
  --gutter: clamp(24px, 5vw, 80px);
  --theme-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --theme-spring: linear(
      0,
      0.045,
      0.16,
      0.31,
      0.48,
      0.65,
      0.8,
      0.91,
      0.99,
      1.04,
      1.055,
      1.05,
      1.035,
      1.017,
      1.004,
      0.997,
      0.994,
      0.995,
      0.998,
      1
    );
  }
}

:root[data-theme-ready] {
  transition-duration: var(--theme-duration);
  transition-timing-function: var(--theme-spring);
  transition-property: --background, --foreground, --muted, --line;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --line: #383735;
    --muted: #aaa8a2;
    color-scheme: dark;
    --background: #000000;
    --foreground: #f2f0eb;
  }
}

:root[data-theme="dark"] {
  --line: #383735;
  --muted: #aaa8a2;
  color-scheme: dark;
  --background: #000000;
  --foreground: #f2f0eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  background: var(--background);
  padding: max(var(--gutter), env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}

a {
  gap: 5px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  padding-block: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
}

a > span[aria-hidden] {
  font-size: 11px;
}

a::after {
  left: 0;
  right: 0;
  content: "";
  bottom: 9px;
  height: 1px;
  position: absolute;
  pointer-events: none;
  background: var(--line);
}

a:hover {
  color: var(--foreground);
}

a:hover::after {
  background: currentColor;
}

a:focus-visible,
input:focus-visible + span {
  border-radius: 2px;
  outline-offset: 5px;
  outline: 2px solid var(--foreground);
}

.appearance input,
.sr-only {
  border: 0;
  width: 1px;
  padding: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --theme-duration: 0ms;
  }
}

@media (orientation: landscape) {
  body {
    text-align: center;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  body {
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

@media (orientation: portrait) {
  body {
    --collaborator-spacing: clamp(40px, 6vh, 64px);
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  body {
    --collaborator-spacing: clamp(48px, 7vh, 72px);
  }
}

@media (max-width: 900px) and (orientation: portrait) and (max-height: 800px) {
  body {
    --collaborator-spacing: 32px;
  }
}

/* NOTE: Main layout */

main {
  width: 100%;
  padding-top: clamp(40px, 7vh, 100px);
}

@media (orientation: landscape) {
  main {
    margin-block: auto;
    padding-block: 40px;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  main {
    padding-block: 12px;
  }
}

@media (orientation: portrait) {
  main {
    padding-bottom: var(--collaborator-spacing);
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  main {
    padding-top: clamp(16px, 3vh, 40px);
  }
}

/* NOTE: Name */

h1 {
  margin: 0;
  font-weight: 500;
  line-height: 1.04;
  font-style: italic;
  letter-spacing: -0.055em;
  font-variation-settings: "opsz" 72;
  font-size: clamp(56px, 16.5vw, 168px);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
}

h1 span {
  display: block;
}

@media (orientation: landscape) {
  h1 {
    font-size: clamp(56px, 8vw, 168px);
  }

  h1 span {
    display: inline;
  }
}

/* NOTE: Subtitle */

.subtitle {
  margin: 28px 0 0;
  line-height: 1.6;
  color: var(--muted);
  letter-spacing: -0.025em;
  font-size: clamp(17px, 1.9vw, 23px);
}

@media (orientation: landscape) {
  .subtitle {
    font-size: 21px;
    margin-top: 42px;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .subtitle {
    margin-top: 30px;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .subtitle {
    margin-top: 36px;
  }
}

@media (max-width: 900px) and (orientation: portrait) and (max-height: 800px) {
  .subtitle {
    margin-top: 28px;
  }
}

/* NOTE: Links */

nav {
  display: flex;
  gap: 10px 24px;
  flex-wrap: wrap;
  margin-top: 32px;
  max-width: 36rem;
}

@media (orientation: landscape) {
  nav {
    max-width: none;
    margin-top: 28px;
    justify-content: center;
  }

  nav a {
    font-size: 15px;
  }
}

@media (max-width: 900px), (orientation: portrait) {
  nav {
    gap: 0;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  nav {
    align-items: center;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  nav {
    gap: 4px 24px;
    margin-top: 24px;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  nav {
    margin-top: 36px;
  }
}

@media (max-width: 900px) and (orientation: portrait) and (max-height: 800px) {
  nav {
    margin-top: 28px;
  }
}

/* NOTE: Collaborators */

.collaborators h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
}

.company-logos {
  padding: 0;
  display: flex;
  gap: 20px 32px;
  flex-wrap: wrap;
  margin: 20px 0 0;
  list-style: none;
  align-items: center;
}

.company {
  gap: 8px;
  padding: 0;
  display: flex;
  min-height: 44px;
  align-items: center;
  color: var(--muted);
}

.company::after {
  content: none;
}

.company-mark {
  display: block;
  fill: currentColor;
  width: var(--logo-width, 100px);
  height: var(--logo-height, 26px);
}

.colorfy {
  --logo-width: 100px;
  --logo-height: 40px;
}

.endava {
  --logo-width: 106px;
}

.henkel {
  --logo-width: 75px;
  --logo-height: 40px;
}

.wino {
  --logo-width: 76px;
  --logo-height: 30px;
}

.iometer {
  --logo-width: 104px;
}

.skyroam {
  --logo-width: 112px;
}

.omniview {
  --logo-width: 144px;
}

.spotern {
  --logo-width: 92px;
}

.weekaway {
  --logo-width: 122px;
  --logo-height: 32px;
}

@media (orientation: landscape) {
  .collaborators {
    margin-top: clamp(56px, 8.5vh, 88px);
  }

  .company-logos {
    margin-top: 24px;
    justify-content: center;
  }
}

@media (orientation: portrait) {
  .collaborators {
    margin-top: var(--collaborator-spacing);
  }

  .company-logos {
    display: grid;
    gap: 16px 20px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .company-mark {
    max-width: 100%;
  }
}

@media (max-width: 900px) and (orientation: portrait) and (max-height: 800px) {
  .company-logos {
    row-gap: 16px;
    margin-top: 20px;
  }
}

@media (max-width: 900px) {
  .company-logos {
    display: grid;
    gap: 16px 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .company {
    min-height: 52px;
    justify-content: center;
  }

  .company-mark {
    max-width: 100%;
  }
}

/* NOTE: Footer */

footer {
  display: grid;
  margin-top: auto;
  align-items: center;
  background: transparent;
  grid-template-columns: 1fr auto 1fr;
}

.contact {
  grid-column: 2;
  justify-self: center;
}

@media (orientation: portrait) {
  footer {
    display: flex;
    margin-top: auto;
    justify-content: space-between;
  }
}

/* NOTE: Appearance picker */

.theme-picker {
  z-index: 10;
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
}

.theme-picker[hidden],
.appearance[hidden] {
  display: none;
}

.theme-toggle {
  border: 0;
  padding: 0;
  width: 44px;
  height: 44px;
  display: grid;
  cursor: pointer;
  border-radius: 50%;
  place-items: center;
  color: var(--muted);
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover,
.theme-toggle[aria-expanded="true"] {
  color: var(--foreground);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 4px;
}

.appearance {
  right: 0;
  top: 54px;
  margin: 0;
  width: 176px;
  padding: 8px;
  position: absolute;
  border-radius: 24px;
  color: var(--foreground);
  transform-origin: top right;
  box-shadow:
    inset 0 1px 0 #ffffff40,
    inset 0 -1px 0 #ffffff12,
    0 12px 40px #00000028;
  animation: reveal 160ms ease-out;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  background: color-mix(in srgb, var(--background) 76%, transparent);
  border: 1px solid color-mix(in srgb, var(--foreground) 16%, transparent);
  background-image: linear-gradient(145deg, #ffffff20, #ffffff02 45%, #ffffff0a);
}

.appearance label {
  display: block;
  cursor: pointer;
  position: relative;
  border-radius: 16px;
  -webkit-tap-highlight-color: transparent;
}

.appearance label + label {
  margin-top: 3px;
}

.appearance label > span {
  display: flex;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  padding: 13px 14px;
  border-radius: 16px;
  justify-content: space-between;
}

.appearance input:checked + span {
  background: color-mix(in srgb, var(--foreground) 8%, transparent);
}

.appearance input:checked + span::after {
  content: "✓";
}

.appearance label:hover > span,
.appearance label:active > span {
  background: color-mix(in srgb, var(--foreground) 12%, transparent);
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(-4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

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

@media (prefers-reduced-transparency: reduce) {
  .appearance {
    backdrop-filter: none;
    background: var(--background);
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  .theme-picker {
    top: auto;
    right: auto;
    position: relative;
  }

  .appearance {
    top: auto;
    bottom: 54px;
    transform-origin: bottom right;
  }
}
