/* Shared homepage UI. Source: altai-home/home-ui.css.
   Shift Card pattern: https://www.cult-ui.com/docs/components/shift-card */
:root {
  --bg: #ece2d9;
  --ink: #111111;
  --muted: rgba(17, 17, 17, 0.6);
  --faint: rgba(17, 17, 17, 0.55);
  --rule: rgba(17, 17, 17, 0.14);
  --card-bg: rgba(255, 255, 255, 0.34);
  --card-border: white;
  --card-shadow: rgba(0, 0, 0, 0.12);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --space-card: 22px;
  --radius-card: 17px;
  --radius-control: 8px;
  --font-label: 12px;
  --spring-out: cubic-bezier(0.2, 1.25, 0.4, 1);
  --reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #15130f;
    --ink: #f0e9e1;
    --muted: rgba(240, 233, 225, 0.65);
    --faint: rgba(240, 233, 225, 0.6);
    --rule: rgba(240, 233, 225, 0.14);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.16);
    --card-shadow: rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #15130f;
  --ink: #f0e9e1;
  --muted: rgba(240, 233, 225, 0.65);
  --faint: rgba(240, 233, 225, 0.6);
  --rule: rgba(240, 233, 225, 0.14);
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.16);
  --card-shadow: rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

/* Shift Card interaction adapted for static sites from Cult UI. */
.project {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: var(--space-card);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: 12px 17px 51px var(--card-shadow);
  color: inherit;
  text-decoration: none;
  transition:
    transform 360ms var(--spring-out),
    border-color 180ms ease-out,
    box-shadow 240ms ease-out;
}

/* The lift and spring return follow the Transitions.dev hover examples. */
@media (hover: hover) and (pointer: fine) {
  a.project:hover {
    border-color: var(--ink);
    box-shadow: 12px 22px 51px var(--card-shadow);
    transform: translateY(-4px);
  }
}

a.project:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

a.project:active {
  transform: scale(0.985);
  transition-duration: 120ms;
}

.project-preview {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 480 / 252;
  margin-bottom: 10px;
  border-radius: var(--radius-control);
  object-fit: cover;
  background: var(--bg);
  transition: transform 360ms var(--spring-out);
}

@media (hover: hover) and (pointer: fine) {
  a.project:hover .project-preview {
    transform: translateY(-3px);
  }
}

.project-name {
  font-size: var(--font-label);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.project-desc {
  margin-bottom: 14px;
  color: var(--muted);
}

.project-status {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color 0.3s var(--ease);
}

a.project:hover .project-status,
a.project:focus-visible .project-status {
  color: var(--ink);
}

/* Transitions.dev: Learn more hover, shift and spread tuned for 12px chevrons */
.chevron {
  display: inline-flex;
  transition: transform 350ms var(--reveal-ease);
}

.chevron--out {
  rotate: -45deg;
}

.chevron-arm {
  transform-box: view-box;
  transform-origin: 10px 8px;
  transition: transform 350ms var(--reveal-ease);
}

a:hover .chevron,
a:focus-visible .chevron {
  transform: translateX(2px);
}

a:hover .chevron-arm-top,
a:focus-visible .chevron-arm-top {
  transform: rotate(8deg);
}

a:hover .chevron-arm-bot,
a:focus-visible .chevron-arm-bot {
  transform: rotate(-8deg);
}

/* Transitions.dev: Texts reveal, as a keyframe because no script may add .is-shown */
.reveal {
  animation: reveal 500ms var(--reveal-ease) calc(600ms + 80ms * var(--i)) both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(3px);
  }
}

.theme-switch {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1; /* the animated hero forms a layer that would otherwise cover the switch */
  width: 48px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--ink);
  cursor: pointer;
}
/* Grows the tap target to 44px tall without changing how the switch looks */
.theme-switch::before {
  content: '';
  position: absolute;
  inset: -8px;
}
.theme-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 350ms var(--spring-out);
}
.theme-switch[aria-checked='true'] .theme-knob {
  transform: translateX(20px);
}
.theme-switch svg {
  position: absolute;
  top: 6px;
  width: 14px;
  height: 14px;
}
.theme-moon {
  right: 6px;
}
.theme-sun {
  left: 6px;
}
.theme-switch .theme-moon,
.theme-switch .theme-sun {
  transition:
    opacity 150ms ease-out,
    transform 250ms var(--spring-out);
}
.theme-switch:not([aria-checked='true']) .theme-sun,
.theme-switch[aria-checked='true'] .theme-moon {
  opacity: 0;
  transform: scale(0.65);
}

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

  .project,
  .project-preview,
  .theme-knob,
  .theme-switch .theme-moon,
  .theme-switch .theme-sun,
  .chevron,
  .chevron-arm {
    transition: none;
  }

  a.project:hover,
  a.project:active,
  a.project:hover .project-preview,
  a:hover .chevron,
  a:focus-visible .chevron,
  a:hover .chevron-arm,
  a:focus-visible .chevron-arm {
    transform: none;
  }
}
