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

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-hover: #30363d;
  --border-color: #30363d;
  --border-hover: #484f58;
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --accent-orange: #f4a261;
  --accent-blue: #58a6ff;
  --shadow-color: rgba(0, 0, 0, 0.4);
  --glow-color: rgba(244, 162, 97, 0.3);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  background: radial-gradient(circle at top right, rgba(88, 166, 255, 0.12), transparent 45%), var(--bg-primary);
  padding: 2rem 0;
}

body.home-page {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(72, 79, 88, 0.25) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(72, 79, 88, 0.25) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.28;
  z-index: -1;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

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

main {
  flex: 1;
}

.home-page main {
  width: 100%;
}

.home-shell {
  width: min(980px, 94vw);
  margin: 0 auto;
  display: block;
}

.home-page .container {
  width: 100%;
}

.site-header {
  position: static;
  z-index: 50;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-accent {
  color: var(--accent-orange);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.site-nav a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

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

.nav-toggle {
  display: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1;
  width: 38px;
  height: 38px;
  cursor: pointer;
}

.hero {
  padding: 6rem 0 4rem;
}

.dashboard-wrap {
  padding: 0.8rem 0;
  width: 100%;
}

.dashboard-grid-layout {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1.4fr 1.4fr 1fr;
  grid-template-areas:
    'intro intro about'
    'contact time about'
    'contact design now'
    'message projects now';
}

.tile {
  min-height: 110px;
}

.intro-tile {
  grid-area: intro;
  position: relative;
  overflow: hidden;
  border-color: rgba(244, 162, 97, 0.35);
  padding-right: 220px;
}

.intro-tile h1 {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  margin-bottom: 0.45rem;
}

.profile-icon-block {
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  width: 170px;
  height: 170px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: linear-gradient(145deg, rgba(244, 162, 97, 0.14), rgba(88, 166, 255, 0.08));
  display: grid;
  place-items: center;
  padding: 0.8rem;
  overflow: hidden;
}

.profile-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.about-tile {
  grid-area: about;
}

.about-tile h2 {
  margin-bottom: 0.45rem;
}

.about-tile p {
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.contact-tile {
  grid-area: contact;
}

.contact-tile h3 {
  margin-bottom: 0.5rem;
}

.muted-copy {
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.simple-list {
  list-style: none;
  margin-top: 0.2rem;
  display: grid;
  gap: 0.15rem;
}

.simple-list a {
  color: var(--text-primary);
}

.simple-list a:hover {
  color: var(--accent-blue);
}

.time-tile {
  grid-area: time;
  display: grid;
  align-content: center;
}

.time-line {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.45rem;
}

.time-line span {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

.link-tile {
  display: block;
}

.link-tile h3 {
  margin-bottom: 0.3rem;
}

.link-tile p {
  color: var(--text-secondary);
}

.page-footer-actions {
  width: min(1100px, 92%);
  margin: 3rem auto 1.5rem;
  padding-top: 1.75rem;
  text-align: center;
  position: relative;
}

.page-footer-actions::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  height: 1px;
  width: min(920px, 92%);
  background: linear-gradient(90deg, transparent, rgba(72, 79, 88, 0.65), transparent);
}

.back-link {
  color: var(--accent-orange);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: #ffc78f;
}

.link-tile:hover h3 {
  color: var(--accent-blue);
}

.now-tile {
  grid-area: now;
}

.now-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.dot-live {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-orange);
  box-shadow: 0 0 10px var(--glow-color);
}

.now-tile p {
  color: var(--text-secondary);
}

.dashboard-grid-layout > :nth-child(5) {
  grid-area: design;
}

.dashboard-grid-layout > :nth-child(7) {
  grid-area: message;
}

.dashboard-grid-layout > :nth-child(8) {
  grid-area: projects;
}

.message-tile h3 {
  margin-bottom: 0.3rem;
}

.message-tile p {
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}




#message-status {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.message-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 12px;
  padding: 0;
  background: transparent;
  z-index: 120;
}

.message-modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

/* Ensure dialog is hidden by default */
.message-modal[open] {
  display: block;
}

.message-modal:not([open]) {
  display: none;
}

.message-modal-content {
  width: min(460px, 96vw);
}

.message-modal-content h3 {
  color: #ffffff;
}

.message-type-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
  border: none;
  padding: 0;
}

.message-type-row label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.message-type-row input {
  cursor: pointer;
}

.message-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message-form input,
.message-form textarea {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
}

.message-form input::placeholder,
.message-form textarea::placeholder {
  color: var(--text-secondary);
}

.message-form input:focus,
.message-form textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.message-form textarea {
  min-height: 120px;
  resize: vertical;
  max-height: 300px;
}

.message-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.eyebrow {
  color: var(--accent-blue);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
  max-width: 14ch;
  margin-bottom: 1rem;
}

.hero-copy {
  max-width: 58ch;
  color: var(--text-secondary);
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.home-page a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-page .card.tile.link-tile,
.home-page .btn {
  text-decoration: none;
}

.btn {
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn-primary {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #0d1117;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 18px var(--glow-color);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.btn-secondary:hover {
  background-color: rgba(88, 166, 255, 0.15);
}

.btn-borderless {
  border-color: transparent;
}

.btn-borderless:hover {
  background-color: rgba(88, 166, 255, 0.1);
}

.section {
  padding: 2rem 0 3rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}

.text-link {
  color: var(--accent-blue);
}

.text-link:hover {
  text-decoration: underline;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.feature-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.3fr 1fr;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.2s ease;
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-color);
}

.project-card h3 {
  margin: 0.45rem 0;
}

.project-card p {
  color: var(--text-secondary);
}

.spotlight-card {
  position: relative;
  overflow: hidden;
}

.spotlight-card::after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  right: -90px;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 162, 97, 0.18), transparent 65%);
  pointer-events: none;
}

