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

:root {
  --bg: #050505;
  --panel: #101010;
  --panel-hover: #151515;
  --text: #f5f5f5;
  --muted: #a1a1aa;
  --yellow: #ffd21f;
  --amber: #ffb000;
  --border: rgba(255, 210, 31, 0.22);
  --border-hover: rgba(255, 210, 31, 0.55);
  --glow: rgba(255, 210, 31, 0.18);
  --shadow: rgba(0, 0, 0, 0.52);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body.personal-shell {
  --pointer-x: 62vw;
  --pointer-y: 18vh;
  --hex-shift-x: 0px;
  --hex-shift-y: 0px;
  display: block;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 68% 0%, rgba(255, 210, 31, 0.11), transparent 23rem),
    radial-gradient(circle at 8% 15%, rgba(255, 176, 0, 0.07), transparent 19rem),
    linear-gradient(180deg, #080808 0%, var(--bg) 52%, #000 100%);
  color: var(--text);
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  line-height: 1.68;
  position: relative;
}

body.personal-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(255, 210, 31, 0.16), transparent 15rem),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='72' viewBox='0 0 84 72'%3E%3Cpolygon points='21,1 63,1 83,36 63,71 21,71 1,36' fill='none' stroke='%23FFD21F' stroke-opacity='0.16' stroke-width='1'/%3E%3Cpath d='M21 1 42 36 21 71M63 1 42 36 63 71' fill='none' stroke='%23FFB000' stroke-opacity='0.06' stroke-width='1'/%3E%3C/svg%3E");
  background-position:
    center,
    calc(50% + var(--hex-shift-x)) calc(0px + var(--hex-shift-y));
  background-size: auto, 84px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.58) 58%, transparent 100%);
  animation: hexGridDrift 32s linear infinite;
  will-change: background-position;
}

body.personal-shell::after {
  content: "oliverhellevik.com";
  position: fixed;
  left: 18px;
  bottom: 16px;
  z-index: 4;
  pointer-events: none;
  color: rgba(245, 245, 245, 0.42);
  font: 600 0.76rem/1 "JetBrains Mono", monospace;
  letter-spacing: 0.12em;
  animation: brandFade 0.7s ease both;
}

body.personal-shell .personal-page::before,
body.personal-shell .page-shell::before,
body.personal-shell.personal-detail main::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    radial-gradient(circle, rgba(255, 210, 31, 0.20) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 176, 0, 0.16) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 210, 31, 0.13) 0 1px, transparent 2px);
  background-position:
    12vw 18vh,
    78vw 26vh,
    64vw 78vh;
  background-size:
    210px 210px,
    260px 260px,
    320px 320px;
  filter: blur(0.2px);
  animation: particleDrift 24s ease-in-out infinite alternate;
}

body.personal-shell a {
  color: inherit;
}

body.personal-shell h1,
body.personal-shell h2,
body.personal-shell h3 {
  font-family: "Orbitron", system-ui, sans-serif;
  letter-spacing: 0;
}

body.personal-shell p,
body.personal-shell h1,
body.personal-shell h2,
body.personal-shell h3 {
  margin-top: 0;
}

body.personal-shell code {
  padding: 0.1rem 0.32rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 210, 31, 0.06);
  color: var(--yellow);
  font-family: "JetBrains Mono", Consolas, monospace;
}

.personal-page {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) 0 clamp(58px, 7vw, 86px);
}

.personal-home {
  padding-top: 0;
}

.hero-minimal,
.page-hero {
  max-width: 820px;
}

.hero-minimal {
  min-height: 0;
  padding: clamp(64px, 9vh, 92px) 0 clamp(22px, 4vh, 36px);
}

.page-hero {
  padding-top: clamp(22px, 4vw, 44px);
}

.overline {
  width: max-content;
  max-width: 100%;
  margin-bottom: 12px;
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}

.hero-minimal h1,
.page-hero h1 {
  margin-bottom: 10px;
  color: var(--text);
  font-size: clamp(2.7rem, 7.2vw, 4.35rem);
  line-height: 1.08;
}

.hero-subtitle {
  margin-bottom: 0;
  color: var(--yellow);
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: clamp(1.25rem, 2.7vw, 2.05rem);
  font-weight: 600;
  line-height: 1.16;
}

.hero-description,
.page-description,
.section-heading p,
.project-card p,
.client-card p,
.contact-box p,
.description,
.intro {
  color: var(--muted);
  font-size: clamp(0.96rem, 1.35vw, 1.04rem);
  line-height: 1.68;
}

.hero-description,
.page-description {
  max-width: 720px;
  margin-bottom: 22px;
}

.action-row,
.simple-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.simple-nav {
  position: relative;
  z-index: 1;
}

