/* ============================================================
   Font Declarations
   Place woff2 files in assets/fonts/:
     Ubuntu-Regular.woff2
     Ubuntu-Bold.woff2
     UbuntuMono-Regular.woff2
   ============================================================ */

@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/Ubuntu-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/Ubuntu-Bold.woff2') format('woff2');
}

@font-face {
  font-family: 'Ubuntu Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/UbuntuMono-Regular.woff2') format('woff2');
}

/* ============================================================
   Colour Palette — Solarized Light
   ============================================================ */

:root {
  /* Solarized base tones */
  --sol-base03:  #002b36;
  --sol-base02:  #073642;
  --sol-base01:  #586e75;
  --sol-base00:  #657b83;
  --sol-base0:   #839496;
  --sol-base1:   #93a1a1;
  --sol-base2:   #eee8d5;  /* page background */
  --sol-base3:   #fdf6e3;  /* raised surfaces, cards */

  /* Solarized accent colours */
  --sol-yellow:  #b58900;
  --sol-orange:  #cb4b16;
  --sol-red:     #dc322f;
  --sol-magenta: #d33682;
  --sol-violet:  #6c71c4;
  --sol-blue:    #268bd2;
  --sol-cyan:    #2aa198;
  --sol-green:   #859900;

  /* Semantic assignments */
  --color-bg:         var(--sol-base2);
  --color-surface:    var(--sol-base3);
  --color-text:       var(--sol-base00);
  --color-text-muted: var(--sol-base1);
  --color-heading:    var(--sol-base01);
  --color-link:       var(--sol-blue);
  --color-link-hover: var(--sol-cyan);
  --color-accent:     var(--sol-yellow);
  --color-border:     var(--sol-base1);
  --color-code-bg:    var(--sol-base3);
  --color-nav-bg:     var(--sol-base02);
  --color-nav-text:   var(--sol-base1);
  --color-nav-active: var(--sol-base3);
}

/* Per-app accent overrides */
body[data-app="treklog"]  { --color-accent: var(--sol-green); }
body[data-app="foursight"] { --color-accent: var(--sol-cyan); }
body[data-app="4615"]      { --color-accent: var(--sol-violet); }

/* ============================================================
   Reset & Box Model
   ============================================================ */

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

/* ============================================================
   Base Typography
   ============================================================ */

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Ubuntu', sans-serif;
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Ubuntu', sans-serif;
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.25;
}

h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.75rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.2rem;  margin-bottom: 0.4rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-link);
  text-decoration: none;
}
a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

code, pre, .monospace {
  font-family: 'Ubuntu Mono', monospace;
}

