.contact-section {
  background: var(--color-bg);
  padding: 5rem 0;
  position: relative;
  margin-top: 2rem;
}

.contact-page {
  padding: 2rem;
  padding-top: calc(var(--header-height) + 2rem);
  min-height: calc(100dvh - var(--header-height));
  background: var(--color-bg);
}

.contact-section::before {
  content: none;
}

.contact-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  padding: 0 2rem;
  min-height: 500px;
}

.contact-form-section,
.map-section {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-small);
}

.contact-form-section {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.typing-title {
  margin: 0;
  font-family: var(--font-base);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  white-space: normal;
  overflow: visible;
  width: auto;
  border-right: 0;
  height: auto;
  opacity: 1;
}

.typing-title.animate {
  opacity: 1;
  animation: none;
}

.contact-form {
  width: 100%;
}

.form-group {
  position: relative;
  margin-bottom: 2rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 0;
  font-size: 1rem;
  border: none;
  background: transparent;
  outline: none;
}

.focus-border {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-border);
  transition: background 0.3s ease;
}

.form-group input:focus ~ .focus-border,
.form-group textarea:focus ~ .focus-border {
  background: var(--color-accent);
}

.form-group label {
  position: absolute;
  left: 0;
  top: 0.8rem;
  color: #999;
  font-size: 1rem;
  transition: 0.3s ease;
  pointer-events: none;
}

.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  top: -1.2rem;
  font-size: 0.8rem;
  color: var(--color-accent);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.submit-btn {
  position: relative;
  padding: 0.8rem 2rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--border-radius-md);
  font-size: 1rem;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.submit-btn:hover {
  transform: translateY(-2px);
  background: var(--color-accent);
}

.btn-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.1);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.submit-btn:hover .btn-hover {
  transform: translateX(0);
}

.submit-btn.success {
  background-color: #111 !important;
  color: white !important;
  transition: background-color 0.3s ease;
}

.submit-btn.success:hover {
  background-color: #333 !important;
}

.map-section {
  width: 100%;
  min-height: 400px;
  position: relative;
  overflow: hidden;
  background: #f7f7f7;
}

.map-section::after {
  content: "Cornell Tech, New York";
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 1;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
}

.map-container {
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: none;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@keyframes typing {
  from { width: 0; }
  to { width: 17ch; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: black; }
}

@media (max-width: 1000px) and (min-width: 568px) {
  .contact-section { padding: 3rem 0; }
  .typing-title { font-size: 2.5rem !important; }
  .contact-container { grid-template-columns: 1fr; min-height: auto; gap: 2rem; }
  .contact-form-section { padding: 1.5rem; }
  .map-section { height: 300px; }
}

@media (max-width: 568px) {
  .contact-section { padding: 3rem 0; }
  .contact-page { padding: calc(var(--header-height) + 1.25rem) 0 1.5rem; }
  .typing-title { font-size: 1.5rem !important; width: auto; }
  .contact-container { grid-template-columns: 1fr; min-height: auto; gap: 1.5rem; padding: 0 1rem; }
  .contact-form-section { padding: 1.5rem; min-height: 400px; }
  .map-section { height: 200px; }
  .form-group { margin-bottom: 1.5rem; }
  .submit-btn { width: 100%; }
}
