/* ==========================================================================
   armin.link — AI & Innovation theme
   Original CSS authored for Armin Baldemair's personal site.
   Dark-first design with indigo→cyan accent, glass cards and a
   neural-network canvas background. Light theme via [data-theme="light"].
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600;700&display=swap");

/* --- Design tokens ------------------------------------------------------- */
:root {
  --radius:        .75em;
  --radius-pill:   2em;
  --font-sans:     "Inter", sans-serif;
  --font-display:  "Space Grotesk", sans-serif;
  --font-mono:     "JetBrains Mono", monospace;

  /* Dark theme (default) */
  --bg:            #070a13;
  --card:          rgba(15, 21, 38, .72);
  --card-solid:    #0e1426;
  --ink:           #eef2ff;
  --ink-dim:       rgba(238, 242, 255, .78);
  --muted:         #98a2b8;
  --muted-strong:  #c2cadd;
  --placeholder:   #5b6478;
  --hairline:      rgba(148, 163, 184, .28);
  --hairline-soft: rgba(148, 163, 184, .13);
  --accent:        #818cf8;
  --accent-2:      #22d3ee;
  --grad:          linear-gradient(135deg, #818cf8 0%, #22d3ee 100%);
  --panel:         #0a0e1a;
  --panel-ink:     #ffffff;
  --shadow:        0 10px 34px rgba(0, 0, 0, .35);
  --shadow-hover:  0 14px 44px rgba(0, 0, 0, .5);
  --glow:          0 0 0 1px rgba(129, 140, 248, .35), 0 10px 40px rgba(99, 102, 241, .18);
  --net-rgb:       129, 140, 248;
  --glow-a:        rgba(99, 102, 241, .14);
  --glow-b:        rgba(34, 211, 238, .10);
}

[data-theme="light"] {
  --bg:            #f2f5f8;
  --card:          rgba(255, 255, 255, .82);
  --card-solid:    #ffffff;
  --ink:           #0b1220;
  --ink-dim:       rgba(11, 18, 32, .78);
  --muted:         #5b6472;
  --muted-strong:  #3c4452;
  --placeholder:   #a6adba;
  --hairline:      rgba(15, 23, 42, .22);
  --hairline-soft: rgba(15, 23, 42, .09);
  --accent:        #4f46e5;
  --accent-2:      #0891b2;
  --grad:          linear-gradient(135deg, #4f46e5 0%, #0891b2 100%);
  --panel:         #0b1220;
  --panel-ink:     #ffffff;
  --shadow:        0 8px 26px rgba(22, 24, 26, .08);
  --shadow-hover:  0 10px 36px rgba(22, 24, 26, .14);
  --glow:          0 0 0 1px rgba(79, 70, 229, .25), 0 10px 36px rgba(79, 70, 229, .12);
  --net-rgb:       79, 70, 229;
  --glow-a:        rgba(79, 70, 229, .08);
  --glow-b:        rgba(8, 145, 178, .07);
}

/* --- Reset overrides ----------------------------------------------------- */
html, body { width: 100%; min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  position: relative;
  z-index: 1;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.74;
  letter-spacing: 0;
  transition: background .3s ease, color .3s ease;
}
@media (max-width: 991.98px) { body { font-size: .938rem; line-height: 1.6; } }

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.3px;
}
p { margin: 0; line-height: 1.74; }
@media (max-width: 991.98px) { p { line-height: 1.6; } }
a { color: var(--ink-dim); text-decoration: none; transition: color .12s linear; }
a:hover, a:focus { color: var(--accent); text-decoration: none; }
a:focus, button:focus { outline: 0; box-shadow: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img { max-width: 100%; height: auto; }

::selection { background: var(--accent); color: #fff; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--hairline);
  border-radius: 6px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* --- Background: neural canvas + ambient glow ---------------------------- */
.neural-bg {
  position: fixed; inset: 0;
  z-index: -2;
  width: 100%; height: 100%;
  pointer-events: none;
}
.bg-glow {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 38% at 12% 8%,  var(--glow-a), transparent 70%),
    radial-gradient(40% 36% at 88% 86%, var(--glow-b), transparent 70%);
}

/* --- Typography helpers ------------------------------------------------- */
.font-family-mono      { font-family: var(--font-mono); }
.font-family-primary   { font-family: var(--font-sans); }
.font-family-secondary { font-family: var(--font-display); }
.font-small { font-size: .9em; line-height: 1.7; }
.fw-medium    { font-weight: 500; }
.fw-semi-bold { font-weight: 600; }
.line-height-100 { line-height: 1; }
.line-height-140 { line-height: 1.4; }

/* Outlined stroke-text (used for service numbers) */
.stroke-text {
  color: var(--ink);
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke-width: 1.4px;
  -webkit-text-stroke-color: var(--ink);
}
@media (max-width: 1199.98px) { .stroke-text { -webkit-text-stroke-width: 1.2px; } }

/* Gradient text (name, counters, highlights) */
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Small uppercase mono tag */
.mono-heading {
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .9em;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Section-title with // prefix and large backdrop text */
.title-heading {
  position: relative;
  padding-top: 16px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .9em;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ink);
}
.title-heading::before {
  content: "// ";
  padding-right: 8px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.title-heading::after {
  content: attr(data-backdrop-text);
  position: absolute;
  bottom: 0; left: 0;
  opacity: .14;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.5rem;
  text-transform: uppercase;
  line-height: .9;
  color: var(--ink);
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke-width: 1px;
  -webkit-text-stroke-color: var(--ink);
  pointer-events: none;
}
@media (max-width: 1199.98px) { .title-heading { padding-top: 14px; } }
@media (max-width: 991.98px)  { .title-heading::after { font-size: 2rem; } }

.link-decoration { color: var(--ink-dim); }
.link-decoration:hover, .link-decoration:focus { color: var(--accent); text-decoration: underline; }

/* --- Layout containers -------------------------------------------------- */
.container, .container-fluid { position: relative; }
.sections-wrapper { padding-bottom: 3em; }
@media (max-width: 767.98px) { .sections-wrapper { padding-bottom: 1.5em; } }

.section-box {
  position: relative;
  background: var(--card);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  padding: 3em;
  box-shadow: var(--shadow);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.section-box:hover {
  border-color: var(--hairline);
  box-shadow: var(--shadow-hover);
}
@media (max-width: 991.98px) { .section-box { padding: 2.5em 2em; } }
@media (max-width: 767.98px) { .section-box { padding: 2em 1.5em; } }

.box-shadow     { box-shadow: var(--shadow); transition: ease-out .16s; }
.box-shadow:hover { box-shadow: var(--shadow-hover); }
.border-radius  { border-radius: var(--radius); overflow: hidden; }
.border-radius-1 { border-radius: 1em; overflow: hidden; }

/* --- Header (name block) ------------------------------------------------ */
#header { padding-bottom: .5rem; }
#header .display-2 {
  font-size: 4rem;
  line-height: 1.05;
  margin: 0;
  font-weight: 600;
}
@media (max-width: 991.98px) { #header .display-2 { font-size: 2.6rem; } }

/* Social inline list in header */
ul.list-inline { margin: 0 -7px; padding: 0; list-style: none; }
ul.list-inline li { display: inline-block; padding: 0 7px; }
ul.list-inline-sm { margin: 0 -3px; }
ul.list-inline-sm li { padding: 0 3px; }

/* --- Theme toggle -------------------------------------------------------- */
.theme-toggle {
  position: relative;
  z-index: 994;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin-left: 20px;
  background: transparent;
  border: 1px dashed var(--hairline);
  border-radius: 50%;
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(15deg);
}
.theme-toggle .bi-sun        { display: none; }
.theme-toggle .bi-moon-stars { display: inline-block; }
[data-theme="light"] .theme-toggle .bi-sun        { display: inline-block; }
[data-theme="light"] .theme-toggle .bi-moon-stars { display: none; }

/* --- Sidebar section nav ------------------------------------------------ */
.nav-wrapper { position: sticky; top: 24px; }
.section-nav {
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  padding: 1.7em 2.5em;
  box-shadow: var(--shadow);
}
.section-nav .nav {
  display: block;
  margin: 0; padding: 0;
  list-style: none;
}
.section-nav .nav-item { width: 100%; }
.section-nav .nav-link {
  position: relative;
  display: block;
  width: 100%;
  padding: .8rem 0;
  color: rgba(255,255,255,.65);
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .5px;
  text-align: left;
  transition: linear .1s;
  cursor: pointer;
}
.section-nav .nav-link:hover,
.section-nav .nav-link.active { color: #fff; letter-spacing: 1px; }
.section-nav .nav-link-mobile { display: none; }

.section-nav .nav-circle {
  position: absolute;
  top: 50%; right: 0;
  transform: translateY(-50%);
  display: inline-block;
  width: 6px; height: 6px;
}
.section-nav .nav-circle::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 5px; height: 5px;
  background: var(--accent-2);
  border: 1px dashed var(--accent-2);
  border-radius: 50%;
  opacity: .7;
  transition: ease-out .2s;
}
.section-nav .nav-link:hover .nav-circle::before,
.section-nav .nav-link.active .nav-circle::before {
  opacity: 1;
  background: transparent;
  width: 30px; height: 30px;
  animation: translateRotate 10s linear infinite;
}
@keyframes translateRotate {
  0%   { transform: translate(-50%,-50%) rotate(0); }
  100% { transform: translate(-50%,-50%) rotate(360deg); }
}

/* Mobile nav: horizontal pills */
@media (max-width: 991.98px) {
  .nav-wrapper { position: relative; top: auto; height: 57px; }
  .section-nav {
    position: absolute; inset: 0 0 auto 0;
    padding: .7em;
  }
  .section-nav.fixed {
    z-index: 994;
    position: fixed;
    top: 8px; right: 12px; left: 12px;
    background: rgba(10,14,26,.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  .section-nav .nav { display: flex; justify-content: center; }
  .section-nav .nav-item { width: auto; display: inline-block; }
  .section-nav .nav-link-desktop { display: none; }
  .section-nav .nav-link-mobile { display: inline; }
  .section-nav .nav-circle { display: none; }
  .section-nav .nav-link {
    width: 36px; height: 36px;
    padding: 0;
    text-align: center;
    line-height: 36px;
  }
  .section-nav .nav-link::before {
    content: "";
    position: absolute; inset: 0;
    transform: scale(.6);
    opacity: 0;
    border: 1px dashed var(--accent-2);
    border-radius: 50%;
    transition: ease-out .14s;
  }
  .section-nav .nav-link.active::before { transform: scale(1); opacity: 1; }
}

/* --- Menu dots button --------------------------------------------------- */
.menu-dots {
  position: relative;
  z-index: 994;
  display: inline-block;
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  border-top: 0;
  width: 50px; height: 50px;
  margin-left: 20px;
  border-radius: 0 0 var(--radius) var(--radius);
  cursor: pointer;
}
.menu-dots span {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(1);
  display: inline-block;
  background: var(--panel-ink);
  width: 4px; height: 4px;
  border-radius: 50%;
  transition: linear .1s;
}
.menu-dots span::before,
.menu-dots span::after {
  content: "";
  position: absolute; top: 0;
  width: 4px; height: 4px;
  background: var(--panel-ink);
  border-radius: 50%;
  transition: linear .1s;
}
.menu-dots span::before { right: calc(100% + 5px); }
.menu-dots span::after  { left:  calc(100% + 5px); }
.menu-dots:hover span,
.menu-dots.active span {
  transform: translate(-50%,-50%) scale(3);
  transition-delay: .1s;
}
.menu-dots:hover span::before,
.menu-dots.active span::before { opacity: 0; right: 0; }
.menu-dots:hover span::after,
.menu-dots.active span::after  { opacity: 0; left: 0; }

/* --- Toggle menu drawer ------------------------------------------------- */
.toggle-menu {
  position: fixed;
  top: 0; right: -10px; bottom: 0;
  z-index: 995;
  width: 400px; height: 100%;
  padding: 50px 40px;
  background: var(--panel);
  border-left: 1px solid var(--hairline-soft);
  color: rgba(255,255,255,.7);
  visibility: hidden; opacity: 0;
  transition: ease-out .16s;
}
.toggle-menu h1, .toggle-menu h2, .toggle-menu h3,
.toggle-menu h4, .toggle-menu h5, .toggle-menu h6 { color: #fff; }
.toggle-menu.show { right: 0; visibility: visible; opacity: 1; }
.toggle-menu .toggle-close {
  position: absolute; top: 16px; right: 16px;
  display: inline-block;
  width: 40px; height: 40px;
  background: rgba(255,255,255,.15);
  border: 0; border-radius: 50%;
  color: #fff;
  font-size: 1.33em;
  line-height: 40px; text-align: center;
  cursor: pointer;
  transition: ease-out .16s;
}
.toggle-menu .toggle-close:hover { background: rgba(255,255,255,.25); }
.toggle-menu .tm-bottom {
  position: absolute;
  right: 40px; bottom: 48px; left: 40px;
}
.toggle-menu a { color: rgba(255,255,255,.8); }
.toggle-menu a:hover, .toggle-menu a:focus { color: var(--accent-2); }
@media (max-width: 991.98px) { .toggle-menu { width: 350px; padding: 50px 30px 30px; } }
@media (max-width: 575.98px) { .toggle-menu { width: 100%; } }

/* --- Hero avatar -------------------------------------------------------- */
.hero-avatar { position: relative; display: inline-block; width: 100%; }
.hero-avatar img {
  display: block;
  width: 100%;
  max-width: 256px; max-height: 256px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid transparent;
  background:
    linear-gradient(var(--card-solid), var(--card-solid)) padding-box,
    var(--grad) border-box;
}
.hero-avatar-text {
  position: absolute;
  bottom: 1em; left: .5em;
  padding: .5em 1em;
  background: rgba(10,14,26,.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(148,163,184,.25);
  border-radius: var(--radius-pill);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .9em;
  text-transform: uppercase;
  letter-spacing: .5px;
  box-shadow: var(--shadow);
}
.hero-avatar-text * { color: #fff !important; }

/* --- Pills & list-inline-pills ----------------------------------------- */
ul.list-inline-pills { margin: 0; padding: 0; list-style: none; }
ul.list-inline-pills li {
  display: inline-flex;
  align-items: center;
  margin: 0 7px 10px 0;
  padding: .5em 1em;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-pill);
  font-size: .9em;
  transition: border-color .15s linear, color .15s linear;
}
ul.list-inline-pills li i { font-size: 1.2em; color: var(--accent); }
ul.list-inline-pills li:hover { color: var(--ink); border-color: var(--accent); }

/* Accent variant: focus-area pills */
ul.list-inline-pills.pills-accent li {
  border-style: solid;
  border-color: var(--hairline-soft);
  background: linear-gradient(135deg, rgba(var(--net-rgb), .10), rgba(var(--net-rgb), .04));
  color: var(--muted-strong);
}
ul.list-inline-pills.pills-accent li:hover {
  border-color: var(--accent);
  color: var(--ink);
}

ul.list-circle { padding: 0; margin: 0; }
ul.list-circle li {
  list-style: none;
  position: relative;
  padding-left: 13px;
}
ul.list-circle li::before {
  content: "";
  position: absolute;
  top: 50%; left: 0;
  transform: translateY(-50%);
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
}
.toggle-menu ul.list-circle li::before { background: var(--accent-2); }

/* --- Buttons ------------------------------------------------------------ */
.button {
  position: relative;
  display: inline-block;
  overflow: hidden;
  padding: 14px 32px;
  background: var(--grad);
  border: 0;
  border-radius: var(--radius-pill);
  color: #fff;
  font-size: .9em;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: .3px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.button:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--net-rgb), .35);
  filter: brightness(1.08);
}
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.button i { margin-right: 8px; font-size: 15px; }
.button.button-outline {
  background: transparent;
  border: 1px dashed var(--accent);
  color: var(--accent);
}
.button.button-outline:hover { background: var(--accent); color: #fff; }
.button-sm { padding: 10px 22px; }
.button-lg { padding: 16px 42px; }

.button-circle {
  display: inline-block;
  width: 50px; height: 50px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  color: #fff;
  line-height: 48px;
  text-align: center;
  transition: ease-out .12s;
}
.button-circle i { line-height: 48px; }
.button-circle:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-circle.button-circle-sm { width: 40px; height: 40px; line-height: 38px; }
.button-circle.button-circle-sm i { line-height: 38px; }
.button-circle-outline {
  background: transparent;
  border: 1px dashed var(--hairline);
  color: var(--ink);
}
.button-circle-outline:hover { background: var(--accent); color: #fff; }

/* --- Services list ------------------------------------------------------ */
.services-list { margin: 0; padding: 0; list-style: none; }
.services-list .services-item {
  border-top: 1px dashed var(--hairline-soft);
  transition: ease-out .15s;
}
.services-list .services-item:first-child { border-top: 0; }
.services-list .services-item .services-title i {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.services-list .services-item h6 { margin: 0; }
.services-list .services-item p { margin: 0; }

@media (min-width: 1200px) {
  .services-list .services-item {
    display: flex;
    align-items: center;
    padding: 30px 0;
  }
  .services-list .services-item:first-child { padding-top: 0; }
  .services-list .services-item:last-child  { padding-bottom: 0; }
  .services-list .services-item .services-number { min-width: 90px; }
  .services-list .services-item .services-number * { margin-bottom: 0; }
  .services-list .services-item .services-title {
    min-width: 270px;
    padding-right: 36px;
  }
  .services-list .services-item .services-title * { margin-bottom: 0; }
}
@media (max-width: 1199.98px) {
  .services-list .services-item { padding: 20px 0; }
  .services-list .services-item:first-child { padding-top: 0; }
  .services-list .services-item:last-child  { padding-bottom: 0; }
  .services-list .services-item .services-number { margin-bottom: 6px; }
  .services-list .services-item .services-title  { margin-bottom: 8px; }
}
.icon-xl i  { font-size: 1.6em; }
.icon-2xl i { font-size: 1.86em; }

/* --- Resume (timeline) -------------------------------------------------- */
.resume-wrapper { position: relative; padding-left: 20px; }
.resume-wrapper::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-left: 1px dashed var(--hairline);
}
.resume-wrapper .resume-icon i {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.resume-wrapper .resume-box { margin-bottom: 30px; }
.resume-wrapper .resume-box:last-child { margin-bottom: 0; }
.resume-wrapper .resume-box h5 { color: var(--ink); }
.resume-wrapper .resume-box .resume-date {
  position: relative;
  display: inline-block;
  margin-bottom: 1em;
  padding: .5em 1em;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: .9em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted-strong);
  transition: linear .1s;
}
.resume-wrapper .resume-box .resume-date::before {
  content: "";
  position: absolute;
  top: 50%; left: -20px;
  transform: translateY(-50%);
  width: 20px; height: 1px;
  border-top: 1px dashed var(--hairline);
}
.resume-wrapper .resume-box .resume-date::after {
  content: "";
  position: absolute;
  top: 50%; left: -23px;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(var(--net-rgb), .8);
}
.resume-wrapper .resume-box:hover .resume-date {
  color: var(--ink);
  border-color: var(--accent);
}
.resume-wrapper .resume-box p { margin-top: .3em; }
.resume-wrapper .resume-box .resume-company {
  color: var(--muted);
  font-size: .95em;
}
@media (max-width: 991.98px) {
  .resume-wrapper .resume-box { margin-bottom: 24px; }
}

/* --- Portfolio filter & grid ------------------------------------------- */
.filter ul { margin: 0; padding: 0; list-style: none; }
.filter ul li {
  position: relative;
  display: inline-block;
  margin: 0 7px 10px 0;
  padding: .5em 1em;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: .9em;
  color: var(--ink);
  cursor: pointer;
  transition: ease-out .12s;
}
.filter ul li:hover { border-color: var(--accent); color: var(--accent); }
.filter ul li.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}

.portfolio-grid .portfolio-item.hide { display: none; }

.portfolio-box {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius);
  transform: translate3d(0,0,0);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.portfolio-box:hover {
  border-color: rgba(var(--net-rgb), .5);
  box-shadow: var(--glow);
}
.portfolio-box::after {
  content: "";
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background-image: linear-gradient(to top, rgba(7,10,19,.78), rgba(7,10,19,.05) 60%);
  opacity: 0;
  transition: ease-out .16s;
  pointer-events: none;
}
.portfolio-box img {
  display: block;
  width: 100%;
  transform: scale(1);
  transition: transform .4s cubic-bezier(.165,.84,.44,1);
}
.portfolio-box .portfolio-category {
  position: absolute;
  top: 16px; right: 16px;
  padding: .5em 1em;
  background: rgba(10,14,26,.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(148,163,184,.25);
  border-radius: var(--radius-pill);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .85em;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.portfolio-box .portfolio-caption {
  position: absolute;
  right: 0; bottom: 0; left: 0;
  z-index: 1;
  padding: 0 30px 24px;
  visibility: hidden;
  opacity: 0;
  margin-bottom: -6px;
  transition: ease-out .16s;
}
.portfolio-box .portfolio-caption h1 {
  margin: 0;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: .5px;
}
.portfolio-box .portfolio-caption p {
  margin: .25em 0 0;
  color: rgba(255,255,255,.85);
  font-size: .95em;
}
.portfolio-box:hover::after { opacity: 1; }
.portfolio-box:hover img {
  transform: scale(1.04);
  filter: blur(1.5px);
}
.portfolio-box:hover .portfolio-caption {
  visibility: visible;
  opacity: 1;
  margin-bottom: 0;
}

/* Consistent tile aspect */
.portfolio-item .portfolio-box { aspect-ratio: 4 / 3; background: var(--card-solid); }
.portfolio-item .portfolio-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Forms -------------------------------------------------------------- */
input:not([type="checkbox"]):not([type="radio"]),
textarea {
  width: 100%;
  padding: 0 0 1rem;
  margin-bottom: 2rem;
  background: transparent;
  border: 1px dashed var(--hairline);
  border-top-width: 0;
  border-right-width: 0;
  border-left-width: 0;
  border-bottom-width: 1px;
  color: var(--ink);
  font: 400 14px var(--font-sans);
  box-shadow: none;
  transition: ease-out .16s;
}
input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus {
  outline: 0;
  box-shadow: none;
  border-color: var(--accent);
  border-bottom-style: solid;
}
textarea { height: 140px; resize: vertical; }
::placeholder { color: var(--placeholder); }
label { font-size: 14px; }

/* Turnstile widget slot (empty until a site key is configured) */
.turnstile-slot:not(:empty) { margin-bottom: 1.5rem; }

.submit-result span {
  display: none;
  transition: ease-out .2s;
}
.submit-result span.show-result { display: block; margin-top: 30px; }
.submit-result #sending { color: var(--muted-strong); }
.submit-result #success { color: #34d399; }
.submit-result #error   { color: #f87171; }

/* --- Counter & avatar masks -------------------------------------------- */
.counter { display: inline-block; }
img[class*="img-mask-avatar"] { border-radius: 50%; }
img.img-mask-avatar-sm { min-width: 70px; width: 70px; height: 70px; object-fit: cover; }

/* --- Preloader ---------------------------------------------------------- */
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: 998;
  width: 100%; height: 100%;
  background: var(--panel);
  pointer-events: none;
}
body.loaded::after { display: none; }
.preloader {
  position: fixed; inset: 0;
  z-index: 999;
  width: 100%; height: 100%;
  background: var(--panel);
  visibility: visible; opacity: 1;
  text-align: center;
}
.preloader div {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  display: flex;
  color: #fff;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.preloader div span {
  display: inline-block;
  padding: 0 8px;
  animation: loader 1s linear infinite;
}
.preloader div span:nth-child(2) { animation-delay: .1s; }
.preloader div span:nth-child(3) { animation-delay: .2s; }
.preloader div span:nth-child(4) { animation-delay: .3s; }
.preloader div span:nth-child(5) { animation-delay: .4s; }
.preloader div span:nth-child(6) { animation-delay: .5s; }
.preloader div span:nth-child(7) { animation-delay: .6s; }
.loaded .preloader {
  visibility: hidden; opacity: 0;
  transition: ease-out .4s;
}
@keyframes loader {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* --- Scroll-top --------------------------------------------------------- */
.scroll-top {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 997;
  display: none;
  width: 44px; height: 44px;
  background: var(--grad);
  color: #fff;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: var(--shadow-hover);
  transition: ease-out .16s;
}
.scroll-top.active { display: flex; }
.scroll-top:hover  { color: #fff; transform: translateY(-2px); }

/* --- Footer ------------------------------------------------------------- */
#footer {
  padding: 2em 0 1em;
  text-align: center;
  color: var(--muted);
  font-size: .9em;
}
#footer a { color: var(--muted-strong); }
#footer a:hover { color: var(--accent); }
#footer .credits { margin-top: .5em; font-size: .85em; }

/* --- Typed cursor ------------------------------------------------------- */
.typed-cursor { opacity: 1; animation: typed-blink .7s infinite; color: #fff; }
@keyframes typed-blink { 50% { opacity: 0; } }

/* --- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* --- Visibility helpers ------------------------------------------------- */
[hidden] { display: none !important; }
