﻿:root {
  --bg: #0b0d12;
  --panel: #121622;
  --panel-2: #161b29;
  --text: #e6e7eb;
  --muted: #a4adbd;
  --accent: #59c3c3;
  --accent-2: #6aa7ff;
  --stroke: rgba(255, 255, 255, 0.08);
}

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

body {
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 800px at 10% 10%, rgba(88, 117, 255, 0.12), transparent 60%),
    radial-gradient(900px 700px at 90% 20%, rgba(89, 195, 195, 0.12), transparent 55%),
    linear-gradient(180deg, #0b0d12 0%, #0d1118 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.bg-orb {
  position: fixed;
  inset: auto;
  width: 320px;
  height: 320px;
  filter: blur(60px);
  opacity: 0.35;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  background: rgba(89, 195, 195, 0.35);
  top: 12%;
  left: -120px;
}

.orb-2 {
  background: rgba(106, 167, 255, 0.3);
  bottom: 8%;
  right: -120px;
}

.wave-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.42;
  pointer-events: none;
  z-index: 0;
}

.wave-line {
  fill: none;
  stroke: rgba(106, 167, 255, 0.75);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-dasharray: 8 20;
  transform-box: fill-box;
  transform-origin: center;
  animation: wave-dash 14s linear infinite, wave-float 7s ease-in-out infinite;
}

.wave-2 {
  stroke: rgba(89, 195, 195, 0.7);
  animation-duration: 18s, 8s;
  animation-delay: -4s, -1s;
}

.wave-3 {
  stroke: rgba(230, 231, 235, 0.4);
  stroke-dasharray: 4 24;
  animation-duration: 20s, 9s;
  animation-delay: -6s, -2s;
}

.wave-4 {
  stroke: rgba(89, 195, 195, 0.6);
  animation-duration: 16s, 6.5s;
  animation-delay: -2s, -3s;
}

.wave-5 {
  stroke: rgba(106, 167, 255, 0.55);
  stroke-dasharray: 10 26;
  animation-duration: 22s, 10s;
  animation-delay: -8s, -4s;
}

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

main {
  position: relative;
  z-index: 1;
  padding: 0 7vw 8rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem 7vw;
  background: rgba(11, 13, 18, 0.82);
  border-bottom: 1px solid var(--stroke);
  backdrop-filter: blur(12px);
}

