
:root {
  color-scheme: dark;

  --color-bg: #000;
  --color-text: #fff;
  --color-text-dim: rgba(255, 255, 255, 0.62);
  --color-text-faint: rgba(255, 255, 255, 0.4);
  --color-line: rgba(255, 255, 255, 0.16);

  --font: "JetBrains Mono", ui-monospace, monospace;
  --max-width: 1180px;
  --gutter: max(4vw, 16px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 300 15px/1.7 var(--font);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

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

p {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 300;
  letter-spacing: -0.05em;
  line-height: 1.1;
  text-wrap: balance;
}

strong {
  color: var(--color-text);
  font-weight: 400;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 1px solid var(--color-text);
  outline-offset: 3px;
}


/* 2. Layout helpers
   ========================================================================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding-block: clamp(70px, 10vw, 130px);
}

/* Small uppercase monospace text: nav, tags, buttons */
.label {
  font: 400 12px/1.5 var(--font);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.muted {
  color: var(--color-text-faint);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.planet-icon {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.4;
}

.button {
  background: none;
  border: 1px solid var(--color-line);
  color: var(--color-text);
  padding: 12px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.button:hover {
  background: var(--color-text);
  color: #000;
}

/* Full-screen starfield canvas */
#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}


/* 3. Header & corner clock
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  background: linear-gradient(#000 0%, rgba(0, 0, 0, 0.75) 60%, transparent);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-text {
  letter-spacing: 0.3em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.nav a {
  padding: 10px 12px;
  color: var(--color-text-dim);
  transition: color 0.2s;
}

.nav a:hover,
.nav a.active {
  color: var(--color-text);
}

.corner {
  position: fixed;
  right: var(--gutter);
  bottom: 18px;
  z-index: 20;
  display: flex;
  gap: 18px;
  color: var(--color-text-faint);
}


/* 4. Hero & "Ask me" box
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-bottom: clamp(40px, 8vh, 90px);
}

.hero > .container {
  width: 100%;
}

/* Planet canvas */
#globe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-content {
  max-width: 580px;
  display: grid;
  gap: 22px;
}

.hero h1 {
  font-size: clamp(34px, 4.6vw, 58px);
}

/* Blinking terminal cursor after the name */
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 0.9em;
  margin-left: 0.12em;
  background: var(--color-text);
  vertical-align: -0.08em;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0.15; }
}

.intro {
  color: var(--color-text-dim);
  max-width: 52ch;
}

.ask {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 18px;
  border: 1px solid var(--color-line);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.ask-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-text);
  opacity: 0.7;
  animation: blink 1.6s infinite;
}

.ask input {
  flex: 1;
  padding: 12px 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--color-text);
  font: 300 16px var(--font);
}

.ask input::placeholder {
  color: var(--color-text-faint);
}

.ask button {
  padding: 12px 16px;
  border: 1px solid var(--color-line);
  background: none;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.ask button:hover {
  background: var(--color-text);
  color: #000;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestions button {
  padding: 8px 12px;
  border: 1px solid var(--color-line);
  background: none;
  color: var(--color-text-dim);
  font: 300 14px var(--font);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.suggestions button:hover {
  color: var(--color-text);
  border-color: var(--color-text-faint);
}

.answer {
  min-height: 1.7em;
  padding: 4px 0 4px 16px;
  border-left: 1px solid var(--color-text);
}

.answer:empty {
  display: none;
}


/* 5. About card
   ========================================================================== */

.about-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(22px, 3.5vw, 40px);
  margin-bottom: clamp(40px, 6vw, 72px);
  border: 1px solid var(--color-line);
  background: rgba(0, 0, 0, 0.6);
}

.profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile h3 {
  font-size: 22px;
}

.profile .label {
  margin-top: 4px;
  letter-spacing: 0.14em;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 1px solid var(--color-line);
  border-radius: 50%;
}

.about-text {
  display: grid;
  gap: 14px;
  color: var(--color-text-dim);
}


/* 6. Projects
   ========================================================================== */

.section-label {
  display: block;
  margin-bottom: 18px;
}

/* Each project is one row: number | name | description | type */
.project {
  display: grid;
  grid-template-columns: 48px minmax(0, 0.9fr) minmax(0, 1.3fr) 9.5em;
  align-items: baseline;
  gap: clamp(16px, 3vw, 40px);
  padding-block: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--color-line);
  transition: padding 0.25s;
}

