/* ============================================================
   Tomáš Březina — “březina”, a birch grove at night
   Single-purpose stylesheet for the personal microsite.
   ============================================================ */

/* ---------- Fonts (self-hosted, subset by unicode-range) ---------- */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/fraunces-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/fraunces-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/fraunces-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: dark;

  --night-0: #040806;
  --night-1: #081009;
  --night-2: #0c1610;

  --bone: #e6e1d3;
  --bone-dim: #b9b4a5;
  --ink-soft: #8f8b7d;

  --ember: #f0bd66;
  --ember-soft: #d9ad64;

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --ease-out: cubic-bezier(.19, .8, .26, 1);
}

/* ---------- Reset (minimal) ---------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
a { color: inherit; }

body {
  min-height: 100vh;
  min-height: 100svh;
  background: linear-gradient(to bottom, var(--night-0), var(--night-1) 55%, var(--night-2));
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(240, 189, 102, .28); color: var(--bone); }

/* ---------- Scene layers ---------- */

#grove {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease .05s;
}
#grove.is-ready { opacity: 1; }

/* A soft dark clearing behind the content, guaranteeing legibility
   over the trunks at any viewport size. */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 46rem 42rem at 50% 52%,
      rgba(4, 8, 6, .7) 0%,
      rgba(4, 8, 6, .46) 38%,
      rgba(4, 8, 6, 0) 68%);
}
@media (max-width: 640px) {
  .scrim {
    background: radial-gradient(ellipse 26rem 44rem at 50% 52%,
        rgba(4, 8, 6, .8) 0%,
        rgba(4, 8, 6, .55) 42%,
        rgba(4, 8, 6, 0) 72%);
  }
}

/* ---------- Layout ---------- */

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vh, 4rem) 1.5rem;
}

.card {
  width: 100%;
  max-width: 24.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ---------- Identity ---------- */

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(230, 225, 211, .28);
  box-shadow:
    0 0 0 6px rgba(230, 225, 211, .05),
    0 18px 40px rgba(0, 0, 0, .5);
  filter: saturate(.82) contrast(1.03) brightness(.96);
  transition: box-shadow .5s var(--ease-out), border-color .5s var(--ease-out);
}
.avatar:hover {
  border-color: rgba(240, 189, 102, .55);
  box-shadow:
    0 0 0 6px rgba(240, 189, 102, .08),
    0 18px 44px rgba(0, 0, 0, .55);
}

.name {
  margin-top: 1.6rem;
  font-family: var(--serif);
  font-size: clamp(2.7rem, 11vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -.015em;
  font-weight: 350;
  text-wrap: balance;
}
.name-first {
  display: block;
  font-size: .52em;
  font-style: italic;
  font-weight: 330;
  letter-spacing: .01em;
  color: var(--bone-dim);
}
.name-last {
  display: block;
  font-style: normal;
  font-weight: 430;
  color: var(--bone);
  text-shadow: 0 0 34px rgba(230, 225, 211, .14);
}

.etym {
  margin-top: .9rem;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 330;
  font-size: .98rem;
  color: var(--ink-soft);
  letter-spacing: .01em;
}
.etym i { color: var(--ember-soft); font-style: italic; }
.etym-sep { color: rgba(143, 139, 125, .6); }

/* ---------- Links ---------- */

.links {
  width: 100%;
  margin-top: 2.4rem;
}

.links li + li { margin-top: 0; }

.link {
  display: grid;
  grid-template-columns: 2rem 1fr auto 1.1rem;
  align-items: center;
  gap: .75rem;
  padding: .95rem .45rem .95rem .55rem;
  text-decoration: none;
  border-top: 1px solid rgba(230, 225, 211, .1);
  position: relative;
  transition:
    background-color .3s var(--ease-out),
    padding .3s var(--ease-out);
}
.links li:last-child .link { border-bottom: 1px solid rgba(230, 225, 211, .1); }

/* ember hairline that grows from the left on hover */
.link::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, var(--ember), rgba(240, 189, 102, 0));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease-out);
}

.link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bone-dim);
  transition: color .3s var(--ease-out), transform .3s var(--ease-out);
}
.link-icon svg { display: block; }

/* Revolut ships only as a raster logo — tint it via mask */
.link-icon-mask {
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask: url('../images/revolut-white.png') center / contain no-repeat;
  mask: url('../images/revolut-white.png') center / contain no-repeat;
}
@supports not ((mask: url('')) or (-webkit-mask: url(''))) {
  .link-icon-mask {
    background-color: transparent;
    background-image: url('../images/revolut-white.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
  }
}

.link-label {
  text-align: left;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--bone);
}

.link-handle {
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--ink-soft);
  transition: color .3s var(--ease-out);
}

.link-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(185, 180, 165, .45);
  transition: color .3s var(--ease-out), transform .35s var(--ease-out);
}

@media (hover: hover) {
  .link:hover { background: rgba(230, 225, 211, .045); }
  .link:hover::after { transform: scaleX(1); }
  .link:hover .link-icon { color: var(--ember); transform: translateX(2px); }
  .link:hover .link-handle { color: var(--bone-dim); }
  .link:hover .link-arrow { color: var(--ember); transform: translate(2px, -2px); }
}
.link:active { background: rgba(230, 225, 211, .07); }
.link:active .link-icon { transform: translateX(2px) scale(.94); }

/* ---------- Footer ---------- */

.foot {
  margin-top: 2.6rem;
  font-size: .76rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.foot a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(143, 139, 125, .4);
  transition: color .3s var(--ease-out);
}
.foot a:hover { color: var(--bone-dim); }

/* the grove is procedural — the seed is a button that re-grows it */
.seed {
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  font-size: .72rem;
  letter-spacing: .03em;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color .3s var(--ease-out);
}
.seed::after {
  content: ' ↻';
  opacity: 0;
  transition: opacity .3s var(--ease-out);
}
.seed:hover { color: var(--ember); }
.seed:hover::after { opacity: 1; }
.seed:active { color: var(--ember-soft); }

/* ---------- Focus ---------- */

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 4px;
}
.avatar:focus-visible, .link:focus-visible { border-radius: 8px; }

/* ---------- Entrance choreography ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: rise .9s var(--ease-out) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  #grove { transition: none; }
  .link, .link::after, .link-icon, .link-arrow, .link-handle, .avatar, .foot a {
    transition: none;
  }
}

/* ---------- Small / short viewports ---------- */

@media (max-width: 380px) {
  .link { grid-template-columns: 1.8rem 1fr auto 1rem; gap: .6rem; }
  .link-handle { font-size: .74rem; }
}

@media (max-height: 600px) {
  .name { margin-top: 1.1rem; }
  .links { margin-top: 1.6rem; }
  .foot { margin-top: 1.7rem; }
}
