/* Codersize — elevated dark, sized right. */

:root {
  --bg: #0e1514;
  --surface: #131c1b;
  --ink: #e9efee;
  --muted: #93a7a4;
  --accent: #2fe0bf;
  --accent-deep: #17b298;
  --hairline: rgba(233, 239, 238, 0.09);
  --glow: rgba(47, 224, 191, 0.35);
  --sans: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

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

html {
  color-scheme: dark;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow behind the hero */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 80% 45% at 50% -10%,
    rgba(47, 224, 191, 0.1),
    transparent 70%
  );
  z-index: -1;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration-thickness: 2px;
  color: #6ffde0;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* Header */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2rem 0;
}

.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.wordmark .cursor {
  color: var(--accent);
  animation: blink 1.2s steps(1) infinite;
}

/* Hero */

.hero {
  padding: 5.5rem 0 6.5rem;
  animation: rise 0.7s ease-out both;
}

.hero h1 {
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 780;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.hero h1 .glow {
  color: var(--accent);
  text-shadow: 0 0 40px var(--glow);
}

/* Signature: measurement ruler — one tick marks the right size. */
.ruler {
  display: flex;
  align-items: flex-end;
  gap: clamp(0.6rem, 2.5vw, 1.4rem);
  height: 24px;
  margin: 2.25rem 0 2.5rem;
}

.ruler span {
  width: 1px;
  height: 10px;
  background: rgba(233, 239, 238, 0.22);
  animation: tick-in 0.4s ease-out both;
}

.ruler .mark {
  width: 3px;
  height: 24px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--glow);
}

.ruler span:nth-child(1)  { animation-delay: 0.05s; }
.ruler span:nth-child(2)  { animation-delay: 0.1s; }
.ruler span:nth-child(3)  { animation-delay: 0.15s; }
.ruler span:nth-child(4)  { animation-delay: 0.2s; }
.ruler span:nth-child(5)  { animation-delay: 0.25s; }
.ruler span:nth-child(6)  { animation-delay: 0.3s; }
.ruler span:nth-child(7)  { animation-delay: 0.35s; }
.ruler span:nth-child(8)  { animation-delay: 0.4s; }
.ruler span:nth-child(9)  { animation-delay: 0.45s; }
.ruler span:nth-child(10) { animation-delay: 0.5s; }
.ruler span:nth-child(11) { animation-delay: 0.55s; }
.ruler span:nth-child(12) { animation-delay: 0.6s; }
.ruler span:nth-child(13) { animation-delay: 0.65s; }

.lede {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 34rem;
  margin-bottom: 2.5rem;
}

.cta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  text-decoration: none;
  padding: 0.8rem 1.6rem;
  border-radius: 6px;
  box-shadow: 0 0 0 rgba(47, 224, 191, 0);
  transition: box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.cta:hover {
  color: var(--bg);
  background: #56f2d3;
  box-shadow: 0 0 28px var(--glow);
  transform: translateY(-1px);
}

/* Sections */

.section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 2rem;
}

.services,
.expertise,
.contact {
  border-top: 1px solid var(--hairline);
  padding: 3.5rem 0;
}

/* Services — elevated cards with line icons */

.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.service {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 1.75rem;
  transition: border-color 0.25s ease, transform 0.25s ease,
    box-shadow 0.25s ease;
}

.service:hover {
  border-color: rgba(47, 224, 191, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 18px rgba(47, 224, 191, 0.07);
}

.service-icon {
  display: block;
  width: 28px;
  height: 28px;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.service h3 {
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.service p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Expertise — terminal window */

.terminal {
  background: #0b100f;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}

.terminal-bar .dot {
  appearance: none;
  border: 0;
  padding: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(233, 239, 238, 0.14);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}

.dot-close::before {
  content: "\00d7";
}

.dot-min::before {
  content: "\2212";
}

.dot-zoom::before {
  content: "+";
}

.terminal-bar:hover .dot-close,
.dot-close:focus-visible {
  background: #ff5f57;
  color: rgba(0, 0, 0, 0.6);
}

.terminal-bar:hover .dot-min,
.dot-min:focus-visible {
  background: #febc2e;
  color: rgba(0, 0, 0, 0.6);
}

.terminal-bar:hover .dot-zoom,
.dot-zoom:focus-visible {
  background: #28c840;
  color: rgba(0, 0, 0, 0.6);
}

.dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Window states (easter eggs) */

.terminal-body {
  overflow: hidden;
  max-height: 60rem;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.terminal.minimized .terminal-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.terminal {
  transition: margin 0.4s ease;
}

.terminal.zoomed {
  margin-left: min(0rem, calc(50% - 50vw + 1.5rem));
  margin-right: min(0rem, calc(50% - 50vw + 1.5rem));
}

.egg-line {
  color: var(--ink);
}

.terminal.shake {
  animation: shake 0.35s ease;
  animation-timeline: auto;
}

@keyframes shake {
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(2px);
  }
}

.terminal-title {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.terminal-body {
  padding: 1.5rem 1.75rem;
  font-family: var(--mono);
  font-size: 0.88rem;
}

.prompt {
  color: var(--ink);
  margin: 0;
}

.prompt-sign {
  color: var(--muted);
}

.terminal-body dl {
  margin: 1.25rem 0;
}

.caret {
  color: var(--accent);
  animation: blink 1.2s steps(1) infinite;
}

.skill {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 0.25rem 2rem;
  padding: 0.55rem 0;
}

.skill dt {
  font-weight: 600;
  color: var(--accent);
}

.skill dt::before {
  content: "▸ ";
  color: var(--muted);
}

.skill dd {
  color: var(--muted);
  line-height: 1.55;
}

/* Contact */

.contact-line {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.5;
}

.contact-line a {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 500;
}

.profiles {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-top: 1.75rem;
}

.profiles a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.profiles a:hover {
  color: var(--accent);
}

/* Footer */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--hairline);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.wordmark.small {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Motion */

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

@keyframes tick-in {
  from {
    opacity: 0;
    transform: scaleY(0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* Scroll reveals — CSS-only, progressive enhancement */
@supports (animation-timeline: view()) {
  .service,
  .terminal,
  .contact-line {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .ruler span,
  .wordmark .cursor,
  .caret,
  .service,
  .skill,
  .contact-line {
    animation: none;
  }

  .cta:hover,
  .service:hover {
    transform: none;
  }

  .terminal.shake {
    animation: none;
  }

  .terminal,
  .terminal-body {
    transition: none;
  }
}

/* Mobile */

@media (max-width: 600px) {
  .hero {
    padding: 3.5rem 0 4rem;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .skill {
    grid-template-columns: 1fr;
  }
}
