:root {
  --bg: #090a0c;
  --bg-raised: #0f1114;
  --ink: #eef1f0;
  --muted: #6b7570;
  --cyan: #00f6ff;
  --magenta: #ff00c8;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  overflow: hidden;
}

#glitch-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(22px, 4vh, 40px);
  padding: clamp(24px, 6vw, 80px);
  max-width: 900px;
}

.mark {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mark-logo {
  display: block;
  height: 13px;
  width: auto;
}

.mark .cursor-blink {
  font-size: 13px;
}

.corner-link {
  position: fixed;
  top: clamp(20px, 4vh, 36px);
  right: clamp(24px, 6vw, 80px);
  z-index: 2;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.corner-link-arrow {
  display: inline-block;
  transition: transform 0.15s ease;
}

.corner-link:hover,
.corner-link:focus-visible {
  color: var(--cyan);
}

.corner-link:hover .corner-link-arrow,
.corner-link:focus-visible .corner-link-arrow {
  transform: translateX(3px);
}

.corner-link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

@media (max-width: 520px) {
  .corner-link {
    top: 20px;
    right: 20px;
  }
}

.cursor-blink {
  color: var(--cyan);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.punchline {
  position: relative;
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(30px, 5.2vw, 62px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--ink);
}

/* glitch pass: two colour-split copies of the same text, hidden by default,
   flashed on briefly and rarely by JS toggling .is-glitching */
.punchline::before,
.punchline::after {
  content: attr(data-text);
  white-space: pre;
  position: absolute;
  inset: 0;
  opacity: 0;
}

.punchline::before {
  color: var(--cyan);
  transform: translate(0, 0);
  mix-blend-mode: screen;
}

.punchline::after {
  color: var(--magenta);
  transform: translate(0, 0);
  mix-blend-mode: screen;
}

.punchline.is-glitching::before {
  opacity: 0.85;
  animation: glitch-shift-a 0.42s steps(2, jump-none);
}

.punchline.is-glitching::after {
  opacity: 0.85;
  animation: glitch-shift-b 0.42s steps(2, jump-none);
}

@keyframes glitch-shift-a {
  0% {
    transform: translate(0, 0);
    clip-path: inset(0 0 82% 0);
  }
  30% {
    transform: translate(-3px, 1px);
    clip-path: inset(20% 0 40% 0);
  }
  60% {
    transform: translate(3px, -1px);
    clip-path: inset(60% 0 5% 0);
  }
  100% {
    transform: translate(0, 0);
    clip-path: inset(0 0 100% 0);
  }
}

@keyframes glitch-shift-b {
  0% {
    transform: translate(0, 0);
    clip-path: inset(70% 0 0 0);
  }
  30% {
    transform: translate(3px, -1px);
    clip-path: inset(10% 0 55% 0);
  }
  60% {
    transform: translate(-3px, 1px);
    clip-path: inset(45% 0 20% 0);
  }
  100% {
    transform: translate(0, 0);
    clip-path: inset(100% 0 0 0);
  }
}

.headline-group {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.2vh, 22px);
}

.info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-line {
  margin: 0;
  font-size: clamp(10px, 1.1vw, 12px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
}

.contact {
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(14px, 1.8vw, 17px);
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--muted);
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.contact:hover,
.contact:focus-visible {
  color: var(--cyan);
  border-color: var(--cyan);
}

.contact:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .cursor-blink {
    animation: none;
    opacity: 1;
  }
  .punchline.is-glitching::before,
  .punchline.is-glitching::after {
    animation: none;
    opacity: 0;
  }
}

@media (max-width: 520px) {
  body {
    overflow: auto;
  }
  .stage {
    justify-content: flex-start;
    padding-top: clamp(60px, 14vh, 100px);
  }
}

/* Language toggle: two inline spans per translatable node, one shown at a
   time via the html[data-lang] attribute. Keeps translations next to their
   source in the markup instead of a separate lookup file, and the hidden
   language is display:none, so it drops out of the accessibility tree too. */
[data-lang-content="pt"] {
  display: none;
}

html[data-lang="pt"] [data-lang-content="pt"] {
  display: inline;
}

html[data-lang="pt"] [data-lang-content="en"] {
  display: none;
}

.lang-toggle {
  position: fixed;
  /* Right edge matches .corner-link's clamp(24px, 6vw, 80px) exactly: the
     backdrop pill below adds 7px of padding pulled back by an equal
     negative margin, which shifts the visible edge 7px outward from
     whatever this `right` value says, so it's compensated for here. */
  right: clamp(31px, calc(6vw + 7px), 87px);
  bottom: clamp(20px, 4vh, 36px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(9, 10, 12, 0.75);
  backdrop-filter: blur(6px);
  padding: 5px 7px;
  margin: -5px -7px;
  border-radius: 4px;
}

.lang-btn {
  background: none;
  border: none;
  padding: 2px;
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.lang-btn[aria-current="true"] {
  color: var(--ink);
}

.lang-btn:hover,
.lang-btn:focus-visible {
  color: var(--cyan);
}

.lang-toggle-sep {
  font-size: 10px;
  color: var(--muted);
}

@media (max-width: 520px) {
  .lang-toggle {
    right: 27px;
    bottom: 20px;
  }
}
