/* ═══════════════════════════════════════════
   DESIGN SYSTEM — Custom Properties
   ═══════════════════════════════════════════ */

:root {
  /* Colors */
  --c-bg:       #0A0A0A;
  --c-bg-alt:   #111111;
  --c-surface:  #1A1A1A;
  --c-text:     #F5F0E8;
  --c-text-dim: #8A8680;
  --c-accent:   #C9A84C;
  --c-accent-glow: rgba(201, 168, 76, 0.3);
  --c-border:   #2A2A2A;
  --c-white:    #FFFFFF;

  /* Typography */
  --f-display: 'Space Grotesk', sans-serif;
  --f-body:    'Inter', sans-serif;

  /* Sizes */
  --fs-hero:      clamp(2.8rem, 6.2vw, 7rem);
  --fs-statement: clamp(1.8rem, 4vw, 4.5rem);
  --fs-heading:   clamp(1.6rem, 3.5vw, 3.5rem);
  --fs-body:      clamp(0.95rem, 1.2vw, 1.15rem);
  --fs-small:     clamp(0.75rem, 0.9vw, 0.85rem);
  --fs-label:     clamp(0.7rem, 0.8vw, 0.8rem);

  /* Spacing */
  --s-section:  clamp(6rem, 15vh, 12rem);
  --s-gutter:   clamp(1.5rem, 4vw, 4rem);

  /* Transitions */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast:      0.3s;
  --t-med:       0.6s;
  --t-slow:      1s;
}


/* ═══════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════ */

html {
  background: var(--c-bg);
}

body {
  font-family: var(--f-body);
  font-size: var(--fs-body);
  color: var(--c-text);
  background: var(--c-bg);
  overflow-x: hidden;
  cursor: none;
}

@media (pointer: fine) {
  html,
  body,
  body * {
    cursor: none !important;
  }
}

/* For touch devices, restore default cursor */
@media (pointer: coarse) {
  body { cursor: auto; }
}

::selection {
  background: var(--c-accent);
  color: var(--c-bg);
}


/* ═══════════════════════════════════════════
   GRAIN OVERLAY
   ═══════════════════════════════════════════ */

.grain {
  position: fixed;
  inset: -20%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 512px 512px;
}


/* ═══════════════════════════════════════════
   CUSTOM CURSOR
   ═══════════════════════════════════════════ */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
}

.cursor__dot {
  width: 8px;
  height: 8px;
  background: var(--c-white);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width var(--t-fast) var(--ease-out),
              height var(--t-fast) var(--ease-out),
              background var(--t-fast);
}

.cursor__ring {
  display: none;
}

.cursor--hover .cursor__dot {
  width: 16px;
  height: 16px;
  background: var(--c-accent);
}

.cursor--hover .cursor__ring {
  width: 60px;
  height: 60px;
  border-color: var(--c-accent);
  opacity: 0.6;
}

.cursor--click .cursor__ring {
  width: 30px;
  height: 30px;
}

@media (pointer: coarse) {
  .cursor { display: none; }
}


/* ═══════════════════════════════════════════
   PRELOADER
   ═══════════════════════════════════════════ */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  transition: opacity 0.8s var(--ease-out), visibility 0.8s;
}

.preloader--done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__inner {
  text-align: center;
}

.preloader__text {
  font-family: var(--f-display);
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-text);
}

.preloader__line {
  width: 60px;
  height: 1px;
  background: var(--c-accent);
  margin: 1.5rem auto 0;
  transform-origin: left;
  transform: scaleX(0);
}


/* ═══════════════════════════════════════════
   LANGUAGE SWITCHER
   ═══════════════════════════════════════════ */

.lang-switcher {
  position: fixed;
  top: 2rem;
  right: var(--s-gutter);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-out);
}

.lang-switcher--visible {
  opacity: 1;
}

.lang-btn {
  font-family: var(--f-display);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  padding: 0.3em 0.4em;
  transition: color var(--t-fast);
  position: relative;
}

.lang-btn[aria-current="true"],
.lang-btn.active {
  color: var(--c-accent);
}

.lang-btn:hover {
  color: var(--c-text);
}

.lang-sep {
  color: var(--c-border);
  font-size: var(--fs-label);
  user-select: none;
}


/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */

.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100lvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 var(--s-gutter);
  max-width: min(1400px, 92vw);
}

.hero__title {
  font-family: var(--f-display);
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--c-text);
  margin-bottom: 1.5rem;
  visibility: hidden; /* revealed by scramble animation */
}

/* Keep each explicit hero line on a single row on desktop */
.hero__title .scramble-line {
  white-space: nowrap;
}

.hero__title .scramble-word {
  display: inline-block;
  white-space: nowrap;
}

