:root {
  --ink: #1c1917;
  --muted: #57534e;
  --paper: #f3f0eb;
  --paper-2: #e8e4dc;
  --line: #d6d1c8;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --hero: #fafaf9;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --header-h: 4rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(15, 118, 110, 0.06), transparent),
    linear-gradient(180deg, #f7f4ef 0%, var(--paper) 30%);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 clamp(1.25rem, 4vw, 2.75rem);
  transition: background 0.25s ease, border-color 0.25s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(243, 240, 235, 0.92);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--line);
}

.logo {
  text-decoration: none;
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  letter-spacing: -0.02em;
  color: #fafaf9;
  transition: color 0.25s ease;
}

.site-header.is-scrolled .logo,
.site-header.menu-open .logo {
  color: var(--ink);
}

.nav {
  display: flex;
  gap: 1.4rem;
  align-items: center;
}

.nav a {
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(250, 250, 249, 0.8);
  transition: color 0.25s ease;
}

.nav a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-header.is-scrolled .nav a {
  color: var(--muted);
}

.site-header.is-scrolled .nav a:hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}

.nav-toggle span {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: #fafaf9;
  transition: transform 0.2s ease, background 0.25s ease;
}

.site-header.is-scrolled .nav-toggle span,
.site-header.menu-open .nav-toggle span {
  background: var(--ink);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: calc(var(--header-h) + 3rem) clamp(1.25rem, 4vw, 2.75rem) 3.5rem;
  color: var(--hero);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  filter: saturate(0.95) contrast(1.02);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(28, 25, 23, 0.82) 0%, rgba(28, 25, 23, 0.45) 48%, rgba(28, 25, 23, 0.28) 100%),
    linear-gradient(to top, rgba(28, 25, 23, 0.7), transparent 50%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 36rem;
}

.hero-logo {
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  transform: rotate(-3deg);
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.25);
}

.brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: rgba(250, 250, 249, 0.9);
}

.code-window {
  margin: 0 0 1.75rem;
  max-width: 34rem;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-family: "JetBrains Mono", "Consolas", "Cascadia Code", monospace;
}

.code-titlebar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  background: #2d2d2d;
  border-bottom: 1px solid #3c3c3c;
}

.code-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #565656;
}

.code-dot:nth-child(1) {
  background: #ff5f56;
}

.code-dot:nth-child(2) {
  background: #ffbd2e;
}

.code-dot:nth-child(3) {
  background: #27c93f;
}

.code-file {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: #cccccc;
}

.code-body {
  margin: 0;
  padding: 0.75rem 0;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #d4d4d4;
}

.c-line {
  display: block;
  padding-right: 1rem;
  white-space: pre;
}

.c-num {
  display: inline-block;
  width: 2.4rem;
  margin-right: 1rem;
  padding-right: 0.75rem;
  border-right: 1px solid #333;
  text-align: right;
  color: #858585;
  user-select: none;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin: 0;
}

.link-plain {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: rgba(250, 250, 249, 0.85);
  text-underline-offset: 3px;
}

.link-plain:hover {
  color: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.65rem 1.2rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  border: 2px solid #0d5f58;
  box-shadow: 3px 3px 0 #0a4a44;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #0a4a44;
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #0a4a44;
}

.btn-lg {
  min-height: 3.1rem;
  font-size: 1.05rem;
}

/* Sections */
.section {
  padding: clamp(3.5rem, 8vw, 5.5rem) clamp(1.25rem, 4vw, 2.75rem);
  max-width: 52rem;
}

.section.tint {
  max-width: none;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section.tint > * {
  max-width: 52rem;
}

.section h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.intro {
  margin: 0 0 2rem;
  color: var(--muted);
  max-width: 38rem;
}

.intro strong {
  color: var(--ink);
  font-weight: 600;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 3rem;
}

.split h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.split p {
  margin: 0 0 0.85rem;
  color: var(--muted);
}

.note {
  padding-left: 0.85rem;
  border-left: 3px solid var(--accent);
  font-size: 1rem;
  color: var(--ink) !important;
}

.about-block p {
  margin: 0 0 1.1rem;
  max-width: 40rem;
  color: var(--muted);
}

.about-block p:last-child {
  margin-bottom: 0;
}

.tools {
  margin-top: 1.75rem !important;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--line);
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.tools span {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.5;
}

.portfolio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.portfolio-item {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}

.portfolio-media {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, #1c1917 0%, #292524 55%, #0f766e 160%);
  color: rgba(250, 250, 249, 0.55);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.portfolio-media.nui {
  background:
    linear-gradient(145deg, #1e1e1e 0%, #2d2d2d 50%, #569cd6 160%);
}

.portfolio-media.web {
  background:
    linear-gradient(145deg, #1c1917 0%, #44403c 50%, #ce9178 160%);
}

.portfolio-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-body {
  padding: 1.15rem 1.2rem 1.35rem;
}

.portfolio-tag {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
}

.portfolio-body h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.portfolio-body p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.5;
}

.portfolio-note {
  margin: 1.75rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.portfolio-note .text-link {
  margin-top: 0;
  margin-left: 0.25rem;
}

.text-link {
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.flow {
  list-style: none;
  display: grid;
  gap: 1.5rem;
  counter-reset: step;
}

.flow li {
  display: grid;
  gap: 0.25rem;
  padding-left: 3rem;
  position: relative;
  counter-increment: step;
}

.flow li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  transform: rotate(-4deg);
}

.flow strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.flow span {
  color: var(--muted);
}

/* FAQ */
.faq-list {
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-weight: 400;
}

.faq-list details[open] summary::after {
  content: "–";
}

.faq-list p {
  margin: 0 0 1.1rem;
  color: var(--muted);
  max-width: 36rem;
}

/* Contact */
.contact .intro {
  margin-bottom: 1.5rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-discord {
  background: #5865f2;
  border-color: #4752c4;
  box-shadow: 3px 3px 0 #3c45a5;
}

.btn-discord:hover {
  box-shadow: 4px 4px 0 #3c45a5;
}

.btn-discord:active {
  box-shadow: 1px 1px 0 #3c45a5;
}

.ps {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.75rem clamp(1.25rem, 4vw, 2.75rem) 2.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer img {
  border-radius: 2px;
  transform: rotate(2deg);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .portfolio {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .split,
  .portfolio {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    background: var(--paper);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .site-header.menu-open .nav {
    opacity: 1;
    visibility: visible;
  }

  .nav a {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--ink);
  }
}

@media (max-width: 520px) {
  body {
    font-size: 1.05rem;
  }

  .hero {
    align-items: center;
  }
}
