/* Fonts are self-hosted and trimmed to Latin + Lithuanian letters, so the page needs no outside requests */
@font-face {
  font-family: "Cormorant Garamond";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-500-latin.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0, U+00A9, U+2013-2014, U+2019, U+201C-201E, U+2026;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-500-lithuanian.woff2") format("woff2");
  unicode-range: U+0104-0105, U+010C-010D, U+0116-0119, U+012E-012F, U+0160-0161, U+016A-016B, U+0172-0173, U+017D-017E;
}

@font-face {
  font-family: "Manrope";
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/manrope-variable-latin.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0, U+00A9, U+2013-2014, U+2019, U+201C-201E, U+2026;
}

@font-face {
  font-family: "Manrope";
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/manrope-variable-lithuanian.woff2") format("woff2");
  unicode-range: U+0104-0105, U+010C-010D, U+0116-0119, U+012E-012F, U+0160-0161, U+016A-016B, U+0172-0173, U+017D-017E;
}

:root {
  --espresso: #121110;
  --linen: #EAE6DF;
  --linen-muted: rgba(234, 230, 223, 0.74);
  --linen-faint: rgba(234, 230, 223, 0.56);
  --gold: #C5A880;
  --silk: #F4F1EA;
  --obsidian: #141413;
  --slate: #59554E;
  --bronze: #8C7355;
  --hair-on-dark: rgba(234, 230, 223, 0.24);
  --hair-on-light: rgba(28, 27, 25, 0.12);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: "Manrope", "DM Sans", system-ui, sans-serif;
  --column: 560px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--espresso);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.is-locked { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--linen);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

svg { display: block; flex: none; }

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Background: their own photograph, blurred at the CDN so the phone never pays for a live blur */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #d9c59e 0%, #d0c1a9 35%, #bbb1ad 65%, #966f53 100%);
}

.bg__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(1.04);
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}

.bg__img.is-loaded { opacity: 1; }

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(18, 17, 16, 0.74) 0%,
    rgba(18, 17, 16, 0.68) 38%,
    rgba(18, 17, 16, 0.62) 70%,
    rgba(18, 17, 16, 0.84) 100%
  );
}

/* Page column */
.page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    calc(env(safe-area-inset-top) + 16px)
    max(20px, env(safe-area-inset-right))
    calc(env(safe-area-inset-bottom) + 28px)
    max(20px, env(safe-area-inset-left));
}

.topbar {
  width: 100%;
  max-width: var(--column);
  display: flex;
  justify-content: flex-end;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hair-on-dark);
  border-radius: 4px;
  background: rgba(18, 17, 16, 0.5);
  color: var(--linen);
  transition: color 0.15s linear, border-color 0.15s linear;
}

.icon-btn svg { width: 18px; height: 18px; }

/* Profile */
.profile {
  width: 100%;
  max-width: var(--column);
  margin-top: clamp(16px, 6vh, 64px);
  text-align: center;
}

.profile__mark { margin: 0; }

.profile__avatar {
  display: block;
  width: 150px;
  margin: 0 auto;
}

.profile__avatar img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 480 / 395;
}

.profile__line {
  margin: 28px 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 9vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--linen);
}

.profile__origin {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--linen);
}

/* Links, built on the Linktree anatomy: icon slot, centred label, options menu */
.links {
  list-style: none;
  width: 100%;
  max-width: var(--column);
  margin: 34px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.link { position: relative; }

.link__main {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  min-height: 68px;
  padding: 9px 0;
  background: var(--silk);
  color: var(--espresso);
  border: 1px solid var(--silk);
  border-radius: 4px;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
  transition: border-color 0.15s linear, background-color 0.15s linear;
}

.link--feature .link__main {
  background: var(--gold);
  border-color: var(--gold);
}

.link__icon {
  display: grid;
  place-items: center;
}

.link__icon svg { width: 22px; height: 22px; }

.link__label {
  grid-column: 2;
  text-align: center;
  padding: 0 4px;
  text-wrap: balance;
}

.link__name { display: block; }

.link__sub {
  display: block;
  margin-top: 1px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(18, 17, 16, 0.62);
}

.nowrap { white-space: nowrap; }

.link__more {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: rgba(18, 17, 16, 0.55);
  transition: color 0.4s var(--ease);
}

.link__more svg { width: 18px; height: 18px; }

/* Footer */
.footer {
  margin-top: auto;
  padding-top: 64px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--linen-faint);
  text-align: center;
}

.footer__brand {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--linen-muted);
}


@media (hover: hover) and (pointer: fine) {
  .link__main:hover { border-color: var(--espresso); }
  .link--feature .link__main:hover { border-color: var(--espresso); }
  .link__more:hover { color: var(--espresso); }
  .icon-btn:hover { color: var(--gold); border-color: var(--gold); }
  .sheet__action:hover { color: var(--bronze); }
  .sheet__close:hover { opacity: 0.6; }
}

/* Options sheet */
.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.sheet-layer[hidden] { display: none; }

.sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgba(18, 17, 16, 0.6);
  opacity: 0;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: var(--column);
  margin: 0 auto;
  padding: 24px 20px calc(env(safe-area-inset-bottom) + 12px);
  background: var(--silk);
  color: var(--obsidian);
  border-radius: 4px 4px 0 0;
  transform: translateY(100%);
  outline: none;
}

.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sheet__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.sheet__close {
  width: 44px;
  height: 44px;
  margin: -8px -10px 0 0;
  display: grid;
  place-items: center;
  border-radius: 2px;
  color: var(--obsidian);
  transition: opacity 0.4s var(--ease);
}

.sheet__close svg { width: 20px; height: 20px; }

.sheet__url {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--slate);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet__actions {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  border-top: 1px solid var(--hair-on-light);
}

.sheet__actions li { border-bottom: 1px solid var(--hair-on-light); }
.sheet__actions li[hidden] { display: none; }

.sheet__action {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  color: var(--obsidian);
  transition: color 0.4s var(--ease);
}

.sheet__action svg { width: 20px; height: 20px; }

/* Confirmation */
.toast {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 24px);
  z-index: 30;
  width: max-content;
  max-width: calc(100% - 40px);
  margin: 0 auto;
  padding: 12px 18px;
  background: var(--linen);
  color: var(--espresso);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
}

/* Hidden until the entrance sequence takes them; removed if script never runs */
.is-intro .profile__mark,
.is-intro [data-intro],
.is-intro .link { opacity: 0; }

.hero { display: none; }

/* Computer: photo on the left, links on the right */
@media (min-width: 960px) {
  :root { --column: 440px; }

  .bg { display: none; }

  .hero {
    display: block;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 56%;
    background: var(--espresso) url("../img/hero.webp") 50% 50% / cover no-repeat;
  }

  .page {
    position: relative;
    width: 44%;
    min-height: 100vh;
    margin-left: 56%;
    justify-content: center;
    padding: 64px 48px;
  }

  .topbar {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    padding: 0 32px;
    max-width: none;
  }

  .profile { margin-top: 0; }
  .footer { margin-top: 48px; padding-top: 0; }
}

@media (min-width: 768px) {
  .profile { margin-top: 72px; }
  .profile__avatar { width: 170px; }
  .links { gap: 16px; }
  .link__main { min-height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
