/* ─── Variables ─── */

:root {
  --color-bg:     #ffffff;
  --color-text:   #1a1a1a;
  --color-muted:  #687796;
  --color-border: #e5e7eb;

  --accent-r-30:  #ff44004d;
  --accent-y-30:  #ffa5004d;
  --accent-g-30:  #32cd324d;
  --accent-b-30:  #1e90ff4d;
  --accent-v-30:  #ee82ee4d;

  --font-sans:     system-ui, sans-serif;
  --font-serif:    ui-serif, Georgia, serif;
  --font-mono:     ui-monospace, monospace;

  --width-content: 680px;
  --spacing:       1.8rem;
}

/* ─── Reset ─── */

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

/* ─── Base ─── */

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  padding: var(--spacing);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

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

a:hover {
  text-decoration: underline;
}

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid orangered;
  outline-offset: 2px;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* ─── Layout ─── */

header, main, footer {
  max-width: var(--width-content);
  margin: 0 auto;
  width: 100%;
}

header {
  position: sticky;
  top: 0;
  background-color: var(--color-bg);
  padding-block: var(--spacing);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: calc(var(--spacing) * 2);
}

footer {
  padding-block: var(--spacing);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* ─── Nav ─── */

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a {
  color: var(--color-text);
  font-weight: 600;
}

nav a:hover {
  text-decoration: none;
}

.brand {
  font-size: 2rem;
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.brand::after {
  content: 'versicode';
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  z-index: -1;
  transform-origin: bottom left;
}

.brand:hover::after {
  animation: brandshadow-in 1.5s ease-out forwards;
}

.brand::after {
  animation: brandshadow-out 1.5s ease-out forwards;
}

/* ─── Typography ─── */

h1 {
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: var(--spacing);
}

h2 {
  font-size: 1.25rem;
  margin-bottom: var(--spacing);
}

h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

p {
  color: var(--color-text);
  margin-bottom: var(--spacing);
}

/* ─── Sections ─── */

main section, main article {
  margin-bottom: calc(var(--spacing) * 3);
}

/* ─── Hero ─── */

#hero p:first-of-type {
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

#hero p:nth-of-type(2) {
  color: var(--color-muted);
  font-size: 1.125rem;
}

#hero ul {
  display: flex;
  gap: 1rem;
  margin-top: var(--spacing);
}

/* ─── Projects grid ─── */

#projects ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0 var(--spacing);
}

#projects li a {
  display: block;
  padding: var(--spacing);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  -webkit-tap-highlight-color: var(--accent-r-30);
  transition: all 0.3s ease;
}

#projects li a p {
  color: var(--color-muted);
  font-size: 0.875rem;
  margin-bottom: 0;
}

#projects li a:hover,
#projects li a:focus-visible {
  text-decoration: none;
  transform: translateY(-2px);
  animation: card-cycle 0.3s linear forwards;
}

/* ─── Project detail ─── */

.screenshots {
  display: flex;
  flex-direction: column;
  gap: var(--spacing);
  margin-bottom: calc(var(--spacing) * 2);
}

.screenshots img {
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.links ul {
  display: flex;
  gap: 1rem;
}

/* ─── Tech stack ─── */

.tech-stack ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-stack li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--color-border);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

/* Mobile Development */
[data-tech="kotlin"]        { border-left: 3px solid limegreen; }
[data-tech="android-sdk"]   { border-left: 3px solid limegreen; }
[data-tech="compose"]       { border-left: 3px solid limegreen; }

/* Frontend Structure & Logic */
[data-tech="html"]          { border-left: 3px solid dodgerblue; }
[data-tech="javascript"]    { border-left: 3px solid dodgerblue; }
[data-tech="typescript"]    { border-left: 3px solid dodgerblue; }
[data-tech="react"]         { border-left: 3px solid dodgerblue; }
[data-tech="nextjs"]        { border-left: 3px solid dodgerblue; }

/* Styling & Design */
[data-tech="css"]           { border-left: 3px solid orangered; }
[data-tech="tailwind"]      { border-left: 3px solid orangered; }
[data-tech="md3"]           { border-left: 3px solid orangered; }
[data-tech="no-ui"]         { border-left: 3px solid orangered; }

/* Data Visualization & Mapping */
[data-tech="maplibre"]      { border-left: 3px solid orange; }
[data-tech="d3"]            { border-left: 3px solid orange; }

/* Backend & Services */
[data-tech="prisma"]        { border-left: 3px solid violet; }
[data-tech="nextauth"]      { border-left: 3px solid violet; }
[data-tech="resend"]        { border-left: 3px solid violet; }


/* ─── Footer ─── */

.om-symbol {
  cursor: grab ;
  user-select: none;
  color: var(--color-text);
  display: inline-block;
  position: relative;
}