code {
  background: var(--color-code-bg);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  background: var(--color-code-bg);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================================
   Layout
   ============================================================ */

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================================
   Navigation
   ============================================================ */

.site-nav {
  background: var(--color-nav-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav__brand {
  color: var(--color-nav-active);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
  padding: 0.85rem 0;
  flex-shrink: 0;
}
.site-nav__brand:hover {
  color: var(--color-nav-active);
  text-decoration: none;
  opacity: 0.8;
}

.site-nav__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav__links li a {
  display: block;
  padding: 0.85rem 0.85rem;
  color: var(--color-nav-text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s;
}
.site-nav__links li a:hover {
  color: var(--color-nav-active);
  text-decoration: none;
}
.site-nav__links li a.active {
  color: var(--color-nav-active);
  font-weight: 700;
}

/* ============================================================
   Main Content
   ============================================================ */

main {
  flex: 1;
  padding-bottom: 3rem;
}

.section {
  padding: 3rem 0;
}

.section + .section {
  border-top: 1px solid var(--color-border);
}

.section__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.6rem;
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 3.5rem 0;
}

.hero__name {
  font-size: 3rem;
  margin-bottom: 0.25rem;
}

.hero__tagline {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-bottom: 0;
}

/* App page hero — flex layout for icon + text */
.hero--app .container {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.hero__icon {
  width: 128px;
  height: 128px;
  border-radius: 22px;
  flex-shrink: 0;
}

.hero--app .hero__name {
  font-size: 2.25rem;
}

.hero--app .hero__tagline {
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.appstore-badge img {
  height: 40px;
  width: auto;
}

/* ============================================================
   App Cards
   ============================================================ */

.app-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.app-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-border);
  border-radius: 6px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-card[data-app="treklog"]  { border-top-color: var(--sol-green); }
.app-card[data-app="foursight"] { border-top-color: var(--sol-cyan); }
.app-card[data-app="4615"]      { border-top-color: var(--sol-violet); }

.app-card__icon {
  width: 80px;
  height: 80px;
  border-radius: 16px;
}

.app-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.app-card__body h3 {
  margin-bottom: 0.3rem;
}

.app-card__body p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: auto;
  flex: 1;
}

.app-card__link {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-accent);
}
.app-card__link:hover {
  color: var(--color-link-hover);
  text-decoration: none;
}

/* ============================================================
   YouTube Section
   ============================================================ */

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.video-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s;
}
.video-card:hover {
  border-color: var(--color-link);
  text-decoration: none;
}

.video-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.video-card__info {
  padding: 0.6rem 0.75rem;
}

.video-card__title {
  font-size: 0.85rem;
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card__date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: 'Ubuntu Mono', monospace;
}

.video-fallback {
  display: none;
  margin-top: 1rem;
  color: var(--color-text-muted);
}

/* ============================================================
   Screenshots
   ============================================================ */

.screenshots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.screenshots img {
  border-radius: 12px;
  border: 1px solid var(--color-border);
  width: 100%;
}

/* ============================================================
   Technical Aside
   ============================================================ */

.tech-aside {
  background: var(--color-code-bg);
  border-left: 3px solid var(--color-accent);
  padding: 1rem 1.25rem;
  border-radius: 0 4px 4px 0;
  font-family: 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.tech-aside p { margin-bottom: 0.5rem; }
.tech-aside p:last-child { margin-bottom: 0; }

/* ============================================================
   Skills
   ============================================================ */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 2.5rem;
  margin-top: 0.5rem;
}

.skill-group__heading {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.skill-tags li {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0.2rem 0.55rem;
  font-size: 0.85rem;
  color: var(--color-text);
}

/* ============================================================
   Resume
   ============================================================ */

.resume-header {
  margin-bottom: 0.25rem;
}

.resume-header__meta {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.5rem;
  margin-top: 0.4rem;
}

.resume-header__meta a {
  color: var(--color-text-muted);
}
.resume-header__meta a:hover {
  color: var(--color-link);
}

.resume-header__meta i {
  margin-right: 0.3rem;
}

.experience-entry {
  margin-bottom: 2rem;
}
.experience-entry:last-child { margin-bottom: 0; }

.experience-entry__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.experience-entry__title {
  font-weight: 700;
  color: var(--color-heading);
  font-size: 1rem;
}

.experience-entry__org {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.experience-entry__dates {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-family: 'Ubuntu Mono', monospace;
  white-space: nowrap;
  flex-shrink: 0;
}

.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.project-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 1rem;
  align-items: baseline;
}
.project-list li:last-child { border-bottom: none; }

.project-list__name {
  font-weight: 700;
  color: var(--color-heading);
  white-space: nowrap;
  min-width: 10rem;
  flex-shrink: 0;
}

.project-list__desc {
  color: var(--color-text);
  font-size: 0.95rem;
}

/* ============================================================
   Links / Elsewhere
   ============================================================ */

.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.link-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.link-list li i {
  width: 1rem;
  text-align: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ============================================================
   Contact
   ============================================================ */

.contact-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* ============================================================
   Privacy
   ============================================================ */

.privacy-section {
  margin-bottom: 2.5rem;
}

.privacy-section:last-child { margin-bottom: 0; }

.privacy-section h2 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--color-border);
}

/* ============================================================
   Back-nav link row
   ============================================================ */

.back-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.back-nav a {
  font-size: 0.9rem;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  background: var(--color-nav-bg);
  color: var(--color-nav-text);
  padding: 1rem 1.5rem;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--color-nav-text);
}
.site-footer a:hover {
  color: var(--color-nav-active);
  text-decoration: none;
}

/* ============================================================
   Utility
   ============================================================ */

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

/* ============================================================
   Responsive — 600px breakpoint
   ============================================================ */

@media (max-width: 600px) {
  h1 { font-size: 2rem; }
  .hero__name { font-size: 2rem; }
  .hero--app .hero__name { font-size: 1.75rem; }

  .hero--app .container {
    flex-direction: column;
    gap: 1.25rem;
  }

  .hero__icon {
    width: 96px;
    height: 96px;
  }

  .app-cards {
    grid-template-columns: 1fr;
  }

  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .project-list li {
    flex-direction: column;
    gap: 0.2rem;
  }

  .project-list__name {
    min-width: unset;
  }

  .experience-entry__header {
    flex-direction: column;
    gap: 0.1rem;
  }
}

/* ============================================================
   Print — resume.html only
   ============================================================ */

@media print {
  .site-nav,
  .site-footer {
    display: none !important;
  }

  * {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.4;
  }

  a {
    color: #000 !important;
    text-decoration: none;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }

  /* Don't expand on-page anchors or mailto links */
  a[href^="#"]::after,
  a[href^="mailto:"]::after {
    content: none;
  }

  .container {
    max-width: 100%;
    padding: 0 1cm;
  }

  .section {
    padding: 1.25rem 0;
  }

  .section + .section {
    border-top: 0.5pt solid #ccc;
  }

  .experience-entry {
    page-break-inside: avoid;
  }

  h2 {
    page-break-after: avoid;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .skill-tags li {
    border-color: #ccc;
  }
}
