html { background: var(--navy-dark); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  background: radial-gradient(ellipse 60% 55% at 50% 30%, #12244a 0%, rgb(18 36 74 / 0) 100%) var(--navy-dark);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1:focus { outline: none; }

.top, .foot { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; }
.top { padding-top: max(14px, env(safe-area-inset-top)); }
.top__logo img { display: block; width: 132px; height: auto; }
.top__tools { display: flex; align-items: center; gap: 24px; }
@media (max-width: 420px) { .top__tools { gap: 16px; } }
@media (max-width: 380px) { .top__tools { gap: 12px; } .top__logo img { width: 88px; } .top { padding-left: 16px; padding-right: 16px; } }
.top__lang { display: inline-flex; align-items: center; gap: 6px; min-width: 44px; height: 44px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-decoration: none; }
.top__lang:hover { color: var(--gold); }
.foot { font-size: 12px; color: var(--ink-muted); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.foot__links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 20px; text-align: right; }
.foot a { padding: 12px 0; }
.foot a:hover { color: var(--gold); }

.layout { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; width: 100%; }
.globe-box {
  position: relative;
  flex: none;
  height: min(47svh, 112vw);
  min-height: 260px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
@property --veil { syntax: "<number>"; inherits: false; initial-value: 1; }
.ground { position: absolute; inset: 0; overflow: hidden; overflow: clip; pointer-events: none; }
.ground__pin { position: relative; height: 0; margin-top: var(--floor, 100vh); opacity: 0; transition: opacity .8s; }
.has-floor .ground__pin { opacity: 1; }
.ground__snow {
  --w: max(var(--R) * 6, var(--floor-x) / .72, (100vw - var(--floor-x)) / .27);
  position: absolute;
  left: calc(var(--floor-x) - var(--w) * .726);
  top: calc(var(--R) * -.36 - var(--w) * .0465);
  width: var(--w);
  aspect-ratio: 1721 / 314;
  background: url(../assets/snieg_ziemia.webp) 0 0 / 100% 100%;
  -webkit-mask-image: linear-gradient(#000 62%, transparent 99%), linear-gradient(90deg, rgb(0 0 0 / var(--veil)) 40%, #000 60%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(#000 62%, transparent 99%), linear-gradient(90deg, rgb(0 0 0 / var(--veil)) 40%, #000 60%);
  mask-composite: intersect;
  transition: --veil .6s;
}
.ground-front {
  --b: calc(var(--R) * var(--base-w));
  position: absolute;
  left: calc(50% + var(--R) * (var(--base-left) - 1) - var(--b) * .0893);
  top: calc(50% + var(--R) * (1 + var(--base-top) + var(--base-h)) / 2 - var(--b) * .1518);
  width: calc(var(--b) * 1.1786);
  height: auto;
  opacity: 0;
  transition: opacity .8s;
  pointer-events: none;
}
.has-floor .ground-front { opacity: 1; }
[data-view="choose"] .globe-box { height: min(40svh, 100vw); min-height: 240px; }
[data-view="form"] .globe-box, [data-view="share"] .globe-box { height: min(32svh, 90vw); min-height: 210px; }
.copy { width: 100%; max-width: 560px; margin: 0 auto; padding: clamp(22px, 4svh, 36px) 24px 16px; text-align: center; }
.screen { animation: arrive .7s ease both; }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

h1 { margin: 0 0 14px; font: italic 400 clamp(28px, 1.2rem + 2.6vw, 52px)/1.18 var(--font-heading); text-wrap: balance; }
h1 em { color: var(--gold); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  h1 em {
    margin-right: -.12em;
    padding-right: .12em;
    background: linear-gradient(105deg, var(--gold) 36%, #A06C42 44%, #FFF1DE 49%, #FFF1DE 51%, #A06C42 56%, var(--gold) 64%) 100% 0 / 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gold-shine 10s ease-in-out infinite;
  }
}
@keyframes gold-shine { 0%, 20% { background-position: 100% 0; } 65%, 100% { background-position: 0 0; } }
.lead { margin: 0 0 22px; color: var(--ink); text-wrap: pretty; }
#s-start .lead { margin-bottom: 44px; }
.wish { white-space: pre-line; overflow-wrap: anywhere; }
.wish:not(.wish--own) { font: italic 300 clamp(21px, 19.5px + .4vw, 23px)/1.5 var(--font-heading); }
.name { margin: 0 0 8px; color: #fff; font: italic 400 clamp(22px, 1rem + 1vw, 28px)/1.3 var(--font-heading); overflow-wrap: anywhere; }
.signature { margin: 0 0 2px; font: italic 300 18px/1.5 var(--font-heading); color: #fff; }
.name:empty { display: none; }
#s-final h1 { margin-bottom: 36px; }
.name--from { margin-bottom: 60px; }

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 14px 26px;
  border: 0;
  background: var(--burgundy);
  color: #fff;
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s;
}
.cta-arrow { flex-shrink: 0; animation: arrow-nudge 1.6s ease-in-out infinite; }
@keyframes arrow-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
.cta:hover { background: var(--burgundy-dark); }
.cta--outline { border: 2px solid #fff; background: none; color: #fff; }
.cta--outline:hover { border-color: var(--burgundy); background: var(--burgundy); }
.link { min-height: 44px; border: 0; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 5px; cursor: pointer; }
:is(#s-form, #s-final) .link { color: var(--ink-muted); }
.link:hover, :is(#s-form, #s-final) .link:hover { color: var(--gold); }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 24px; }
.status { min-height: 1.6em; margin: 10px 0 0; font-size: 14px; color: var(--gold); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choices button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  text-align: left;
  line-height: 1.3;
  background: rgb(7 18 41 / .7);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.choices button:hover { border-color: var(--gold); color: var(--gold); }

.wish-ico { flex: none; width: 44px; height: 44px; transition: transform .35s cubic-bezier(.34, 1.4, .64, 1); }
@media (max-width: 400px) { .choices button { padding-inline: 8px; gap: 8px; } .wish-ico { width: 36px; height: 36px; } }
@media (max-width: 340px) { .choices button { padding-inline: 6px; gap: 6px; } }
@media (hover: hover) { .choices button:hover .wish-ico { transform: rotate(-12deg) scale(1.06); } }
.choices button:focus-visible .wish-ico { transform: rotate(-12deg) scale(1.06); }

.option { margin-top: 26px; text-align: left; }
.option h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; color: #fff; }
.option h2 span { display: block; margin-bottom: 2px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.option h2 + p { margin: 2px 0 10px; font-size: 14px; line-height: 1.5; color: var(--ink-muted); text-wrap: pretty; }

.channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.channels > * {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: rgb(7 18 41 / .7);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.channels > :hover, .sharelink button:hover { border-color: var(--gold); color: var(--gold); }
.ch__ico { flex: none; width: 20px; height: 20px; color: var(--gold); }
.sharelink { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.sharelink input { min-width: 0; min-height: 46px; padding: 8px 12px; border: 1px solid #6f7a94; border-radius: 0; background: var(--space-soft); color: var(--ink); text-overflow: ellipsis; }
.sharelink button { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; }
#shareStatus:empty { display: none; }
#s-share .actions { margin: 48px 0 0; }
@media (max-width: 480px), (orientation: landscape) and (max-width: 899px) {
  .channels > * { flex-direction: column; justify-content: center; gap: 5px; min-height: 64px; padding: 8px 4px; font-size: 13px; text-align: center; }
}
#shareOther { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; justify-self: start; gap: 9px; min-height: 44px; padding: 8px 0; border: 0; background: none; font-size: 15px; }
.note { margin: 14px 0 0; font-size: 13px; color: var(--ink-muted); }
.note button { padding: 12px 0; border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.note button:disabled { opacity: .5; cursor: default; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.cta:disabled { opacity: .6; cursor: wait; }

form { display: grid; gap: 14px; margin-top: 24px; text-align: left; }
.field { position: relative; min-width: 0; }
.field label {
  position: relative;
  z-index: 1;
  display: block;
  width: fit-content;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-muted);
  transform-origin: 0 50%;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1), color .25s;
  pointer-events: none;
}
.field:not(:focus-within):has(:placeholder-shown) label { transform: translateY(23px) scale(1.2); color: var(--ink); }
.field:focus-within label { color: var(--gold); }
.field__req { color: var(--error); }
.field__control { position: relative; display: grid; }
.field__control > * { grid-area: 1 / 1; }
.field__control::after {
  content: "";
  align-self: end;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
}
.field__control:focus-within::after { transform: none; }
.field__control:has([aria-invalid="true"])::after { background: var(--error); transform: none; }
.field__icon { display: none; align-self: center; justify-self: end; color: var(--error); pointer-events: none; }
textarea + .field__icon { align-self: start; margin-top: 10px; }
.field :is(input, textarea) {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 7px 0 8px;
  border: 0;
  border-bottom: 1px solid #8b95ad;
  border-radius: 0;
  outline: 0;
  background: none;
  color: #fff;
  font-size: 18px;
  line-height: 28px;
}
.field :is(#to, #from) { font: italic 400 21px/28px var(--font-heading); }
.field textarea { min-height: 72px; padding-right: 32px; resize: none; }
@media (max-width: 380px) { .field textarea { min-height: 100px; } }
.field ::placeholder { color: var(--ink-muted); opacity: 0; transition: opacity .2s; }
.field :focus::placeholder { opacity: 1; }
.field :autofill { -webkit-text-fill-color: #fff; transition: background-color 99999s; }
.field [aria-invalid="true"] { border-color: var(--error); padding-right: 32px; }
.field [aria-invalid="true"] + .field__icon { display: block; }
.field__count { position: absolute; top: 0; right: 0; font-size: 12px; line-height: 20px; color: var(--ink-muted); }
.field__err { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--error); }
.field__err:empty { display: none; }
form .info { margin: 14px 0; font-size: 12px; line-height: 1.5; color: #fff; }
form .lead { margin: 4px 0; }
form .signature { margin: 4px 0 0; }
form[inert] { opacity: .75; }
form .actions { margin-top: 4px; }

.mute span { text-transform: uppercase; }
@media (max-width: 899px) { .mute { justify-content: center; width: 44px; } .mute span { display: none; } .mute svg { width: 22px; height: 22px; } }

@media (max-width: 599px) and (max-height: 700px) { .globe-box { height: min(45svh, 112vw); } .copy { padding-top: 22px; } #s-start .lead { margin-bottom: 32px; } }
@media (max-width: 899px) { [data-view="share"] .hint { display: none; } }

@media (min-width: 900px), (orientation: landscape) and (min-width: 600px) {
  body { background: radial-gradient(ellipse 50% 70% at 74% 48%, #12244a 0%, rgb(18 36 74 / 0) 100%) var(--navy-dark); }
  .top, .foot { padding-left: 8vw; padding-right: 8vw; }
  .layout { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 3vw; padding: 0 4vw 0 8vw; }
  .ground__pin { position: sticky; top: var(--floor-in, 0); }
  .ground__snow { --w: max(var(--R) * 4.6, var(--floor-x) / .72, (100vw - var(--floor-x)) / .27); }
  :is([data-view="choose"], [data-view="form"], [data-view="final"], [data-view="share"]) .ground__snow { --veil: .25; }
  .foot { color: var(--ink); }
  .globe-box, [data-view] .globe-box { order: 2; align-self: start; position: sticky; top: 0; height: calc(100svh - 190px); min-height: 220px; }
  .copy { order: 1; display: flex; flex-direction: column; align-self: stretch; margin: 0; padding: 0; text-align: left; }
  .copy::before, .copy::after { content: ""; flex: 1 0 0; min-height: 16px; }
  .actions { justify-content: flex-start; }
}
@media (min-width: 900px) {
  .top { padding-top: 26px; }
  .top__logo img { width: 180px; }
  h1 { margin-bottom: 20px; }
  .copy::before { min-height: clamp(24px, 16svh - 46px, 88px); }
  [data-view="form"] .copy::before { min-height: 24px; }
  .lead { font-size: 18px; margin-bottom: 30px; max-width: 480px; }
  #s-start .lead { margin-bottom: 60px; }
  .lead.wish { max-width: none; }
  [data-view="start"] .copy::after { flex-basis: 10svh; }
  #s-final h1 { margin-bottom: 48px; }
  .name--from { margin-bottom: 72px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .layout { align-items: start; }
  .copy::before { min-height: 24px; }
  .globe-box, [data-view] .globe-box { height: calc(100svh - 84px); }
  h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { .screen, .cta-arrow, h1 em { animation: none !important; } .field label, .field__control::after, .field ::placeholder, .cta, .choices button, .wish-ico { transition: none; } .choices button .wish-ico { transform: none !important; } }
