@font-face {
  font-family: 'DINNextLTPro-Condensed';
  src: url('/fonts/fonnts.com-DINNextLTPro-Condensed-1.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --bg:        #F4F2ED;
  --surface:   white;
  --tile:      #FFFFFF;
  --border:    rgba(0,0,0,0.10);
  --border-md: rgba(0,0,0,0.16);
  --text-1:    #1A1916;
  --text-2:    #5A574F;
  --text-3:    #9A9690;
  --btc:       #F7931A;
  --btc-bg:    #FFF7EC;
  --btc-bd:    rgba(247,147,26,0.35);
  --run-bg:    #1D9E75;
  --quote-bg:  #2C3E52;
  --quote-text:#E8EDF2;
  --radius:    14px;
  --gap:       10px;
}

html, body {
  height: 100%;
  background: var(--bg);
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

p { margin: 0; }

/* ---- Container ---- */
.container {
  max-width: 1024px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ---- Header ---- */
header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  animation: fadeUp 0.5s ease both;
}

.name {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-1);
}

.tagline {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 300;
  letter-spacing: 0.01em;
}

/* ---- Grid ---- */
main {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, calc((min(100vw, 1024px) - 78px) / 6));
  gap: var(--gap);
  grid-template-areas:
    "quote   email    work      twitter"
    "quote   github   photo     bitcoin"
    "africanjan github running  cloudgorilla"
    "blog    aareguru drawings   .";
}

/* ---- Base tile ---- */
.tile {
  background: var(--tile);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
  animation: fadeUp 0.5s ease both;
}

.tile a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.tile:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.15);
  border-color: var(--border-md);
  z-index: 2;
}

.tile:nth-child(1)  { animation-delay: 0.05s; }
.tile:nth-child(2)  { animation-delay: 0.10s; }
.tile:nth-child(3)  { animation-delay: 0.13s; }
.tile:nth-child(4)  { animation-delay: 0.16s; }
.tile:nth-child(5)  { animation-delay: 0.19s; }
.tile:nth-child(6)  { animation-delay: 0.22s; }
.tile:nth-child(7)  { animation-delay: 0.25s; }
.tile:nth-child(8)  { animation-delay: 0.28s; }
.tile:nth-child(9)  { animation-delay: 0.31s; }
.tile:nth-child(10) { animation-delay: 0.34s; }
.tile:nth-child(11) { animation-delay: 0.37s; }
.tile:nth-child(12) { animation-delay: 0.40s; }

.tile-label {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  height: 100%;
}

/* ---- Quote tile ---- */
#quote {
  grid-area: quote;
  background: var(--quote-bg);
  border-color: transparent;
}

#quote .inner {
  justify-content: space-between;
  padding: 20px;
}

#quote blockquote {
  font-size: 13px;
  line-height: 1.65;
  color: var(--quote-text);
  font-weight: 300;
  font-style: italic;
}

#quote cite {
  font-size: 11px;
  color: rgba(232,237,242,0.55);
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---- Email tile ---- */
#email {
  grid-area: email;
  background: #2E9E60;
  border-color: transparent;
}

#email .label {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#email .addr {
  font-size: 12px;
  color: #ffffff;
  font-weight: 400;
}

/* ---- LinkedIn tile ---- */
#work {
  grid-area: work;
  background: #0A66C2;
  border-color: transparent;
}

.tile-logo-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Twitter/X tile ---- */
#twitter {
  grid-area: twitter;
  background: #000000;
  border-color: rgba(255,255,255,0.12);
}

/* ---- GitHub tile ---- */
#github {
  grid-area: github;
  background: var(--surface);  
}

#github .label-top {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-3);
}

#github .code-line {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-2);
}

#github .cube-wrapper {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 168px;
  pointer-events: none;
}

#github .gh-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  opacity: 0.4;
}

/* ---- Bitcoin tile ---- */
#bitcoin {
  grid-area: bitcoin;
  background: var(--btc-bg);
  border-color: var(--btc-bd);
  cursor: pointer;
  overflow: hidden;
}

.btc-label {
  font-size: 10px;
  color: var(--btc);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btc-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--btc);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

.btc-price {
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: -0.03em;
}

.btc-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 3px;
}

.btc-icon {
  position: absolute;
  top: 50%;
  right: -29px;
  transform: translateY(-60%);
  width: 160px;
  height: 160px;
  opacity: 0.06;
  pointer-events: none;
}

/* ---- Flickr tile ---- */
#photography {
  grid-area: photo;
  background: url('/images/shoes.jpg') center/cover no-repeat #1A1A1A;
  border: none;
}

#photography .inner {
  position: relative;
  z-index: 1;
}

#photography .label {
  color: rgba(255,255,255,0.8);
}

/* ---- Africa tile ---- */
#africanjan {
  grid-area: africanjan;
  background: url('/images/africanjan.jpg') center/cover no-repeat #222;
  border-color: rgba(255,255,255,0.12);
  filter: grayscale(1);
}

#africanjan::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
}

#africanjan .inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
  justify-content: flex-end;
}

.africa-label {
  color: rgba(255,255,255,0.7);
}

.africa-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  font-style: italic;
  font-weight: 300;
}

/* ---- Running tile ---- */
#running {
  grid-area: running;
  background: var(--run-bg);
  border-color: transparent;
}

#running .label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.running-icon {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  filter: brightness(0) invert(1);
  opacity: 0.5;
  transform: scaleX(-1);
}

.running-text {
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  font-style: italic;
  font-weight: 300;
}

/* ---- CloudGorilla tile ---- */
#cloudgorilla {
  grid-area: cloudgorilla;
  background: #1C2B3A;
  border-color: rgba(255,255,255,0.12);
}

.cg-icon-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ---- Blog tile ---- */
#blog {
  grid-area: blog;
  background: var(--surface);
}

.blog-label {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.blog-title {
  font-size: 13px;
  color: var(--text-2);
  font-style: italic;
  font-weight: 300;
}

/* ---- AareGuru tile ---- */
#aareguru {
  grid-area: aareguru;
  background: #2980B9;
  border-color: transparent;
}

.aare-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  height: 100%;
}

.aare-temp {
  font-family: 'DINNextLTPro-Condensed', sans-serif;
  font-size: 52px;
  font-weight: normal;
  color: #ffffff;
  letter-spacing: -0.01em;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.aare-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  font-style: italic;
  font-weight: 300;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 20px);
  white-space: nowrap;
}

/* ---- Drawings tile ---- */
#drawings {
  grid-area: drawings;
  background: #c8a882;
  border-color: transparent;
}

#drawings::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/images/drawings.png') center/cover no-repeat;
}

/* ---- Footer ---- */
footer {
  margin-top: auto;
  padding: 14px 0 18px;
}

footer code {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
}

/* ---- Animations ---- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Mobile breakpoint ---- */
@media (max-width: 700px) {
  main {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: calc((min(100vw, 700px) - 58px) / 3);
    grid-template-rows: auto;
    grid-template-areas:
      "quote       quote"
      "email       work"
      "twitter     github"
      "photo       bitcoin"
      "africanjan  running"
      "cloudgorilla aareguru"
      "blog         drawings";
  }
  .btc-icon { display: none; }
  .btc-price { font-size: 16px; }
  #github .code-line { display: none; }
  #github .cube-wrapper { width: 160px; height: 112px; }
  .aare-sub { display: none; }
}

@media (max-width: 400px) {
  .container { padding: 16px 12px 0; }
  main { gap: 8px; }
  header { flex-direction: column; gap: 2px; }
}