.brand {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.nav a {
  position: relative;
  padding-bottom: 0.2rem;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav a:hover::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-toggle {
  padding: 0.85rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.hero {
  padding: 6rem 0 5rem;
}

.hero-inner {
  max-width: 760px;
  animation: rise 0.9s ease both;
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
}

h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  margin: 0.6rem 0 1rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin: 2rem 0 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  font-weight: 500;
  transition: transform 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0b0d12;
  border: none;
}

.btn.ghost {
  color: var(--text);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chips span {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.section {
  padding: 4rem 0;
}

.section-header {
  max-width: 640px;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 0.6rem;
}

.section-header p {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid.projects {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  max-width: 1200px;
  margin-inline: auto;
}

.grid.projects.tools-grid {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.grid.projects.projects-grid {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

@media (max-width: 1100px) {
  .grid.projects.tools-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
  .grid.projects.projects-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 800px) {
  .grid.projects.tools-grid,
  .grid.projects.projects-grid,
  .grid.links {
    grid-template-columns: 1fr;
  }
}

.grid.links {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-width: 1200px;
  margin-inline: auto;
}

.embed-card {
  margin-top: 2rem;
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 1.5rem;
  display: grid;
  gap: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.embed-header h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.embed-header p {
  color: var(--muted);
}

.embed-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: #0b0d12;
  max-height: 680px;
}

.embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ascii-cloud {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  overflow: hidden;
  min-height: 420px;
  background: #0b0d12;
}

.ascii-cloud canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ascii-controls {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: min(320px, 90%);
  display: grid;
  gap: 0.9rem;
  background: rgba(18, 22, 34, 0.92);
  backdrop-filter: blur(8px);
}

.ascii-controls .control {
  display: grid;
  gap: 0.4rem;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.control-row input[type="range"] {
  flex: 1;
}

.control-value {
  min-width: 3.5rem;
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
}

.ascii-controls label {
  font-size: 0.85rem;
  color: var(--muted);
}

.ascii-controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.ascii-controls .btn {
  width: 100%;
  background: rgba(89, 195, 195, 0.15);
  color: var(--text);
  border: 1px solid rgba(89, 195, 195, 0.5);
}

.ascii-controls .btn:hover {
  background: rgba(89, 195, 195, 0.28);
}

.ascii-controls input[type="color"] {
  width: 100%;
  height: 36px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0.2rem;
  background: #0b0d12;
}

.tool-panel {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
  flex: 1;
  min-height: 320px;
}

.tool-help {
  position: static;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  background: rgba(89, 195, 195, 0.14);
  color: var(--text);
  border: 1px solid rgba(89, 195, 195, 0.45);
}

.card-top {
  position: relative;
}

.card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.tool-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.tool-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 13, 0.7);
  backdrop-filter: blur(4px);
}

.tool-modal-panel {
  position: absolute;
  width: 360px;
  max-width: calc(100% - 2rem);
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 1.5rem;
  color: var(--text);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.tool-modal-panel p {
  color: var(--muted);
}

.tool-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tool-panel .btn {
  background: rgba(89, 195, 195, 0.14);
  color: var(--text);
  border: 1px solid rgba(89, 195, 195, 0.45);
}

.tool-panel .btn:hover {
  background: rgba(89, 195, 195, 0.3);
}

.tool-panel textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  background: rgba(18, 22, 34, 0.9);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.75rem;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
}

.tool-panel input[type="text"] {
  width: 100%;
  background: rgba(18, 22, 34, 0.9);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
}

.tool-panel .tool-row {
  display: flex;
  gap: 0.75rem;
}

.tool-panel pre.tool-output {
  margin: 0;
  background: rgba(18, 22, 34, 0.9);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.75rem;
  color: var(--muted);
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  min-height: 90px;
  white-space: pre-wrap;
}

.tool-note {
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.2rem;
}

@media (max-width: 700px) {
  .ascii-controls {
    position: static;
    margin-top: 1.5rem;
    width: 100%;
  }

  .ascii-cloud {
    min-height: 320px;
  }

  .tool-panel {
    min-height: auto;
  }
}

.card {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, border 0.25s ease;
}

.project-card {
  display: flex;
  flex-direction: column;
}

.project-with-image {
  padding: 0;
  overflow: hidden;
}

.project-with-image .card-top,
.project-with-image p,
.project-with-image .meta,
.project-with-image .project-link {
  padding: 0 1.5rem;
}

.project-with-image .card-top {
  margin-top: 1.5rem;
}

.project-with-image .project-link {
  padding-bottom: 1.5rem;
}

.project-image {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  display: block;
  border-bottom: 1px solid var(--stroke);
  background: #0b0d12;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card h3 {
  font-size: 1.1rem;
}

.status {
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid rgba(89, 195, 195, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.meta {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.project-link {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.9rem;
  color: var(--accent);
  position: relative;
}

.project-link + .project-link {
  margin-top: 0.5rem;
}

.project-link.external::after {
  content: "↗";
  font-size: 0.85em;
  margin-left: 0.4rem;
  color: inherit;
}

.project-link:hover {
  color: var(--accent-2);
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.link-title {
  font-weight: 600;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem;
  background: linear-gradient(160deg, rgba(89, 195, 195, 0.18), rgba(106, 167, 255, 0.1));
  border: 1px solid var(--stroke);
  border-radius: 20px;
}

.contact-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.contact-link {
  font-size: 1.2rem;
  font-weight: 500;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 2rem 7vw 3rem;
  color: var(--muted);
  border-top: 1px solid var(--stroke);
}

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

@keyframes wave-dash {
  to {
    stroke-dashoffset: -360;
  }
}

@keyframes wave-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  main {
    padding: 0 6vw 6rem;
  }

  .site-header {
    padding: 1.2rem 6vw;
  }

  .nav {
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .btn {
    width: 100%;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .footer {
    flex-direction: column;
    gap: 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wave-line {
    animation: none;
    stroke-dasharray: none;
  }
}