.project:hover {
  padding-left: 10px;
}

.project:last-child {
  border-bottom: 1px solid var(--color-line);
}

.project h3 {
  font-size: clamp(28px, 3.2vw, 40px);
}

.project-desc {
  color: var(--color-text-dim);
}

.project-type {
  text-align: right;
  white-space: nowrap;
}

.project-links {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-links:empty {
  display: none;
}

.project-links a {
  padding: 8px 12px;
  border: 1px solid var(--color-line);
  color: var(--color-text-dim);
  transition: color 0.2s, border-color 0.2s;
}

.project-links a:hover {
  color: var(--color-text);
  border-color: var(--color-text-faint);
}


/* 7. Contact
   ========================================================================== */

.contact h2 {
  font-size: clamp(42px, 7vw, 92px);
  margin-bottom: 28px;
}

.contact-intro {
  max-width: 52ch;
  margin-bottom: 34px;
  color: var(--color-text-dim);
}

.email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.email-row a {
  font-size: clamp(18px, 2.2vw, 24px);
  border-bottom: 1px solid var(--color-text-faint);
  overflow-wrap: anywhere;
}

.contact-links {
  display: grid;
  border-top: 1px solid var(--color-line);
}

.contact-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--color-line);
  font-size: clamp(20px, 2.4vw, 28px);
  transition: padding 0.25s;
}

.contact-links a:hover {
  padding-left: 12px;
}

.contact-links a .label {
  color: var(--color-text-faint);
  letter-spacing: 0.2em;
}

.email-row:empty,
.contact-links:empty {
  display: none;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 860px;
  margin-top: 56px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--color-text-faint);
}

.contact-form .full-width {
  grid-column: 1 / -1;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--color-line);
  border-radius: 0;
  outline: none;
  background: rgba(0, 0, 0, 0.6);
  color: var(--color-text);
  font: 300 16px/1.5 var(--font);
  text-transform: none;
  letter-spacing: normal;
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--color-text-faint);
}

.form-footer {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.form-note {
  color: var(--color-text-dim);
}

.form-note:empty {
  display: none;
}


/* 8. Footer & toast
   ========================================================================== */

.site-footer {
  padding: 28px 0 70px;
  color: var(--color-text-faint);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Small "Copied" message */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  padding: 10px 16px;
  background: var(--color-text);
  color: #000;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}


/* 9. Responsive
   ========================================================================== */

/* Darken the left side of the hero so text stays readable over the planet */
@media (min-width: 601px) {
  .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0, rgba(0, 0, 0, 0.7) 38%, transparent 58%);
  }
}

/* Tablet */
@media (max-width: 820px) {
  .about-card,
  .contact-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .project {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 6px 16px;
  }

  .project-desc {
    grid-column: 2 / -1;
  }

  .project-type {
    grid-column: 3;
    grid-row: 1;
    letter-spacing: 0.14em;
  }
}

/* Phone */
@media (max-width: 600px) {
  .nav a {
    padding: 10px 7px;
    letter-spacing: 0.14em;
  }

  .hero {
    padding-top: 46vh;
  }

  .ask {
    padding-left: 14px;
  }

  .hide-on-phone,
  .corner {
    display: none;
  }
}


/* 10. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cursor,
  .ask-dot {
    animation: none;
  }

  .project,
  .contact-links a {
    transition: none;
  }
}
