/* Duck — one screen.
   Cream paper, ink text, one orange. Fraunces for the headline, Inter for the button.
   Everything else is space. */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4efe6;
  --card: #fbf8f3;
  --ink: #14120f;
  --muted: #6f675c;
  --line: #e6dfd3;
  --edge: #cfc6b8;
  --orange: #ff2e00;
  --serif: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
  --sans: "Inter", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
/* A whisper of paper grain, so the cream reads as a surface and not a colour. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
::selection { background: var(--ink); color: var(--paper); }

/* ---------- the screen ---------- */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding: 24px clamp(20px, 5vw, 48px) calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(36px, 6vh, 64px);
  text-align: center;
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  font-size: clamp(56px, 10vw, 120px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  margin: 0;
}

/* ---------- the demo ---------- */
.demo { width: min(100%, 720px); }
.bar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  height: 64px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(60, 44, 20, 0.07), 0 1px 2px rgba(60, 44, 20, 0.04);
}
.bar-left { display: flex; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.bar-right { display: flex; align-items: center; gap: 22px; }
.hides, .stays { display: flex; gap: 22px; }
.hides svg, .stays svg, .mark svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* Everything but the mark is faded, so the eye lands on the mark. */
.hides, .stays, .clock { color: var(--ink); opacity: 0.32; }
.hides { animation: duck 6s var(--ease) infinite; }
.mark { color: var(--orange); display: inline-flex; animation: turn 6s var(--ease) infinite; }
.mark svg { stroke-width: 2.4; }
.clock { font-size: 15px; font-variant-numeric: tabular-nums; margin-left: 4px; }

/* Showing for the first half, a quick slide out, hidden for a while, then a quick slide back. */
@keyframes duck {
  0%, 40%   { transform: translateX(0); opacity: 0.32; }
  47%, 88%  { transform: translateX(-140px); opacity: 0; }
  95%, 100% { transform: translateX(0); opacity: 0.32; }
}
@keyframes turn {
  0%, 40%   { transform: rotate(45deg); }
  47%, 88%  { transform: rotate(0deg); }
  95%, 100% { transform: rotate(45deg); }
}

/* ---------- the button ---------- */
.button {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  transition: background 0.2s, color 0.2s;
}
.button:hover, .button:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.button:active { opacity: 0.85; }

button.button { cursor: pointer; }
/* After the click the button is no longer a button: the same words, no border, no fill. */
.button.done, .button.done:hover, .button.done:focus-visible {
  background: transparent;
  border-color: transparent;
  color: var(--ink);
  cursor: default;
}
/* The line itself, shown only when the clipboard was refused. */
.line {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  max-width: 100%;
  margin-top: -20px;
  padding: 0 8px;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}

/* ---------- arrival ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.9s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 140ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .hides, .mark { animation: none; }
  .mark { transform: rotate(45deg); }
  .button { transition: none; }
}

@media (max-width: 520px) {
  .bar { height: 56px; padding: 0 16px; }
  .bar-right, .hides, .stays { gap: 16px; }
  .clock { display: none; }
}
