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

:root {
  --bg: #f4f4f4;
  --fg: #181716;
  --accent: #181716;
  --dim: #888;
  --border: #c8c8c8;
  --green: #0053f0;
  --amber: #0053f0;
  --font: 'IBM Plex Mono', monospace;
}

html, body {
  height: 100%;
  background: transparent;
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ── Unicorn Studio background ── */
#unicorn-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#unicorn-bg [data-us-project] {
  /* Cover the viewport at any aspect ratio (animation is 1920×929 ≈ 2.067:1) */
  width: 100vw !important;
  height: 100vh !important;
  zoom: 1.02;
}
/* Hide animation on tablets and mobile: too zoomed and heavy on small screens */
@media (max-width: 1024px) {
  #unicorn-bg { display: none; }
  html, body { background: var(--bg); }
}
.header, .modal-header, .modal-title, .footer{ text-transform: uppercase;}
/* ── Terminal frame ── */
.terminal {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  padding: 12px;
  position: relative;
  z-index: 1;
}

.frame {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  background: rgba(244, 244, 244, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-height: 100vh;
  max-height: 100dvh;
  transition: max-height 0.35s ease;
}
.frame.minimized {
  max-height: 68px; /* header only: 52px logo + 12px padding + 4px borders */
}

/* ── Header row ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
}

.logo-img {
  height: 52px;
  width: auto;
  display: block;
  user-select: none;
}

.minimize-btn {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 12px;
  color: var(--dim);
  cursor: pointer;
  padding: 2px 4px;
  letter-spacing: 0.05em;
  transition: color 0.15s;
  flex-shrink: 0;
}
.minimize-btn:hover { color: var(--fg); }

.nav {
  display: flex;
  gap: 28px;
}

.nav a {
  color: var(--fg);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.08em;
  transition: color 0.15s;
  cursor: pointer;
  user-select: none;
}

.nav a .key {
  color: var(--amber);
  font-weight: 700;
}

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

/* ── Minimized state ── */
.body, .footer {
  transition: max-height 0.35s ease, opacity 0.3s ease;
  max-height: 100vh;
  max-height: 100dvh;
  opacity: 1;
}
.frame.minimized .body,
.frame.minimized .footer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ── Main content area ── */
.body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.output {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 20px 8px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* ── Input row ── */
.input-row {
  display: flex;
  align-items: center;
  padding: 8px 20px 10px;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.prompt-label {
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  user-select: none;
}

.prompt-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  flex: 1;
  caret-color: var(--green);
}

/* ── Footer row ── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.footer-tagline {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--dim);
  text-transform: uppercase;
  user-select: none;
}

.footer-nav a {
  color: var(--dim);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.08em;
  transition: color 0.15s;
  cursor: pointer;
  user-select: none;
}

.footer-nav a .key { color: var(--amber); font-weight: 700; }
.footer-nav a:hover { color: var(--fg); }

/* ── Terminal output lines ── */
.line {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  opacity: 0;
  animation: appear 0.05s forwards;
}

@keyframes appear { to { opacity: 1; } }

.line.cmd { color: var(--green); }
.line.info { color: var(--fg); }
.line.dim  { color: var(--dim); }
.line.accent { color: var(--accent); font-weight: 500; }
.line.amber { color: var(--amber); }
.line.error { color: #cc2200; }
.line.blank { height: 0.8em; }

.line.ascii-image {
  display: block;
  opacity: 0;
  animation: appear 0.05s forwards;
  padding: 4px 0;
  mix-blend-mode: darken;
}
.line.ascii-image img {
  width: 340px;
  max-width: 80%;
  display: block;
}
@media (max-width: 768px) {
  .line.ascii-image img { width: 220px; }
}
@media (max-width: 480px) {
  .line.ascii-image img { width: 160px; }
}
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.output::-webkit-scrollbar { width: 4px; }
.output::-webkit-scrollbar-track { background: transparent; }
.output::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ── Corner decorations ── */
.corner {
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: var(--border);
  border-style: solid;
  pointer-events: none;
}
.corner.tl { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.corner.tr { top: -1px; right: -1px; border-width: 1px 1px 0 0; }
.corner.bl { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }
.corner.br { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

/* ── Scrollbar hide for body ── */
body { scrollbar-width: none; }

/* ── Contact modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: none;
}
.modal-backdrop.open .modal {
  pointer-events: all;
}
.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  width: 480px;
  max-width: calc(100vw - 48px);
  position: absolute;
  top: 80px;
  right: 40px;
  pointer-events: none;
  transition: opacity 0.2s ease;
  user-select: none;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.modal-title { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--accent); }
.modal-header { cursor: grab; }
.modal-header.dragging { cursor: grabbing; }
.modal-close {
  background: none; border: none; font-family: var(--font);
  font-size: 12px; color: var(--dim); cursor: pointer;
  padding: 2px 4px; letter-spacing: 0.05em; transition: color 0.15s;
}
.modal-close:hover { color: var(--fg); }
.modal-body { padding: 24px 20px 20px; }
.modal-intro { font-size: 12px; color: var(--dim); margin-bottom: 20px; line-height: 1.6; }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.form-group label { font-size: 11px; letter-spacing: 0.1em; color: var(--dim); text-transform: uppercase; }
.form-group input, .form-group textarea, .form-group select {
  background: var(--bg); border: 1px solid var(--border);
  font-family: var(--font); font-size: 13px; color: var(--fg);
  padding: 8px 10px; outline: none; transition: border-color 0.15s; width: 100%; resize: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--green); }
.form-group select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}
.form-group select option {
  background-color: var(--bg);
  color: var(--fg);
}
.form-group textarea { height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-submit {
  margin-top: 20px; width: 100%; background: var(--fg); color: var(--bg);
  border: none; font-family: var(--font); font-size: 12px; font-weight: 700;
  letter-spacing: 0.15em; padding: 10px 16px; cursor: pointer;
  text-transform: uppercase; transition: background 0.15s, color 0.15s;
}
.form-submit:hover { background: var(--green); }
.form-sent { text-align: center; padding: 32px 0 16px; display: none; }
.form-sent.visible { display: block; }
.form-sent .sent-label { font-size: 20px; color: var(--green); margin-bottom: 12px; }
.form-sent p { font-size: 12px; color: var(--dim); line-height: 1.8; }
.form-sent strong { color: var(--fg); font-weight: 700; }

/* ── Testimonials modal ── */
#testimonialsModal .modal {
  top: auto;
  bottom: 40px;
  left: auto;
  right: 40px;
  width: 400px;
}

.testimonial-counter {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.12em;
  font-weight: 500;
}

.testimonial-body {
  padding: 28px 20px 20px;
}

.testimonial-quote {
  font-size: 13px;
  color: var(--fg);
  line-height: 1.7;
  margin-bottom: 14px;
  font-style: italic;
  user-select: text;
}

.testimonial-attr {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.testimonial-nav {
  display: flex;
  gap: 8px;
}

.testimonial-btn {
  background: none;
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 13px;
  color: var(--fg);
  padding: 4px 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1.4;
}

.testimonial-btn:hover:not(:disabled) {
  border-color: var(--fg);
}

.testimonial-btn:disabled {
  color: var(--border);
  cursor: default;
}

/* ── Responsive ── */
@media (max-width: 768px) {

  /* Tighter frame */
  .terminal { padding: 6px; }

  /* Header: logo + minimize on row 1, nav wraps to row 2 */
  .header {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 0;
    padding: 6px 12px;
  }

  .logo-img { height: 36px; }

  .minimize-btn { display: none; }

  /* Nav fills full width on its own row */
  .nav {
    width: 100%;
    order: 3;
    flex-wrap: wrap;
    gap: 8px 14px;
  }
  .nav a { font-size: 11px; }

  /* Output padding */
  .output { padding: 14px 12px 6px; }

  /* Input row */
  .input-row { padding: 6px 12px 8px; }
  .prompt-input { font-size: 14px; }
  .form-group input,
  .form-group textarea,
  .form-group select { font-size: 16px; }

  /* Footer */
  .footer { padding: 6px 12px; }
  .footer-tagline { font-size: 10px; letter-spacing: 0.04em; }

  /* ASCII logo: even smaller on mobile */
  .line.ascii { font-size: 4px; letter-spacing: 0.08em; }

  /* Terminal lines */
  .line { font-size: 12px; }

  /* Modals: full width, anchored to bottom */
  .modal {
    width: 100%;
    max-width: 100%;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0 !important;
    right: 0 !important;
    max-height: 70dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Form two-col collapses to single */
  .form-row { grid-template-columns: 1fr; }

  .modal-body { padding: 16px 14px 14px; }
}

@media (max-width: 480px) {
  /* Hide tagline on very small screens */
  .footer-tagline { display: none; }

  /* Nav fits on one line */
  .nav { gap: 10px 12px; }

  .line.ascii { font-size: 3px; letter-spacing: 0.05em; }
}