.om-symbol:active {
  cursor: grabbing;
}

.versicode-text {
  position: relative;
  display: inline-block;
  font-weight: 600;
}

.versicode-text:hover {
  cursor: help;
}

.shadow-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transform-origin: bottom left;
  pointer-events: none;
}

.layer1 { --i: 0; color: orangered; }
.layer2 { --i: 1; color: orange; }
.layer3 { --i: 2; color: limegreen; }
.layer4 { --i: 3; color: dodgerblue; }
.layer5 { --i: 4; color: violet}

.versicode-container:has(.om-symbol:active) .shadow-layer {
  animation: shadowloop 2s linear infinite;
  animation-delay: calc(var(--i) * 0.4s);
}

body:has(.om-symbol:active) .brand::after {
  opacity: 0.4;
  animation: brandshadow-loop 8s linear infinite;
}

body:has(.om-symbol:active) #projects li a {
  animation: card-cycle 8s linear infinite;
}

body:has(.om-symbol:active) #projects li:nth-child(5n+2) a { animation-delay: 0s; }
body:has(.om-symbol:active) #projects li:nth-child(5n+5) a { animation-delay: 0.4s; }
body:has(.om-symbol:active) #projects li:nth-child(5n+4) a { animation-delay: 0.7s; }
body:has(.om-symbol:active) #projects li:nth-child(5n+1) a { animation-delay: 1s; }
body:has(.om-symbol:active) #projects li:nth-child(5n+3) a { animation-delay: 1.1s; }

body:has(.om-symbol:active) #projects li a {
  animation: card-cycle 8s linear infinite, card-float-loop 8s ease-in-out infinite;
}

/* ─── Animations ─── */

@keyframes brandshadow-in {
  30%  { color: orange; }
  45%  { color: limegreen; }
  60%  { color: dodgerblue; }
  75%  { color: violet; }
  90%  { color: orangered; }
  100% {
    filter: blur(1.5px);
    opacity: 0.75;
    transform: skewX(40deg) scaleY(0.5) translateY(-5px);
    color: orange;
  }
}

@keyframes brandshadow-out {
  0% {
    filter: blur(1.5px);
    opacity: 0.75;
    transform: skewX(40deg) scaleY(0.5) translateY(-5px);
    color: orange;
  }
  10% { color: orangered; }
  25% { color: violet; }
  40% { color: dodgerblue; }
  55% { color: limegreen; }
  70% { color: orange; } 
  100% {
    opacity: 0;
    transform: skewX(0deg) scaleY(1);
  }
}

@keyframes brandshadow-loop {
  /* In Phase */

  15%   { color: orange;     }
  22.5% { color: limegreen;  }
  30%   { color: dodgerblue; }
  37.5% { color: violet;     }
  45%   { color: orangered;  }
  /* Out Phase */
  50%   { opacity: 0.75; 
          transform: skewX(40deg) scaleY(0.5) translateY(-5px);
          filter: blur(1.5px); }
  55%   { color: orangered;  }
  62.5% { color: violet;     }
  70%   { color: dodgerblue; }
  77.5% { color: limegreen;  }
  85%   { color: orange;     }


}

@keyframes shadowloop {
  0%   { opacity: 0.2; transform: skewX(0deg) scaleY(1.2); }
  50%  { opacity: 1; }
  70%  { opacity: 0; transform: skewX(60deg) scaleY(0.5) translateY(-5px); filter: blur(1px); }
  100% { opacity: 0; }
}

@keyframes card-cycle {
  0%   { outline: 1px solid orangered;  box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 6px 6px 6px var(--accent-r-30); }
  1%   { outline: 1px solid violet;     box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 6px 6px 6px var(--accent-v-30); }
  20%  { outline: 1px solid orangered;  box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 6px 6px 6px var(--accent-r-30); }
  21%  { outline: 1px solid dodgerblue; box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 6px 6px 6px var(--accent-b-30); }
  40%  { outline: 1px solid orangered;  box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 6px 6px 6px var(--accent-r-30); }
  41%  { outline: 1px solid limegreen;  box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 6px 6px 6px var(--accent-g-30); }
  60%  { outline: 1px solid orangered;  box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 6px 6px 6px var(--accent-r-30); }
  61%  { outline: 1px solid orange;     box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 6px 6px 6px var(--accent-y-30); }
  100% { outline: 1px solid orangered;  box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 6px 6px 6px var(--accent-r-30); }
}

@keyframes card-float-loop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes brand-flicker {
  0%   { color: orangered;  }
  20%  { color: orange;     }
  40%  { color: limegreen;  }
  60%  { color: dodgerblue; }
  75%  { color: orange;     }
  90%  { color: violet;     }
  100% { color: limegreen;  }
}