.button,
.terminal-button,
.back-link,
.nav-chip,
button {
  position: relative;
  overflow: hidden;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 16, 16, 0.88);
  color: var(--text);
  cursor: pointer;
  font: 600 0.86rem/1.05 "JetBrains Mono", monospace;
  text-decoration: none;
  isolation: isolate;
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease,
    color 0.22s ease;
}

.button::before,
.terminal-button::before,
.back-link::before,
.nav-chip::before,
body.personal-shell button::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  background: linear-gradient(110deg, transparent 18%, rgba(255, 210, 31, 0.16) 45%, transparent 72%);
  opacity: 0;
  transform: translateX(-55%);
  transition: opacity 0.22s ease, transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

.button-primary,
.terminal-button.primary {
  background: var(--yellow);
  color: #050505;
  border-color: var(--yellow);
  box-shadow: 0 0 18px var(--glow);
}

.button:hover,
.button:focus-visible,
.terminal-button:hover,
.terminal-button:focus-visible,
.back-link:hover,
.back-link:focus-visible,
.nav-chip:hover,
.nav-chip:focus-visible,
button:hover,
button:focus-visible {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: var(--panel-hover);
  box-shadow: 0 0 22px var(--glow);
  outline: none;
}

.button:hover::before,
.button:focus-visible::before,
.terminal-button:hover::before,
.terminal-button:focus-visible::before,
.back-link:hover::before,
.back-link:focus-visible::before,
.nav-chip:hover::before,
.nav-chip:focus-visible::before,
body.personal-shell button:hover::before,
body.personal-shell button:focus-visible::before {
  opacity: 1;
  transform: translateX(55%);
}

.button:focus-visible,
.terminal-button:focus-visible,
.back-link:focus-visible,
.nav-chip:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(255, 210, 31, 0.78);
  outline-offset: 3px;
}

.button:active,
.terminal-button:active,
.back-link:active,
.nav-chip:active,
button:active {
  transform: translateY(0) scale(0.98);
  outline: none;
}

.button-primary:hover,
.button-primary:focus-visible,
.terminal-button.primary:hover,
.terminal-button.primary:focus-visible {
  background: var(--amber);
  color: #050505;
}

.text-link {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--yellow);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.text-link span {
  transition: transform 0.16s ease;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--amber);
  outline: none;
}

.text-link:hover span,
.text-link:focus-visible span {
  transform: translateX(4px);
}

.project-section,
.client-section {
  margin-top: clamp(34px, 5vw, 58px);
}

.personal-home .project-section {
  margin-top: 0;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  margin-bottom: 8px;
  font-size: clamp(1.85rem, 3.5vw, 2.45rem);
  line-height: 1.12;
}

.project-grid,
.client-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.project-card,
.client-card,
.panel,
.game-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 16, 16, 0.88);
  box-shadow: 0 18px 58px var(--shadow);
}

.project-card,
.client-card {
  position: relative;
  overflow: hidden;
  min-height: 146px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  cursor: pointer;
  isolation: isolate;
  text-decoration: none;
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.24s ease,
    box-shadow 0.24s ease,
    background 0.24s ease;
}

.project-card::before,
.client-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 210, 31, 0.13), transparent 38%),
    linear-gradient(135deg, rgba(255, 210, 31, 0.07), transparent 42%);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.client-card {
  min-height: 160px;
}

.project-card:hover,
.project-card:focus-visible,
.client-card:hover,
.client-card:focus-visible,
.client-card:focus-within {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  background: var(--panel-hover);
  box-shadow: 0 24px 72px var(--shadow), 0 0 30px var(--glow);
  outline: none;
}

.project-card:hover::before,
.project-card:focus-visible::before,
.client-card:hover::before,
.client-card:focus-visible::before,
.client-card:focus-within::before {
  opacity: 1;
  transform: scale(1);
}

.project-card:focus-visible,
.client-card:focus-visible {
  outline: 2px solid rgba(255, 210, 31, 0.78);
  outline-offset: 3px;
}

.project-card:active,
.client-card:active {
  transform: translateY(-2px) scale(0.99);
}

.project-card h3,
.client-card h3 {
  margin-bottom: 8px;
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  line-height: 1.18;
}

.project-card p,
.client-card p {
  margin-bottom: 0;
}

.card-arrow {
  display: inline-flex;
  align-self: flex-end;
  color: var(--yellow);
  font-size: 1.18rem;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), color 0.24s ease;
}

.project-card:hover .card-arrow,
.project-card:focus-visible .card-arrow,
.client-card:hover .card-arrow,
.client-card:focus-visible .card-arrow {
  color: var(--amber);
  transform: translateX(7px);
}

.contact-box {
  max-width: 640px;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 16, 16, 0.82);
}

