/* wicker.one -- a personal page with a terminal accent in the colours of
   the "gay-men" flag (the hyfetch preset of that name).
   Name font: Sixtyfour by Jens Kutilek, SIL Open Font License 1.1
   (name-OFL.txt), cut down to Latin. It has two variable axes, SCAN
   (scanlines) and BLED (glow), which the heading animates. */

@font-face {
  font-family: "Name";
  src: url("name.woff2") format("woff2");
  font-display: block;
}

/* Lets the card border spin through the flag (registered so it animates) */
@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  --bg: #0e1015;
  --card: #151821;
  --fg: #e3e5ea;
  --muted: #959cab;
  --link: #98e8c1;
  --line: #262a36;
  /* Lightened for a dark background, as hyfetch does, or the indigo and
     violet stripes vanish into it. */
  --f1: #1fae8b; --f2: #26ceaa; --f3: #98e8c1; --f4: #ffffff;
  --f5: #7bade2; --f6: #7d77e6; --f7: #a184e6;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, "Cascadia Mono", "DejaVu Sans Mono", Consolas, monospace;
  --name: "Name", var(--sans);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f3ee;
    --card: #fbfaf7;
    --fg: #1d2129;
    --muted: #5b6270;
    --link: #0a6b57;
    --line: #dcd8cf;
    /* ...and darkened on paper; white becomes grey. */
    --f1: #078d70; --f2: #129c7f; --f3: #3fa784; --f4: #8a909b;
    --f5: #3f7fc0; --f6: #5049cc; --f7: #3d1a78;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html { background: var(--bg); color: var(--fg); }