.hero__sub {
  font-family: var(--f-display);
  font-size: var(--fs-small);
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  opacity: 0;
  transform: translateY(20px);
}


/* Scroll Indicator */

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.scroll-indicator__line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--c-accent), transparent);
  animation: scrollLine 2s var(--ease-in-out) infinite;
}


/* ═══════════════════════════════════════════
   PHILOSOPHY / MANIFESTO
   ═══════════════════════════════════════════ */

.philosophy {
  position: relative;
  padding: var(--s-section) 0;
  overflow: hidden;
}

.philosophy__block {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 8rem) var(--s-gutter);
  position: relative;
}

.philosophy__index {
  display: block;
  font-family: var(--f-display);
  font-size: var(--fs-small);
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--c-accent);
  margin-bottom: 1.5rem;
  opacity: 0.7;
}

.philosophy__statement {
  font-family: var(--f-display);
  font-size: var(--fs-statement);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--c-text);
  clip-path: inset(0 100% 0 0);
  transition: none; /* GSAP handles this */
}

/* Divider between blocks */
.philosophy__block + .philosophy__block::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--c-border);
  margin-bottom: clamp(3rem, 6vh, 5rem);
}


/* ═══════════════════════════════════════════
   SECTION DIVIDER
   ═══════════════════════════════════════════ */

.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem var(--s-gutter);
  max-width: 600px;
  margin: 1rem auto;
}

.section-divider__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--c-border), transparent);
}

.section-divider__dot {
  width: 5px;
  height: 5px;
  background: var(--c-accent);
  border-radius: 50%;
  opacity: 0.6;
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════
   ANTI-PORTFOLIO
   ═══════════════════════════════════════════ */

.anti-portfolio {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-section) var(--s-gutter);
  overflow: hidden;
}

.anti-portfolio__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
}

.anti-portfolio__badge {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-bottom: 3rem;
  opacity: 0;
}

.anti-portfolio__counter {
  font-family: var(--f-display);
  font-size: clamp(4rem, 10vw, 10rem);
  font-weight: 700;
  line-height: 1;
  color: var(--c-accent);
  letter-spacing: -0.03em;
}

.anti-portfolio__counter::after {
  content: '+';
  font-weight: 300;
  opacity: 0.7;
}

.anti-portfolio__label {
  font-family: var(--f-display);
  font-size: var(--fs-small);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin-top: 0.5rem;
}

.anti-portfolio__title {
  font-family: var(--f-display);
  font-size: var(--fs-statement);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--c-text);
}

.anti-portfolio__text {
  font-family: var(--f-display);
  font-size: var(--fs-body);
  color: var(--c-text-dim);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

.anti-portfolio__grain-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, var(--c-bg) 80%);
  pointer-events: none;
  z-index: 0;
}


/* ═══════════════════════════════════════════
   TOOLS / TECH STACK
   ═══════════════════════════════════════════ */

.tools {
  padding: var(--s-section) var(--s-gutter);
  text-align: center;
  overflow: hidden;
}

.tools__heading {
  font-family: var(--f-display);
  font-size: var(--fs-statement);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.tools__sub {
  font-family: var(--f-display);
  font-size: var(--fs-body);
  color: var(--c-text-dim);
  max-width: 500px;
  margin: 0 auto 4rem;
  line-height: 1.7;
}

.tools__terminal {
  max-width: 980px;
  margin: 0 auto;
  text-align: left;
  border: 1px solid var(--c-border);
  background:
    radial-gradient(1200px 280px at 50% -20%, rgba(201, 168, 76, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

.tools__terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--c-border);
  background: rgba(255, 255, 255, 0.015);
}

.tools__traffic {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tools__traffic span {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--c-border);
}

.tools__traffic span:nth-child(3) {
  color: var(--c-accent);
  background: var(--c-accent);
  box-shadow: 0 0 10px var(--c-accent-glow);
}

.tools__terminal-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}

.tools__terminal-body {
  padding: 1.2rem 1rem 1.4rem;
}

.tools__line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: clamp(0.8rem, 1.35vw, 0.98rem);
  line-height: 1.8;
  letter-spacing: 0.02em;
  color: #bcc3c9;
}

.tools__line + .tools__line {
  margin-top: 0.2rem;
}

.tools__line--prompt {
  color: var(--c-accent);
}

.tools__line--prompt::after {
  content: '_';
  margin-left: 0.25rem;
  animation: terminalCaret 1s steps(1, end) infinite;
}

.tools__line-label {
  display: inline-block;
  min-width: 7.6ch;
  color: #f5f0e8;
}


/* ═══════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════ */

.contact {
  padding: var(--s-section) var(--s-gutter);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  align-items: center;
}

.contact__content {
  width: 100%;
  max-width: 600px;
}

.contact__heading {
  font-family: var(--f-display);
  font-size: var(--fs-statement);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.8rem;
}