.contact-box p {
  margin-bottom: 6px;
}

.contact-box a {
  color: var(--yellow);
  font-weight: 700;
  text-decoration: none;
}

.contact-box a:hover,
.contact-box a:focus-visible {
  color: var(--amber);
  text-decoration: underline;
  outline: none;
}

.site-footer,
.footer {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 32px;
  color: rgba(245, 245, 245, 0.46);
  font-size: 0.82rem;
}

.personal-detail {
  padding: 20px;
}

.personal-detail main,
.page-shell {
  position: relative;
  z-index: 1;
  width: min(1000px, 100%);
  margin: 0 auto;
}

.topbar,
.top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  display: none;
}

.personal-detail .panel,
.personal-detail .game-panel {
  padding: clamp(22px, 4vw, 38px);
}

.personal-detail .kicker,
.tag,
.client-status {
  width: max-content;
  max-width: 100%;
  margin: 0 auto 14px;
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.personal-detail h1,
.personal-detail h2 {
  color: var(--text);
  line-height: 1.12;
}

.personal-detail #counter,
.personal-detail #info,
.personal-detail #melding {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  line-height: 1.65;
}

.personal-detail .heart {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 210, 31, 0.42);
  color: var(--yellow);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 210, 31, 0.22), rgba(255, 210, 31, 0.06) 48%, rgba(16, 16, 16, 0.88) 100%);
  box-shadow:
    inset 0 0 26px rgba(255, 210, 31, 0.12),
    0 0 28px rgba(255, 210, 31, 0.24);
  font-size: 2.3rem;
  animation: premiumHeartbeat 2.8s ease-in-out infinite;
}

.personal-detail .heart::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  border: 1px solid rgba(255, 210, 31, 0.12);
  opacity: 0.65;
  animation: heartHalo 2.8s ease-in-out infinite;
}

.personal-detail #lerret {
  border-color: var(--border);
  box-shadow: 0 18px 58px var(--shadow);
}

@keyframes premiumHeartbeat {
  0%, 58%, 100% {
    transform: scale(1);
    box-shadow:
      inset 0 0 26px rgba(255, 210, 31, 0.12),
      0 0 24px rgba(255, 210, 31, 0.20);
  }
  12% {
    transform: scale(1.055);
    box-shadow:
      inset 0 0 30px rgba(255, 210, 31, 0.18),
      0 0 38px rgba(255, 210, 31, 0.34);
  }
  22% {
    transform: scale(0.99);
  }
  32% {
    transform: scale(1.035);
  }
}

@keyframes heartHalo {
  0%, 58%, 100% {
    transform: scale(0.96);
    opacity: 0.35;
  }
  12%, 32% {
    transform: scale(1.05);
    opacity: 0.72;
  }
}

body.personal-shell .personal-page,
body.personal-shell .page-shell,
body.personal-shell.personal-detail main {
  animation: pageFadeIn 0.45s ease both;
}

body.motion-ready .reveal-item {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(3px);
  transition:
    opacity 0.62s ease,
    transform 0.62s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.62s ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform, filter;
}

body.motion-ready .reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes brandFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hexGridDrift {
  0% {
    background-position:
      center,
      calc(50% + var(--hex-shift-x)) calc(0px + var(--hex-shift-y));
  }
  50% {
    background-position:
      center,
      calc(50% + var(--hex-shift-x) + 18px) calc(18px + var(--hex-shift-y));
  }
  100% {
    background-position:
      center,
      calc(50% + var(--hex-shift-x) + 84px) calc(72px + var(--hex-shift-y));
  }
}

@keyframes particleDrift {
  0% {
    background-position:
      12vw 18vh,
      78vw 26vh,
      64vw 78vh;
  }
  100% {
    background-position:
      15vw 21vh,
      74vw 30vh,
      67vw 72vh;
  }
}

@media (max-width: 820px) {
  .hero-minimal {
    padding: 58px 0 28px;
  }

  .project-grid,
  .client-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .personal-page {
    width: min(100% - 24px, 1040px);
    padding-top: 24px;
  }

  .personal-home {
    padding-top: 0;
  }

  .hero-minimal h1,
  .page-hero h1 {
    font-size: clamp(2.35rem, 11vw, 2.9rem);
    line-height: 1.1;
  }

  .action-row,
  .simple-nav {
    width: 100%;
  }

  .button,
  .terminal-button,
  .back-link,
  .nav-chip {
    width: 100%;
  }

  .project-card,
  .client-card {
    min-height: 150px;
    padding: 18px;
  }

  .personal-detail {
    padding: 14px;
  }

  body.personal-shell::after {
    left: 12px;
    bottom: 10px;
    font-size: 0.68rem;
    opacity: 0.72;
  }
}

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

  body.motion-ready .reveal-item {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