body {
  margin: 0 auto;
  max-width: 44rem;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 2rem max(1rem, env(safe-area-inset-left));
  font: 17px/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:focus-visible, input:focus-visible + label {
  outline: 2px solid var(--f5);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* Header: a quiet path left, language switch right */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.hi { margin: 0; font: .85rem var(--mono); color: var(--muted); }

.lang { border: 0; margin: 0; padding: 0; display: flex; gap: .25rem; }
.lang input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lang label {
  cursor: pointer;
  padding: .05rem .5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font: .8rem var(--mono);
}
.lang label:hover { color: var(--fg); }

/* Language: lang.js sets <html lang> before the body renders and ticks the
   matching radio; without JS the radios alone switch via :has(). */
html[lang="de"]:not(:has(#lang-en:checked)) .en,
html:has(#lang-de:checked) .en,
html[lang="en"]:not(:has(#lang-de:checked)) .de,
html:has(#lang-en:checked) .de { display: none; }

html[lang="de"]:not(:has(.lang input:checked)) label[for="lang-de"],
html[lang="en"]:not(:has(.lang input:checked)) label[for="lang-en"],
.lang input:checked + label {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
}

/* Intro */
.intro {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0 1.25rem;
  margin: 3.5rem 0 3rem;
}
.photo {
  width: 96px; height: 96px;
  border-radius: 50%;
  padding: 3px;
  /* The flag as a ring, top to bottom like the stripes */
  background: linear-gradient(var(--f1), var(--f2), var(--f3), var(--f4), var(--f5), var(--f6), var(--f7));
}
.hello { margin: 0 0 .35rem; font: .95rem var(--mono); color: var(--muted); }
/* The name in the flag, switching on like an old monitor: scanlines and
   glow fade out, and come back a little on hover. */
h1 {
  margin: 0;
  font: 400 clamp(.95rem, 4.3vw, 1.85rem)/1.35 var(--name);
  background: linear-gradient(90deg, var(--f1), var(--f2), var(--f3), var(--f4), var(--f5), var(--f6), var(--f7));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variation-settings: "SCAN" 0, "BLED" 0;
  animation: crt 1.6s cubic-bezier(.2, .7, .2, 1) both;
  transition: font-variation-settings .5s ease;
}
h1:hover { font-variation-settings: "SCAN" 60, "BLED" 40; }
@keyframes crt {
  0%   { font-variation-settings: "SCAN" 100, "BLED" 100; opacity: 0; }
  15%  { opacity: 1; }
  100% { font-variation-settings: "SCAN" 0, "BLED" 0; }
}

/* Photo with the pixel monogram on its back; turns over on hover */
.badge { position: relative; width: 96px; height: 96px; perspective: 600px; }
.badge .photo, .badge .back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  transition: transform .6s cubic-bezier(.3, .7, .3, 1);
}
.badge .back {
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--line);
  transform: rotateY(180deg);
}
.badge:hover .photo { transform: rotateY(-180deg); }
.badge:hover .back { transform: rotateY(0); }
.mono { width: 70%; }
.mono .f1 { fill: var(--f1); } .mono .f2 { fill: var(--f2); } .mono .f3 { fill: var(--f3); }
.mono .f4 { fill: var(--f4); } .mono .f5 { fill: var(--f5); } .mono .f6 { fill: var(--f6); }
.mono .f7 { fill: var(--f7); }

/* Icon sprite: hidden, but not display:none, which breaks <use> in some engines */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.15em; height: 1.15em; flex: none; fill: currentColor; color: var(--muted); transition: color .2s, transform .2s; }
.about { grid-column: 1 / -1; margin: 1.5rem 0 0; font-size: 1.05rem; max-width: 40rem; }
.about p { margin: 0 0 .8rem; }
.about strong { font-weight: 600; }

/* The flag, once, as a thin divider */
.stripes { grid-column: 1 / -1; display: flex; margin: 2rem 0 0; height: 4px; border-radius: 2px; overflow: hidden; }
.stripes span { flex: 1; }
.stripes span:nth-child(1) { background: var(--f1); }
.stripes span:nth-child(2) { background: var(--f2); }
.stripes span:nth-child(3) { background: var(--f3); }
.stripes span:nth-child(4) { background: var(--f4); }
.stripes span:nth-child(5) { background: var(--f5); }
.stripes span:nth-child(6) { background: var(--f6); }
.stripes span:nth-child(7) { background: var(--f7); }

/* Sections */
section + section { margin-top: 2.75rem; }
h2 {
  margin: 0 0 1rem;
  font: 600 .8rem var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
h2::before { content: "# "; color: var(--f2); }

/* Cards: a flag-coloured border that turns on hover, a soft light under the
   pointer (live.js sets --x/--y), and live content in the wide ones. */
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .7rem;
}
.card { grid-column: span 3; }
.card.small { grid-column: span 2; }

.card a {
  --x: 50%; --y: 50%;
  position: relative;
  display: flex; flex-direction: column; gap: .2rem;
  height: 100%;
  padding: .9rem 1rem;
  border-radius: 12px;
  border: 1.5px solid transparent;
  background:
    radial-gradient(18rem circle at var(--x) var(--y), rgb(152 232 193 / .07), transparent 60%) padding-box,
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(var(--line), var(--line)) border-box;
  color: var(--fg);
  text-decoration: none;
  overflow: hidden;
  transition: transform .2s ease;
}
.card a:hover .ic, .card a:focus-visible .ic { color: var(--brand, var(--fg)); transform: scale(1.12); }
.card a:hover, .card a:focus-visible {
  background:
    radial-gradient(18rem circle at var(--x) var(--y), rgb(152 232 193 / .09), transparent 60%) padding-box,
    linear-gradient(var(--card), var(--card)) padding-box,
    conic-gradient(from var(--spin), var(--f1), var(--f2), var(--f3), var(--f4), var(--f5), var(--f6), var(--f7), var(--f1)) border-box;
  animation: spin 4s linear infinite;
  transform: translateY(-2px);
  outline: none;
}
@keyframes spin { to { --spin: 360deg; } }

.card .k { font-weight: 650; display: flex; align-items: center; gap: .5rem; }

/* Brand colours, shown on the icon while hovering */
.lastfm { --brand: #d51007; }
.github { --brand: var(--fg); }
.linkedin { --brand: #0a66c2; }
.xing { --brand: #2a9d8f; }
.instagram { --brand: #ff0069; }
.telegram { --brand: #26a5e4; }
.mail { --brand: var(--f2); }
@media (prefers-color-scheme: dark) {
  .linkedin { --brand: #4f9be8; }
  .xing { --brand: #3ccfb4; }
}
.card .v { font: .85rem var(--mono); color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.card .line { font-size: .92rem; color: var(--muted); }
.card .state { font: .75rem var(--mono); color: var(--muted); text-transform: lowercase; margin-top: .3rem; }


/* Last.fm: the cover blurred behind, sharp on the left, bars while playing */
.lastfm a { flex-direction: row; gap: 1rem; align-items: center; }
.lastfm .cover {
  flex: 0 0 auto;
  width: 4.5rem; height: 4.5rem;
  border-radius: 8px;
  background: var(--line) center / cover no-repeat;
  display: none;
}
.lastfm.has-cover .cover { display: block; }
.lastfm .body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.lastfm .track { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lastfm .artist { color: var(--muted); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.eq { display: none; gap: 2px; align-items: flex-end; height: .8em; }
.playing .eq { display: inline-flex; }
.eq i { width: 3px; height: 100%; background: var(--f2); border-radius: 1px; transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { background: var(--f3); animation-delay: -.3s; }
.eq i:nth-child(3) { background: var(--f5); animation-delay: -.6s; }
.eq i:nth-child(4) { background: var(--f6); animation-delay: -.15s; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* GitHub: the commit message as the headline, repo and hash in mono */
.github .body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.github .msg { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.github .meta { font: .8rem var(--mono); color: var(--muted); }
.github .repo { color: var(--f2); }

.tools { list-style: none; margin: 0; padding: 0; }
.tools li { margin: 0 0 1.1rem; }
.tools a { display: block; width: fit-content; font: 600 .95rem var(--mono); margin-bottom: .15rem; }

footer { margin-top: 3.5rem; font: .8rem var(--mono); color: var(--muted); }
footer p { margin: 0; }
.built { display: flex; align-items: center; gap: .45rem; margin-top: .5rem !important; font-size: .72rem; }
.built .ic { width: 1.1em; height: 1.1em; color: #7ebae4; }
.built code { font: inherit; }

/* Block cursor after the name that slowly runs through the flag */
.cursor {
  display: inline-block;
  width: .55em; height: .9em;
  margin-left: .35em;
  vertical-align: -.05em;
  background: var(--f2);
  animation: blink 1.1s steps(1) infinite, flag 14s steps(7) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes flag {
  0%   { background: var(--f1); }
  14%  { background: var(--f2); }
  28%  { background: var(--f3); }
  43%  { background: var(--f4); }
  57%  { background: var(--f5); }
  71%  { background: var(--f6); }
  86%  { background: var(--f7); }
}
@media (prefers-reduced-motion: reduce) {
  .cursor, .card a, .card a:hover, .eq i, h1, .badge .photo, .badge .back, .ic { animation: none; transition: none; }
  .card a:hover { transform: none; }
}

@media (max-width: 30rem) {
  body { font-size: 16px; }
  .intro { margin-top: 2.5rem; gap: 0 1rem; }
  .badge, .photo { width: 72px; height: 72px; }
}
@media (max-width: 40rem) {
  .card, .card.small { grid-column: 1 / -1; }
}

@media print {
  .lang, .cursor { display: none; }
}