.status-card h3 {
  margin-bottom: 0.4rem;
}

.status-card p {
  color: var(--text-secondary);
  margin-bottom: 0.7rem;
}

.now-list {
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.now-list li {
  color: var(--text-secondary);
  position: relative;
  padding-left: 1rem;
}

.now-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-orange);
}

.tag {
  display: inline-flex;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pill {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.site-footer {
  border-top: none;
  margin-top: 0.8rem;
}

.footer-wrap {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.page-hero {
  padding: 4rem 0 1.5rem;
}

.page-hero p {
  color: var(--text-secondary);
  max-width: 62ch;
}

.list-stack {
  display: grid;
  gap: 1rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.6rem 0 0.85rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.project-placeholder {
  border-style: dashed;
}

.about-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.contact-card {
  max-width: 700px;
}

.contact-note {
  margin-top: 0.5rem;
  color: var(--text-secondary);
}

.contact-actions {
  margin-top: 1rem;
}

.stack-pills {
  margin-top: 0.65rem;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 768px) {
  body {
    padding: 0.55rem 0 1rem;
  }

  .home-page main {
    align-items: flex-start;
  }

  .home-shell {
    width: min(96vw, 760px);
    min-height: auto;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem 4%;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
  }

  .site-nav[data-open="true"] {
    display: flex;
  }

  .hero {
    padding-top: 4rem;
  }

  .feature-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-grid-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      'intro intro'
      'about about'
      'contact contact'
      'time design'
      'now now'
      'message projects';
  }

  .intro-tile {
    padding-right: 1rem;
  }

  .profile-icon-block {
    position: static;
    margin-top: 1rem;
    width: 120px;
    height: 120px;
  }

  .time-line {
    font-size: 1.7rem;
  }

  /* ===== MESSAGE MODAL MOBILE ===== */
  .message-modal-content {
    width: min(400px, 92vw);
    padding: 0.85rem;
  }

  .message-form textarea {
    min-height: 100px;
  }

  .message-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .message-actions .btn {
    width: 100%;
    text-align: center;
  }

  #contact-fields input {
    width: 100%;
  }

  /* ===== PROJECTS PAGE MOBILE ===== */
  .page-hero {
    padding: 2.5rem 0 1rem;
  }

  .page-hero h1 {
    font-size: 1.6rem;
  }

  .page-hero p {
    font-size: 0.9rem;
  }

  .view-tabs {
    gap: 0.5rem;
    margin-top: 1rem;
    padding-bottom: 0.6rem;
  }

  .tab-link {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }

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

  .project-card {
    gap: 0.75rem;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .card-header h2 {
    font-size: 1.15rem;
  }

  .project-meta {
    gap: 0.35rem;
  }

  .project-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .project-links .btn {
    width: 100%;
    text-align: center;
    padding: 0.7rem 1rem;
  }

  .page-footer-actions {
    margin: 2rem auto 1rem;
    padding-top: 1.25rem;
  }

  .back-link {
    font-size: 0.9rem;
  }

  /* ===== BUTTONS MOBILE ===== */
  .btn {
    font-size: 0.9rem;
    padding: 0.6rem 0.9rem;
  }

  /* ===== ABOUT GRID MOBILE ===== */
  .about-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 1.5rem 0 2rem;
  }

  .section-head h2 {
    font-size: 1.2rem;
  }

  /* ===== FOOTER MOBILE ===== */
  .footer-wrap {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* ========== SMALL SCREENS (480px) ========== */
@media (max-width: 480px) {
  body {
    padding: 0.35rem 0 0.75rem;
  }

  body::before {
    background-size: 32px 32px;
  }

  .home-shell {
    width: 98vw;
  }

  .container {
    width: 94%;
  }

  .intro-tile h1 {
    font-size: 1.2rem;
  }

  .hero-copy {
    font-size: 0.88rem;
  }

  .profile-icon-block {
    width: 100px;
    height: 100px;
  }

  .about-tile h2 {
    font-size: 1.1rem;
  }

  .about-tile p {
    font-size: 0.88rem;
  }

  .time-line {
    font-size: 1.4rem;
  }

  .eyebrow {
    font-size: 0.72rem;
  }

  .card {
    padding: 0.85rem;
  }

  .tile {
    min-height: 90px;
  }

  /* Projects page small screen */
  .page-hero {
    padding: 1.8rem 0 0.75rem;
  }

  .page-hero h1 {
    font-size: 1.35rem;
  }

  .view-tabs {
    gap: 0.25rem;
  }

  .tab-link {
    padding: 0.5rem 0.6rem;
    font-size: 0.82rem;
  }

  .card-header h2 {
    font-size: 1.05rem;
  }

  .tag {
    font-size: 0.68rem;
    padding: 0.12rem 0.45rem;
  }

  .status-badge,
  .demo-badge {
    font-size: 0.68rem;
    padding: 0.3rem 0.6rem;
  }

  .message-modal-content {
    width: 96vw;
    padding: 0.75rem;
  }

  .message-modal-content h3 {
    font-size: 1.05rem;
  }

  .message-type-row label {
    font-size: 0.88rem;
  }

  .message-form input,
  .message-form textarea {
    font-size: 0.88rem;
    padding: 0.6rem;
  }
}

/* ========== PROJECTS PAGE STYLES ========== */

.view-tabs {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-bottom: 0.75rem;
  position: relative;
}

.view-tabs::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: min(860px, 92%);
  background: linear-gradient(90deg, rgba(72, 79, 88, 0.65), transparent);
}

.tab-link {
  border: none;
  background: transparent;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  transition: color 0.3s ease, text-shadow 0.3s ease;
  position: relative;
  bottom: -1px;
  cursor: pointer;
}

.tab-link:hover {
  color: var(--accent-blue);
}

.tab-link.active {
  color: var(--accent-orange);
  text-shadow: 0 0 12px rgba(244, 162, 97, 0.6), 0 0 24px rgba(244, 162, 97, 0.25);
}

.tab-underline {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 120px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(244, 162, 97, 0.95), transparent);
  box-shadow: 0 0 12px rgba(244, 162, 97, 0.5), 0 0 24px rgba(244, 162, 97, 0.2);
  pointer-events: none;
  opacity: 0;
}

.tab-underline.ready {
  opacity: 1;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-orange);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-header h2 {
  margin: 0;
}

.status-badge,
.demo-badge {
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.status-badge.public {
  background-color: rgba(88, 166, 255, 0.15);
  color: var(--accent-blue);
}

.status-badge.private {
  background-color: rgba(244, 162, 97, 0.15);
  color: var(--accent-orange);
}

.demo-badge {
  background-color: rgba(88, 166, 255, 0.15);
  color: var(--accent-blue);
}

.design-card .project-links {
  justify-content: flex-start;
  margin-top: 1rem;
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.design-card {
  cursor: pointer;
}

.design-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
}