@media (min-width: 769px) {
  .contact__heading {
    white-space: nowrap;
  }
}

.contact__sub {
  font-family: var(--f-display);
  color: var(--c-text-dim);
  font-size: var(--fs-body);
  margin-bottom: 3rem;
  line-height: 1.6;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.form-group {
  position: relative;
}

.form-input {
  width: 100%;
  font-size: var(--fs-body);
  color: var(--c-text);
  padding: 0.8rem 0;
  background: transparent;
  border-bottom: 1px solid var(--c-border);
  transition: border-color var(--t-fast);
}

.form-input:focus {
  border-color: var(--c-accent);
}

.form-label {
  position: absolute;
  left: 0;
  top: 0.8rem;
  font-size: var(--fs-body);
  color: var(--c-text-dim);
  pointer-events: none;
  transition: transform var(--t-fast) var(--ease-out), font-size var(--t-fast), color var(--t-fast);
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label,
.form-group--filled .form-label,
.form-input:-webkit-autofill ~ .form-label,
.form-input:autofill ~ .form-label {
  transform: translateY(-1.6rem);
  font-size: var(--fs-label);
  color: var(--c-accent);
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--c-text);
  box-shadow: 0 0 0 1000px var(--c-bg) inset;
}

.form-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
}

.form-input:focus ~ .form-line {
  transform: scaleX(1);
}

/* Error state */
.form-group--error .form-input {
  border-color: #e05a5a;
}

.form-group--error .form-label {
  color: #e05a5a;
}

.form-group--error .form-line {
  background: #e05a5a;
}

.form-error {
  display: none;
  font-size: var(--fs-small);
  color: #e05a5a;
  margin-top: 0.35rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.form-group--error .form-error {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.form-textarea {
  resize: none;
  min-height: 2.4rem;
  overflow: hidden;
}

/* Submit Button */

.contact__submit {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--f-display);
  font-size: var(--fs-body);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-bg);
  background: var(--c-accent);
  padding: 1em 2.5em;
  border-radius: 0;
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-fast) var(--ease-out);
}

.contact__submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c-text);
  transform: translateY(100%);
  transition: transform var(--t-med) var(--ease-out);
}

.contact__submit:hover::before {
  transform: translateY(0);
}

.contact__submit-text,
.contact__submit-arrow {
  position: relative;
  z-index: 1;
}

.contact__submit-arrow {
  transition: transform var(--t-fast) var(--ease-out);
}

.contact__submit:hover .contact__submit-arrow {
  transform: translateX(4px);
}

/* Success State */

.contact__success {
  text-align: center;
  padding: 3rem 0;
}

.contact__success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border: 2px solid var(--c-accent);
  border-radius: 50%;
  font-size: 1.5rem;
  color: var(--c-accent);
  margin-bottom: 1.5rem;
}

.contact__success p {
  font-family: var(--f-display);
  font-size: var(--fs-body);
  color: var(--c-text-dim);
  letter-spacing: 0.05em;
}

.contact__email {
  margin-top: 3rem;
  text-align: center;
}

.contact__email a {
  font-family: var(--f-display);
  font-size: var(--fs-small);
  letter-spacing: 0.2em;
  color: var(--c-text-dim);
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 0.3em;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.contact__email a:hover {
  color: var(--c-accent);
  border-color: var(--c-accent);
}


/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */

.footer {
  padding: 3rem var(--s-gutter);
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer__logo {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--c-text);
}

.footer__copy {
  font-size: var(--fs-small);
  color: var(--c-text-dim);
}

.footer__craft {
  font-size: var(--fs-small);
  color: var(--c-text-dim);
  font-style: italic;
}

.footer__lang {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}


/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
  .hero__title {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }

  .philosophy__statement {
    font-size: clamp(1.4rem, 5.5vw, 2.2rem);
  }

  .tools__terminal-body {
    padding: 1rem 0.85rem 1.1rem;
  }

  .tools__line-label {
    min-width: 7ch;
  }

  .contact__submit {
    width: 100%;
    justify-content: center;
  }

  .footer {
    flex-direction: column;
    text-align: center;
  }

  .footer__inner {
    justify-content: center;
  }

  .lang-switcher {
    top: 1.2rem;
    right: 1.2rem;
  }
}

@keyframes terminalCaret {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: clamp(1.6rem, 9vw, 2.5rem);
  }

  .philosophy__block {
    padding: clamp(2.5rem, 6vh, 4rem) var(--s-gutter);
  }
}


/* ═══════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════ */

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

  .marquee__track {
    animation: none !important;
  }

  .philosophy__statement {
    clip-path: none !important;
  }

  .scroll-indicator__line {
    animation: none !important;
  }

  .hero__title {
    visibility: visible;
  }
}
