@layer base, components, utilities;

@import "./stylecheat.css";
@import "./nodemodules/@ape-egg/vibe/vibe.css";
@import "./fonts.css";
@import "./colors.css";
@import "./nav.css";
@import "./scrollbar.css";
@import "./live-code-editor.css";
@import "./demo-styles.css";
@import "./tutorial-styles.css";
@import "./aside.css";

@view-transition {
  navigation: auto;
}

/* Root - quick fade */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.25s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  overflow: hidden;
  background: var(--background);
  color: oklch(from var(--foreground) calc(l + 0.25) c h);
  font-family: "Geist", sans-serif;
  padding-top: 12px;
  -webkit-font-smoothing: antialiased;
}
.flex-1 {
  flex: 1;
}

sticky {
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  right: 0;
  width: 100%;
  padding: calc(var(--unit) * 3);
  order: -1;
  font-size: calc(var(--unit) * 4);
  background: linear-gradient(
    to bottom,
    oklch(from var(--card) l c h / 100%) 0%,
    oklch(from var(--card) l c h / 90%) 66%,
    transparent 100%
  );
}
sticky h3 {
  font-size: 1em;
  font-weight: 500;
}
sticky crow {
  opacity: 0;
  transition: opacity 250ms ease-in-out;
}
sticky icon {
  outline: 1px solid var(--border);
  transition: background 150ms ease-in-out;
}

textarea {
  width: 100%;
}
main {
  height: calc(100vh - 12px);
  overflow-y: scroll;
  min-width: 0;
  margin-right: -11px;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-top-left-radius: calc(var(--radius) - 4px);
  position: relative;
  justify-content: space-between;
}
article {
  padding: calc(var(--unit) * 6) calc(var(--unit) * 6);
  max-width: 1080px;
  min-width: 0;
  min-height: 100%;
  overflow-wrap: break-word;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Emphasis text - black and italic */
[emphasis] {
  color: var(--foreground);
  font-style: italic;
}

/* Article footer - sticky at bottom */
article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding: calc(var(--unit) * 4) 0;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  margin-bottom: calc(var(--unit) * -6);
  background: var(--card);
}
article-footer > span {
  color: var(--muted-foreground);
  font-size: calc(var(--unit) * 3);
}
article-footer a {
  display: flex;
  align-items: center;
  gap: calc(var(--unit) * 2);
  padding: calc(var(--unit) * 2) calc(var(--unit) * 3);
  border-radius: var(--radius);
  color: var(--primary);
  text-decoration: none;
  transition: background 150ms ease;
}
article-footer a:hover {
  background: oklch(from var(--primary) l c h / 0.1);
}
