:root {
  --black: #050505;
  --white: #efede5;
  --blue: #086bff;
  --yellow: #ffd500;
  --red: #df261b;
  --grey: #858585;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--black);
}

body {
  min-width: 320px;
  color: var(--white);
  font-family: "Courier New", monospace;
  overflow: hidden;
}

::selection { color: var(--black); background: var(--yellow); }

.grain {
  position: fixed;
  z-index: 20;
  inset: 0;
  opacity: .035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { height: calc(100svh - 40px); }

.intro {
  position: relative;
  height: 100%;
  padding: clamp(24px, 5vh, 60px) clamp(18px, 6vw, 90px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, .82fr);
  gap: 6vw;
  align-items: center;
  overflow: hidden;
}

.copy, .symbols { position: relative; z-index: 1; }

.kicker {
  margin: 0 0 18px;
  color: var(--grey);
  font-size: 9px;
  letter-spacing: .12em;
}

.whoami {
  margin: 0;
  color: var(--white);
  font-size: clamp(18px, 2vw, 28px);
  font-weight: bold;
}

.whoami span { color: var(--yellow); }

.contact-row {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.xmpp, button {
  padding: 15px 18px;
  border: 1px solid var(--yellow);
  font: bold clamp(12px, 1.15vw, 15px) "Courier New", monospace;
}

.xmpp {
  color: var(--black);
  background: var(--yellow);
  text-decoration: none;
}

button {
  color: var(--grey);
  border-color: #404040;
  background: none;
  cursor: pointer;
}

button:hover { color: var(--white); border-color: var(--white); }

.clipboard-button {
  width: 49px;
  height: 49px;
  padding: 0;
  display: grid;
  flex: 0 0 49px;
  place-items: center;
}

.clipboard-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.clipboard-button.copied { color: var(--yellow); border-color: var(--yellow); }

.symbols {
  position: relative;
  width: min(100%, 520px);
  height: min(58vh, 460px);
  justify-self: center;
}

.flag-wrap { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

.flag-caption {
  display: inline-block;
  margin: 0 0 9px 14px;
  color: var(--grey);
  font-size: 8px;
  letter-spacing: .15em;
}

.flag-row { display: flex; align-items: flex-start; perspective: 800px; }

.pole {
  flex: 0 0 7px;
  height: min(36vh, 290px);
  border: 1px solid #777;
  background: linear-gradient(90deg, #222, #ddd, #555);
}

.flag {
  display: flex;
  width: min(31vw, 400px);
  height: min(29vh, 235px);
  filter: drop-shadow(12px 15px 12px #000);
  transform-style: preserve-3d;
}

.flag-strip {
  height: 100%;
  margin-left: -1px;
  background: linear-gradient(#070707 0 50%, var(--red) 50% 100%);
  animation: wave 1.9s ease-in-out infinite alternate;
  transform-origin: left center;
}

@keyframes wave {
  from { transform: translateY(var(--lift-from)) rotateY(var(--rot-from)); filter: brightness(var(--bright-from)); }
  to { transform: translateY(var(--lift-to)) rotateY(var(--rot-to)); filter: brightness(var(--bright-to)); }
}

.ticker {
  height: 40px;
  overflow: hidden;
  color: #050505;
  background: var(--yellow);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 18s linear infinite;
}

.ticker-group {
  display: flex;
  flex-shrink: 0;
  min-width: 100vw;
}

.ticker span {
  padding: 12px 0;
  font: 900 13px Arial, sans-serif;
  white-space: nowrap;
}

@keyframes ticker { to { transform: translateX(-50%); } }

@media (max-width: 760px) {
  main { height: calc(100svh - 36px); }
  .intro {
    padding: 24px 16px 10px;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 12px;
    align-items: start;
  }
  .kicker { margin-bottom: 12px; font-size: 7px; }
  .whoami { font-size: clamp(16px, 4.5vw, 21px); }
  .contact-row { margin-top: 12px; }
  .xmpp, button { padding: 12px 13px; font-size: 11px; }
  .clipboard-button { width: 42px; height: 42px; padding: 0; flex-basis: 42px; }
  .clipboard-button svg { width: 19px; height: 19px; }
  .symbols {
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }
  .flag-wrap { position: static; transform: none; }
  .flag-caption { display: none; }
  .pole { flex-basis: 4px; height: min(17vh, 115px); }
  .flag { width: min(42vw, 165px); height: min(14vh, 95px); }
  .ticker { height: 36px; }
  .ticker span { padding: 10px 0; font-size: 11px; }
}

@media (max-height: 610px) {
  .contact-row { margin-top: 14px; }
  .symbols { transform: scale(.86); transform-origin: top center; }
}

@media (prefers-reduced-motion: reduce) {
  .flag-strip, .ticker-track { animation: none; }
}
