/* Swift By Heart — shared styles for the calendar page and the day pages.
   Palette: near-black graphite ground, warm white text, the Swift logo's orange as the
   single accent. Type: Spectral SC for headings and labels, Spectral for text. */
:root{
  --paper:#1b1c20;
  --panel:#24252b;
  --ink:#e9e6df;
  --ink2:#a6a49c;
  --rule:rgba(233,230,223,.16);
  --swift:#f05138;
  --swiftsoft:#f2745f;
  --codebg:#16171b;
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0; background:var(--paper); color:var(--ink);
  font-family:"Spectral",serif; font-weight:400; font-size:17px; line-height:1.62;
}
::selection{background:rgba(240,81,56,.35);}
a{color:var(--swiftsoft); text-decoration:none; border-bottom:1px solid rgba(242,116,95,.35);
  overflow-wrap:anywhere;}   /* a link whose text is one long API name may break rather than widen the page */
a:hover{border-bottom-color:var(--swiftsoft);}
.sheet{max-width:920px; margin:0 auto; padding:56px 34px 100px;}
p{margin:0 0 14px;}
p, li, figcaption{overflow-wrap:break-word;}   /* one very long name (an API's full signature) breaks rather than widening the page */
b{font-weight:600;}
code{
  font-family:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
  font-size:.86em; background:rgba(233,230,223,.08); padding:1px 5px; border-radius:3px;
  overflow-wrap:anywhere;   /* a long name in a sentence may break rather than push the page wider than a phone */
}

/* ---------- headings ---------- */
.kicker{
  font-family:"Spectral SC"; font-weight:500; font-size:12.5px; letter-spacing:.3em;
  text-indent:.3em; color:var(--swift); text-align:center; margin:0 0 16px;
}
/* The mark: a heart flown in one line by a swift (course/plates/mark.svg). It is whole as it stands; with .draws, which a
   page gives it in its first frame, the line draws itself once, the swift flies out of it, and the heart beats once. */
.mark{display:block; margin:0 auto 12px; width:124px; height:auto; overflow:visible; transform-origin:50% 55%;}
.mark.draws{animation:mark-beat 1.1s 2.25s ease-in-out both;}
.mark.draws:hover{animation:mark-beat-again 1.1s ease-in-out;}
.mark.draws .mark-in{animation:mark-show .5s ease-out both;}
.mark.draws .mark-line{stroke-dasharray:100; animation:mark-draw 1.55s .15s cubic-bezier(.55,.08,.3,1) both;}
.mark.draws .mark-dots circle{animation:mark-show .25s 1.5s ease-out both;}
.mark.draws .mark-dots circle:nth-child(2){animation-delay:1.58s;}
.mark.draws .mark-dots circle:nth-child(3){animation-delay:1.66s;}
.mark.draws .mark-fly{animation:mark-fly .95s 1.3s cubic-bezier(.2,.7,.2,1) both;}
@keyframes mark-draw{from{stroke-dashoffset:100;} to{stroke-dashoffset:0;}}
@keyframes mark-show{from{opacity:0;}}
@keyframes mark-fly{from{opacity:0; transform:translate(-20px,13px);}}
@keyframes mark-beat{0%,56%,100%{transform:scale(1);} 14%{transform:scale(1.07);} 28%{transform:scale(1);} 42%{transform:scale(1.045);}}
@keyframes mark-beat-again{0%,56%,100%{transform:scale(1);} 14%{transform:scale(1.07);} 28%{transform:scale(1);} 42%{transform:scale(1.045);}}
h1.name em{font-family:"Spectral",serif; font-style:italic; font-weight:300; font-size:.74em; letter-spacing:0; color:var(--ink2); padding:0 .1em;}
h1{
  font-family:"Spectral SC"; font-weight:500; font-size:52px; letter-spacing:.04em;
  text-align:center; margin:0 0 12px; line-height:1.1;
}
.mastrule{display:flex; align-items:center; gap:14px; max-width:380px; margin:0 auto 16px;}
.mastrule .ln{flex:1; height:1px; background:var(--rule);}
.mastrule .gl{color:var(--swift); font-size:16px; line-height:1;}
.sub{font-style:italic; font-weight:300; color:var(--ink2); text-align:center; max-width:600px; margin:0 auto;}
h2{
  font-family:"Spectral SC"; font-weight:500; font-size:25px; letter-spacing:.04em;
  margin:52px 0 12px; line-height:1.25;
}
h3{font-family:"Spectral SC"; font-weight:500; font-size:20px; letter-spacing:.03em; margin:0 0 8px; line-height:1.3;}
.label{
  font-family:"Spectral SC"; font-weight:500; font-size:11.5px; letter-spacing:.24em;
  color:var(--swiftsoft); margin:20px 0 6px; display:block;
}
.dim{color:var(--ink2);}

/* ---------- today banner & counters ---------- */
.today{
  margin:34px 0 0; border:1.6px solid var(--swift); padding:16px 20px; background:rgba(240,81,56,.06);
}
.today .label{margin-top:0;}
.today p{margin:0;}
.glance{display:grid; grid-template-columns:1.3fr .7fr; gap:30px; margin-top:34px; align-items:start;}
.gtable{width:100%; border-collapse:collapse;}
.gtable td{padding:8px 0; border-bottom:1px solid var(--rule); vertical-align:top;}
.gtable tr:last-child td{border-bottom:none;}
.gtable .k{font-family:"Spectral SC"; font-weight:500; font-size:12px; letter-spacing:.2em; color:var(--ink2); width:150px; padding-right:14px;}
.gtable .v{font-weight:300;}
.counters{display:flex; flex-direction:column; gap:18px; align-items:center;}
.stamp{
  border:2.5px solid var(--swift); outline:1px solid var(--swift); outline-offset:3px;
  color:var(--swift); padding:12px 22px; text-align:center; background:rgba(240,81,56,.05);
}
.stamp .k{font-family:"Spectral SC"; font-weight:500; font-size:11px; letter-spacing:.26em;}
.stamp .v{font-family:"Spectral SC"; font-weight:600; font-size:25px; letter-spacing:.1em; margin-top:2px;}
.how{margin-top:30px; padding:0; counter-reset:how;}
.how li{list-style:none; counter-increment:how; position:relative; padding:0 0 10px 34px; font-weight:300;}
.how li::before{
  content:counter(how); position:absolute; left:0; top:1px; width:22px; height:22px; border:1px solid var(--swift);
  color:var(--swift); border-radius:50%; text-align:center; font-family:"Spectral SC"; font-size:13px; line-height:20px;
}

/* ---------- parts & the calendar ---------- */
.part{margin-top:70px;}
.part-head{display:flex; align-items:center; gap:14px;}
.part-head .ln{flex:1; height:1px; background:var(--rule);}
.part-head .glyph{color:var(--swift); font-size:14px;}
.part-head h2{margin:0; text-align:center; font-size:23px;}
.part-no{
  font-family:"Spectral SC"; font-weight:500; font-size:11.5px; letter-spacing:.3em; text-indent:.3em;
  color:var(--ink2); text-align:center; margin:0 0 4px;
}
.part-intro{max-width:640px; margin:10px auto 0; text-align:center; font-style:italic; font-weight:300; color:var(--ink2);}
.part-meta{max-width:640px; margin:14px auto 0; font-size:15px; font-weight:300;}
.part-meta p{margin:0 0 4px;}
.part-meta .label{display:inline; margin:0 6px 0 0;}
.days{margin-top:22px; border-top:1px solid var(--rule);}
.day{
  display:grid; grid-template-columns:118px 1fr auto; gap:18px; padding:16px 0;
  border-bottom:1px solid var(--rule); align-items:start;
}
/* the lesson's row, come back to from its page (swiftui-quest.html#lesson-18) */
.day:target{margin:0 -14px; padding:16px 14px; background:rgba(240,81,56,.07); box-shadow:inset 2px 0 0 var(--swift);}
.day .when{font-family:"Spectral SC"; font-weight:500; font-size:12.5px; letter-spacing:.14em; line-height:1.6;}
.day .when .date{color:var(--swiftsoft); display:block;}
.day .when .dn{color:var(--ink2); display:block;}
.day .what h3{font-size:18px; margin:0 0 3px;}
.day .what h3 a{color:var(--ink); border-bottom-color:transparent;}
.day .what h3 a:hover{border-bottom-color:var(--ink2);}
.day .what p{margin:0 0 3px; font-weight:300; font-size:15.5px; color:var(--ink2);}
.day .what .extra{font-size:14px; color:var(--swiftsoft); font-style:italic;}
.day .act{display:flex; flex-direction:column; gap:7px; align-items:flex-end; min-width:132px;}
.badge{
  font-family:"Spectral SC"; font-weight:500; font-size:10.5px; letter-spacing:.2em;
  border:1px solid var(--rule); color:var(--ink2); padding:2px 8px; white-space:nowrap;
}
.badge.tutorial{border-color:var(--swift); color:var(--swift);}
a.badge{padding:5px 12px; font-size:11.5px; letter-spacing:.18em; cursor:pointer; transition:background .12s, color .12s, border-color .12s;}
a.badge:hover{border-color:var(--ink2); color:var(--ink);}
a.badge.tutorial:hover{background:var(--swift); border-color:var(--swift); color:var(--paper);}
.day.is-today{background:rgba(240,81,56,.07); box-shadow:-10px 0 0 rgba(240,81,56,.07), 10px 0 0 rgba(240,81,56,.07);}
.day.is-today .when .dn::after{content:" · today"; color:var(--swift);}
.day.is-late .when .date{color:var(--ink2);}
.day.is-done .what h3 a{color:var(--ink2);}

button.toggle{
  background:none; cursor:pointer; color:var(--ink2); border:1px solid var(--rule); padding:5px 12px;
  font-family:"Spectral SC"; font-weight:500; font-size:11.5px; letter-spacing:.18em; white-space:nowrap;
}
button.toggle:hover{border-color:var(--ink2);}
button.toggle .on{display:none;}
button.toggle[aria-pressed="true"]{border-color:var(--swift); color:var(--swift);}
button.toggle[aria-pressed="true"] .on{display:inline;}
button.toggle[aria-pressed="true"] .off{display:none;}

/* ---------- figures ---------- */
figure.plate{margin:34px 0 8px;}
.plateframe{border:1.6px solid var(--ink); padding:7px; background:var(--panel);}
.plateframe .in{border:.6px solid rgba(233,230,223,.55);}
.plateframe svg{display:block; width:100%; height:auto;}
figcaption{font-family:"Spectral SC"; font-weight:500; font-size:13px; letter-spacing:.12em; text-align:center; margin-top:12px; color:var(--ink2);}

/* ---------- day pages ---------- */
.crumbs{font-family:"Spectral SC"; font-weight:500; font-size:12px; letter-spacing:.18em; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap;}
.crumbs a{border-bottom:none; color:var(--ink2);}
.crumbs a:hover{color:var(--swiftsoft);}
.dayhead{margin:38px 0 0; text-align:center;}
.dayhead .kicker{margin-bottom:10px;}
.dayhead h1{font-size:40px;}
.dayhead .sub{max-width:640px;}

/* The compact bar that sticks to the top once the title tile has scrolled away (quest.js reveals it): the day as a
   small pill, the title as a running head in the text face (its code chips as in a sentence), the lesson as a label. */
.daybar{
  position:fixed; top:0; left:0; right:0; z-index:4;
  background:rgba(27,28,32,.97); border-bottom:1px solid rgba(233,230,223,.12);
  box-shadow:0 14px 30px -18px rgba(0,0,0,.9);
  transform:translateY(-101%); opacity:0; pointer-events:none; visibility:hidden;
  transition:transform .34s cubic-bezier(.22,.61,.36,1), opacity .24s ease, visibility 0s linear .34s;
}
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .daybar{background:rgba(24,25,29,.88); backdrop-filter:blur(18px) saturate(1.25); -webkit-backdrop-filter:blur(18px) saturate(1.25);}
}
.daybar.show{
  transform:none; opacity:1; pointer-events:auto; visibility:visible;
  transition:transform .34s cubic-bezier(.22,.61,.36,1), opacity .24s ease, visibility 0s;
}
.daybar-in{
  display:flex; align-items:center; gap:8px; min-width:0; height:48px;
  max-width:920px; margin:0 auto; padding:0 34px;
}
.db-top{display:flex; align-items:center; gap:14px; flex:1 1 auto; min-width:0; height:100%; border-bottom:none; color:var(--ink);}
.db-top:hover{color:var(--ink);}
.db-top:hover .db-title{color:var(--swiftsoft);}
/* an icon that is a link: back to all the lessons, on to the next one */
.db-icon{
  flex:none; display:grid; place-items:center; width:32px; height:32px; border:none; border-radius:6px; color:var(--ink2);
  transition:color .15s ease, background .15s ease;
}
.crumbs a.db-icon{color:var(--ink2);}
.db-icon:hover, .crumbs a.db-icon:hover, .db-icon:focus-visible{color:var(--swiftsoft); background:rgba(233,230,223,.08);}
.daybar-in > .db-icon:first-child{margin-left:-6px;}      /* the icon's own edge, not its button's, on the column's edge */
.crumb-right{display:inline-flex; align-items:center; gap:8px; min-width:0;}
.crumb-right .db-icon{margin:-8px -6px -8px 0;}
.db-day{
  font-family:"Spectral SC"; font-weight:600; font-size:11px; letter-spacing:.2em; text-indent:.2em; line-height:1;
  color:var(--swift); white-space:nowrap; flex:none;
  padding:5px 10px 4px; border:1px solid rgba(240,81,56,.55); border-radius:999px;
}
.db-sep{display:none;}
.db-title{
  font-family:"Spectral",serif; font-weight:500; font-size:16.5px; letter-spacing:0; line-height:1.3;
  flex:1 1 auto; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  transition:color .2s ease;
}
.db-title code{font-size:.84em; background:rgba(233,230,223,.09); padding:1px 6px; border-radius:4px; color:inherit; letter-spacing:0;}
.db-lesson{
  flex:none; max-width:44%; font-family:"Spectral SC"; font-weight:500; font-size:11.5px; letter-spacing:.14em;
  color:var(--ink2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.framed .daybar-in{padding-right:96px;}
@media(max-width:620px){
  .daybar-in{gap:4px; height:42px; padding:0 12px;}
  .db-top{gap:10px;}
  .daybar-in > .db-icon:first-child{margin-left:0;}
  .db-day{font-size:10px; padding:4px 8px 3px;}
  .db-title{font-size:15px;}
  .db-lesson{display:none;}       /* on a phone the day and title keep the bar uncluttered */
  .framed .daybar-in{padding-right:50px;}
}
.intro{border:1px solid var(--rule); background:var(--panel); padding:20px 24px; margin:34px 0 0;}
.intro p{margin:0 0 8px; font-weight:300;}
.intro p:last-child{margin-bottom:0;}
.intro .label{display:inline; margin:0 8px 0 0;}
.lesson{margin-top:50px;}
.lesson > .lno{font-family:"Spectral SC"; font-weight:500; font-size:11.5px; letter-spacing:.28em; color:var(--ink2); margin:0 0 2px;}
.lesson > h2{margin:0 0 14px;}
.lesson p, .step p{font-weight:300;}
ol.questions, ul.built, ul.reslist{margin:0 0 14px; padding-left:22px; font-weight:300;}
ol.questions li, ul.built li, ul.reslist li{margin-bottom:6px;}
.notice{border-left:2px solid var(--swift); padding:6px 0 6px 16px; margin:30px 0 0; color:var(--ink2); font-style:italic; font-weight:300;}

/* tutorial steps */
.step{margin-top:54px;}
.step > .sno{font-family:"Spectral SC"; font-weight:500; font-size:11.5px; letter-spacing:.28em; color:var(--swift); margin:0 0 2px;}
.step > h2{margin:0 0 14px;}
.where{
  font-family:"Spectral SC"; font-weight:500; font-size:11px; letter-spacing:.2em; color:var(--ink2);
  margin:16px 0 0; padding:6px 12px; background:var(--panel); border:1px solid var(--rule); border-bottom:none; display:inline-block;
}
.where code{font-size:12px; background:none; padding:0; color:var(--ink); letter-spacing:0;}
/* a change in Build Settings: the name and value Xcode shows, then the key it writes to the project */
p.setting{
  margin:14px 0 18px; padding:10px 14px; background:var(--panel); border:1px solid var(--rule); border-left:3px solid var(--swift);
  line-height:1.5; overflow-wrap:anywhere;
}
p.setting code{display:block; margin-top:4px; font-size:12.5px; background:none; padding:0; color:var(--ink2);}
pre.code{
  font-family:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace; font-size:13px; line-height:1.6;
  background:var(--codebg); border:1px solid var(--rule); padding:14px 16px; margin:0 0 16px;
  overflow-x:auto; color:#dcd9d1; tab-size:4; max-width:100%;
}
pre.code code{font-family:inherit; font-size:inherit; background:none; padding:0; border-radius:0;}
/* Xcode's Default (Dark) theme, its own values (SourceEditor.framework's "Default (Dark).xccolortheme"): the
   background, plain text (white at 85%), and the classes build.py's swift_colors gives each token */
pre.code{background:#1F1F24; color:rgba(255,255,255,.85); font-weight:500;}
pre.code .k{color:#FC5FA3; font-weight:700;}   /* keyword */
pre.code .s{color:#FC6A5D;}                     /* string */
pre.code .n{color:#D0BF69;}                     /* number */
pre.code .c{color:#6C7986;}                     /* comment */
pre.code .at{color:#BF8555;}                    /* attribute: @State, @MainActor */
pre.code .p{color:#FD8F3F;}                     /* macro, #if */
pre.code .dt{color:#5DD8FF;}                    /* the name a type declaration introduces */
pre.code .dd{color:#41A1C0;}                    /* the name a function or property declaration introduces */
pre.code .t{color:#9EF1DD;}                     /* a type of the project */
pre.code .f{color:#67B7A4;}                     /* a function, property or case of the project */
pre.code .ts{color:#D0A8FF;}                    /* a type of the SDK */
pre.code .fs{color:#A167E6;}                    /* a function, property or case of the SDK */
pre.sh{border-left:3px solid var(--swift);}
pre.sil{font-size:12px; line-height:1.55; border-left:3px solid #85827a; color:#c9c6be;}
pre.sil .c{color:#f0ede6; font-style:italic;}
pre.sil b{color:#f0ede6; font-weight:600;}
ul.said{padding-left:20px; margin:0 0 18px;}
ul.said li{margin:0 0 6px;}
ul.said code{color:#f6b4a8;}
pre.out{background:#101114; border-color:rgba(240,81,56,.4); color:#f0ede6; margin-top:0;}
pre.err{background:#1d1314; border-color:rgba(240,81,56,.6); color:#f6b4a8; white-space:pre-wrap; margin-top:0;}
/* a change to code the reader has already typed (build.py's changed()): by default the new code with the lines it
   replaces marked − and the lines it adds marked +, as Xcode's source control shows a change; or the code as it is */
.change{margin:16px 0 0;}
/* wrap-reverse: on a narrow page the buttons go above the top section, which stays on its code */
.change .where-bar{display:flex; align-items:flex-start; justify-content:space-between; gap:6px 12px; flex-wrap:wrap-reverse;}
.change .where{margin-top:0; max-width:100%;}
/* a new file says so in color, in its top section (build.py's where()) */
.where .newfile{
  display:inline-block; margin-right:9px; padding:1px 8px 1px 9px; border:1px solid rgba(240,81,56,.55); border-radius:999px;
  color:var(--swift); font-weight:600; font-size:10.5px; letter-spacing:.2em; line-height:1.3; white-space:nowrap;
}
/* In a lesson's steps a file's top section stays in view under the lesson's bar while its code scrolls past. The padding
   keeps the buttons clear of the harp, which hangs a little below the bar; the margin keeps the block where it was. */
.daybar ~ .step .change > .where-bar{
  position:sticky; top:49px; z-index:2; padding-top:4px; margin-top:-4px; background:var(--paper); box-shadow:0 1px 0 var(--rule);
}
/* On a phone, where the bar is 42 high (.daybar-in), only the file's name stays: its buttons scroll away with the top of
   the code, so that the code keeps the screen. */
@media(max-width:620px){
  .daybar ~ .step .change:not(.bare){display:flex; flex-direction:column;}
  .daybar ~ .step .change > .where-bar{display:contents;}
  .daybar ~ .step .change > .where-bar > .chg-tools{order:-1; align-self:flex-end; margin-left:0;}
  .daybar ~ .step .change > .where-bar > .where{display:block; position:sticky; top:43px; z-index:2; box-shadow:0 1px 0 var(--rule);}
}
/* code with no top section (a flash card's, an edge case's): its Copy button sits in the block's corner */
.change.bare{margin:0; position:relative;}
.change.bare > .chg-tools{position:absolute; top:7px; right:7px; margin:0; padding:0; z-index:1;}
.change.bare > .chg-tools button{background:#2A2B31;}
.chg-tools{display:flex; gap:6px; padding:0 0 6px; margin-left:auto;}
.chg-tools button{
  font-family:"Spectral SC"; font-weight:500; font-size:11px; letter-spacing:.16em; color:var(--ink2);
  background:var(--panel); border:1px solid var(--rule); border-radius:3px; padding:4px 10px; cursor:pointer; line-height:1.4;
}
.chg-tools button:hover, .chg-tools button:focus-visible{color:var(--ink); border-color:var(--ink2);}
.chg-tools button.is-done{color:var(--swiftsoft); border-color:var(--swiftsoft);}
.change[data-view="diff"] > pre.code:not(.diff){display:none;}
.change[data-view="plain"] > pre.diff{display:none;}
pre.diff > code > *{display:block; margin:0 -16px; padding:0 16px 0 9px; border-left:3px solid transparent; text-decoration:none;}
pre.diff > code > *::before{content:"\00a0"; display:inline-block; width:1.4em; color:var(--ink2);}
pre.diff ins{background:rgba(72,139,245,.16); border-left-color:#4f8ef0; color:#e9e6df;}
pre.diff ins::before{content:"+"; color:#8fb8ff;}
pre.diff del{background:rgba(240,81,56,.14); border-left-color:var(--swift); color:#b3aea4;}
pre.diff del::before{content:"−"; color:var(--swiftsoft);}
pre.diff del span{opacity:.7;}   /* a removed line keeps its colors, dimmed like its text */
.outlabel{
  font-family:"Spectral SC"; font-weight:500; font-size:11px; letter-spacing:.2em; color:var(--swiftsoft);
  margin:0; padding:6px 0 5px;
}
/* numbered things to do in Xcode */
ol.ui{margin:18px 0 20px; padding:0; counter-reset:ui; list-style:none;}
ol.ui > li{counter-increment:ui; position:relative; padding:0 0 2px 40px; margin:0 0 12px; min-width:0;}
ol.ui > li::before{
  content:counter(ui); position:absolute; left:0; top:2px; width:25px; height:25px; border:1px solid var(--swift);
  color:var(--swift); border-radius:50%; text-align:center; font-family:"Spectral SC"; font-size:13.5px; line-height:23px;
}
ol.ui > li > p{margin:0 0 10px;}
ol.ui > li > :last-child{margin-bottom:0;}
/* an example of Xcode's console: real output, in a small window */
.console{border:1px solid rgba(233,230,223,.24); background:#0e0f12; border-radius:8px; overflow:hidden; margin:0 0 16px; max-width:100%;}
.console-bar{display:flex; align-items:center; gap:10px; padding:7px 11px; background:#25262d; border-bottom:1px solid var(--rule);}
.console .lights{display:flex; gap:5px;}
.console .lights i{display:block; width:9px; height:9px; border-radius:50%; background:rgba(233,230,223,.24);}
.console-title{font-family:"Spectral SC"; font-weight:500; font-size:10.5px; letter-spacing:.26em; color:var(--ink2);}
pre.console-out{
  font-family:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace; font-size:13px; line-height:1.55;
  margin:0; padding:12px 14px 13px; color:#f0ede6; white-space:pre-wrap; overflow-wrap:anywhere; tab-size:4;
}
pre.console-out code{font-family:inherit; font-size:inherit; background:none; padding:0; border-radius:0;}
.console .exit{color:#7f7d76;}
/* a screenshot of the app, from a real run in the simulator */
figure.shot{margin:20px 0 24px; text-align:center;}
figure.shot img{
  display:block; margin:0 auto; width:250px; max-width:64%; height:auto; background:#fff;
  border:6px solid #050506; border-radius:34px; outline:1px solid rgba(233,230,223,.3);
}
figure.shot figcaption{letter-spacing:.1em;}
figure.shot .device{display:block; font-size:10.5px; letter-spacing:.22em; margin-top:3px; opacity:.75;}
/* a screenshot of Xcode itself: a window, or (narrow) a sheet at its own size */
figure.xshot{margin:20px 0 24px; text-align:center;}
figure.xshot img{display:block; margin:0 auto; width:100%; max-width:100%; height:auto; border-radius:10px;
  outline:1px solid rgba(233,230,223,.22);}
figure.xshot figcaption{letter-spacing:.1em;}
figure.xshot .device{display:block; font-size:10.5px; letter-spacing:.22em; margin-top:3px; opacity:.75;}
/* something folded away until wanted */
details.fold{border:1px solid var(--rule); background:var(--panel); margin:0 0 12px; min-width:0;}
details.fold summary{cursor:pointer; list-style:none; padding:9px 14px; font-weight:300; color:var(--ink2); font-size:15px;}
details.fold summary::-webkit-details-marker{display:none;}
details.fold summary::before{content:"▸\00a0\00a0"; color:var(--swift);}
details.fold[open] summary::before{content:"▾\00a0\00a0";}
details.fold pre.code{margin:0; border-width:1px 0 0 0;}
.note{border:1px solid var(--rule); background:var(--panel); padding:16px 20px; margin:18px 0;}
/* a talk the day counts as critical viewing: ('watch', link key, why) */
.note.watch{border:1px solid var(--swift); border-left-width:5px;}
.note.watch .label{color:var(--swiftsoft);}
.note.watch .watch-talk{font-size:19px; margin:4px 0 8px;}
/* a diagram on a day page: ('figure', svg, caption) */
.diagram{margin:22px 0; overflow-x:auto;}    /* on a phone the diagram keeps a size its words can be read at, and scrolls sideways */
.diagram svg{display:block; width:100%; min-width:620px; height:auto;}
.diagram figcaption{font-family:"Spectral",serif; font-weight:400; font-size:15px; letter-spacing:0; text-align:left;
  color:var(--ink2); margin-top:10px; max-width:620px;}
.note .label{margin-top:0;}
.note p{margin:0;}
.note p + p{margin-top:10px;}    /* a note of several paragraphs: a blank line in its text */
.note + pre.code, .note + .where, .note + .change{margin-top:0;}
table.map{width:100%; border-collapse:collapse; margin:0 0 16px; font-weight:300;}
table.map td, table.map th{padding:7px 10px 7px 0; border-bottom:1px solid var(--rule); text-align:left; vertical-align:top;}
table.map th{font-family:"Spectral SC"; font-weight:500; font-size:12px; letter-spacing:.2em; color:var(--ink2);}
/* a table of code beside code must still fit a phone: the columns have fixed shares of the width
   (equal, unless the table gives its own), and a long name may break inside its cell */
table.map{table-layout:fixed;}
table.map td, table.map th{overflow-wrap:break-word;}
table.map code{white-space:normal; overflow-wrap:anywhere;}
table.map .tdlabel{display:none;}   /* a column's heading, repeated in each cell of a .stack table: shown only on a phone */

/* ---------- flash cards ---------- */
.cards-head{display:flex; align-items:baseline; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:60px;}
.cards-head h2{margin:0;}
.cards-tools{display:flex; gap:8px; flex-wrap:wrap;}
.cards-intro{font-weight:300; color:var(--ink2); margin:8px 0 18px;}
.pile{display:grid; grid-template-columns:1fr 1fr; gap:14px; align-items:start; grid-auto-flow:row dense;}
details.card{border:1px solid var(--rule); background:var(--panel); min-width:0;}
details.card[open]{grid-column:1 / -1; border-color:rgba(240,81,56,.55);}
details.card summary{cursor:pointer; list-style:none; padding:14px 16px 16px; display:block;}
details.card summary::-webkit-details-marker{display:none;}
details.card .tag{
  display:block; font-family:"Spectral SC"; font-weight:500; font-size:10.5px; letter-spacing:.2em;
  color:var(--ink2); margin-bottom:6px;
}
details.card.trick .tag{color:var(--swift);}
details.card .front{display:block; font-size:16.5px;}
details.card summary::after{
  content:"tap to show"; display:block; margin-top:9px; font-family:"Spectral SC"; font-size:10.5px;
  letter-spacing:.2em; color:var(--ink2);
}
details.card[open] summary::after{content:"tap to hide";}
details.card .back{padding:0 16px 14px; border-top:1px solid var(--rule); margin-top:0; padding-top:14px;}
details.card .back p{font-weight:300; margin:0 0 10px;}
details.card .back p:last-child{margin-bottom:0;}

/* ---------- edge cases and tricky questions ---------- */
.edges-head{margin-top:64px;}
.edges-head h2{margin:0;}
h3.edge-lesson{margin:34px 0 0; font-size:18px; color:var(--ink2);}
section.edge{border-top:1px solid var(--rule); padding:22px 0 10px; min-width:0;}
section.edge:first-child{border-top:none; padding-top:10px;}
.edge-no{font-family:"Spectral SC"; font-weight:500; font-size:11px; letter-spacing:.24em; color:var(--swift); margin:0 0 6px;}
.edge-q{font-size:18.5px; line-height:1.5; margin:0 0 14px;}
section.edge details.seal{border-top:none; margin-top:2px; padding-top:0;}
section.edge details.seal p{font-weight:300;}
section.edge .src{font-size:14.5px; color:var(--ink2); margin:12px 0 4px;}
.pictures{display:flex; gap:12px; flex-wrap:wrap; margin:14px 0 18px;}
.pictures a{flex:1 1 28%; min-width:92px; text-align:center; text-decoration:none; font-size:13px; letter-spacing:.04em;}
.pictures img{display:block; width:100%; height:auto; border-radius:6px; border:1px solid var(--rule); margin-bottom:5px;}
.pictures span{border-bottom:1px solid currentColor;}
.screens{display:flex; flex-wrap:wrap; justify-content:center; gap:4px 22px; margin:6px 0 10px;}
.screens figure.shot.small{flex:0 1 232px; margin:10px 0 12px;}
figure.shot.small{margin:14px 0 16px;}
figure.shot.small img{width:210px; border-width:5px; border-radius:30px;}

/* ---------- interview problem ---------- */
.exam{margin:60px 0 12px; border:1.6px solid var(--ink); padding:7px; background:var(--panel); position:relative;}
.exam .in{border:.6px solid rgba(233,230,223,.55); padding:28px 26px 22px; min-width:0;}
.exam-kind{
  position:absolute; top:-14px; left:22px; transform:rotate(-2deg); background:var(--paper);
  border:2px solid var(--swift); outline:1px solid var(--swift); outline-offset:2px; color:var(--swift);
  font-family:"Spectral SC"; font-weight:600; font-size:11.5px; letter-spacing:.22em; padding:4px 13px;
}
.exam-no{font-family:"Spectral SC"; font-weight:500; font-size:11.5px; letter-spacing:.26em; color:var(--ink2); text-align:right; margin:0 0 4px;}
.exam h2{margin:0 0 9px; font-size:22px;}
.exam .ask{font-weight:300; font-style:italic; margin:0 0 14px;}
.exam .src{font-size:14.5px; color:var(--ink2); font-weight:300; margin:0 0 6px;}
details.seal{border-top:1px solid var(--rule); margin-top:14px; padding-top:13px;}
details.seal summary{cursor:pointer; list-style:none; font-family:"Spectral SC"; font-weight:500; font-size:12.5px; letter-spacing:.22em; color:var(--swift);}
details.seal summary::-webkit-details-marker{display:none;}
details.seal summary::before{content:"✦ \00a0";}
details.seal[open] summary{margin-bottom:14px;}
details.seal p{font-weight:300;}
.listen{color:var(--ink2);}
.exam button.toggle{margin-top:10px;}

/* ---------- footer nav ---------- */
.daynav{display:flex; justify-content:space-between; gap:14px; margin-top:70px; padding-top:20px; border-top:1px solid var(--rule); flex-wrap:wrap;}
.daynav a{border-bottom:none; max-width:46%;}
.daynav .dir{display:block; font-family:"Spectral SC"; font-weight:500; font-size:11px; letter-spacing:.24em; color:var(--ink2);}
.daynav .next{text-align:right; margin-left:auto;}
.donebar{margin-top:44px; text-align:center;}
.colophon{margin-top:80px; text-align:center; font-style:italic; font-weight:300; color:var(--ink2); font-size:14.5px;}

/* ---------- mobile ---------- */
@media(max-width:700px){
  body{font-size:16px;}
  .sheet{padding:40px 18px 70px;}
  h1{font-size:36px;}
  .dayhead h1{font-size:29px;}
  h2{font-size:21px;}
  .part-head h2{font-size:18px;}
  .glance{grid-template-columns:1fr;}
  .counters{flex-direction:row; flex-wrap:wrap; justify-content:flex-start;}
  .gtable .k{width:104px;}
  .day{grid-template-columns:1fr; gap:6px;}
  .day .when .date, .day .when .dn{display:inline;}
  .day .when .dn::before{content:" · ";}
  .day .act{flex-direction:row; align-items:center; justify-content:flex-start; min-width:0; margin-top:4px;}
  .pile{grid-template-columns:1fr;}
  .exam .in{padding:24px 14px 16px;}
  .exam-kind{left:12px;}
  pre.code{font-size:12px; padding:12px;}
  pre.diff > code > *{margin:0 -12px; padding:0 12px 0 6px;}
  pre.console-out{font-size:12px; padding:11px 12px;}
  table.map.stack, table.map.stack tbody, table.map.stack tr, table.map.stack td{display:block; width:100%; box-sizing:border-box;}
  table.map.stack colgroup, table.map.stack tr:first-child{display:none;}
  table.map.stack td{padding:0 0 12px; border-bottom:0;}
  table.map.stack td:first-child{padding:14px 0 8px; border-top:1px solid var(--rule); font-weight:500; font-size:18px;}
  table.map.stack td code{overflow-wrap:anywhere;}
  table.map.stack .tdlabel{display:block; font-family:"Spectral SC"; font-weight:500; font-size:11px; letter-spacing:.2em; color:var(--ink2); margin:0 0 3px;}
  table.map.stack .tdlabel code{font-size:11px; letter-spacing:0; background:none; padding:0;}
  .edge-q{font-size:17px;}
  ol.ui > li{padding-left:34px;}
  ol.ui > li::before{width:23px; height:23px; line-height:21px; font-size:12.5px;}
  .intro{padding:16px;}
  .daynav a{max-width:100%;}
}

/* guides: the calendar's carousel under the header, the pull-out card on a day page, and the guides page
   (course/guide_art.py draws the pictures; build.py's guides_section, guide_card and guides_page) */
.guides{margin-top:48px;}
.gcar{display:flex; gap:14px; overflow-x:auto; scroll-snap-type:x mandatory; padding:18px 2px 14px; margin:0 -2px;
 scrollbar-width:thin; scrollbar-color:rgba(233,230,223,.25) transparent;}
.gcard{flex:0 0 272px; scroll-snap-align:start; display:flex; flex-direction:column; background:var(--panel);
 border:1px solid var(--rule); border-top:3px solid var(--swift); color:var(--ink); transition:border-color .12s, background .12s;}
.gcard:hover{border-color:var(--ink2); border-top-color:var(--swiftsoft); background:#282930;}
.gcard.all{border-top-color:var(--ink2);}
.gart{display:block; width:100%; height:auto;}
.gcard .gart{border-bottom:1px solid var(--rule);}
.gcard .gbody{display:flex; flex-direction:column; gap:4px; padding:12px 14px 14px; flex:1;}
.gpk{font-family:"Spectral SC"; font-weight:500; font-size:10.5px; letter-spacing:.22em; color:var(--swift);}
.gcard b{font-family:"Spectral SC"; font-weight:500; font-size:18px; letter-spacing:.03em; line-height:1.2;}
.gcard em{font-weight:300; font-style:italic; font-size:14px; line-height:1.4; color:var(--ink2); flex:1;}
.gcard em code, .gpull em code{font-style:normal; font-size:.86em;}
.gpa{font-family:"Spectral SC"; font-weight:500; font-size:11px; letter-spacing:.18em; color:var(--swiftsoft); white-space:nowrap;}
.gcard .gpa{margin-top:6px;}
.gpull{display:grid; grid-template-columns:140px 1fr auto; gap:4px 20px; align-items:center; padding:14px 18px; margin:18px 0 22px;
 background:var(--panel); border:1px solid var(--rule); border-left:3px solid var(--swift); color:var(--ink); transition:border-color .12s, background .12s;}
.gpull:hover{border-color:var(--ink2); border-left-color:var(--swiftsoft); background:#282930;}
.gpull .gart{grid-column:1; grid-row:1 / span 3; border:1px solid var(--rule); border-radius:4px;}
.gpull .gpk, .gpull b, .gpull em{grid-column:2;}
.gpull b{font-family:"Spectral SC"; font-weight:500; font-size:20px; letter-spacing:.04em; line-height:1.2;}
.gpull em{font-weight:300; font-style:italic; font-size:15.5px; line-height:1.45; color:var(--ink2);}
.gpull .gpa{grid-column:3; grid-row:1 / span 3;}
@media (max-width:600px){
 .gpull{grid-template-columns:1fr;}
 .gpull .gart, .gpull .gpk, .gpull b, .gpull em, .gpull .gpa{grid-column:1; grid-row:auto;}
 .gpull .gpa{margin-top:6px;}
}
.guidelist{margin-top:34px;}
.guiderow{display:grid; grid-template-columns:200px 1fr; gap:22px; align-items:start; padding:24px 0; border-top:1px solid var(--rule);}
.guiderow:last-child{border-bottom:1px solid var(--rule);}
.guiderow .gart{border:1px solid var(--rule); border-radius:4px;}
.guiderow h2{margin:4px 0 8px; font-size:24px; text-align:left;}
.guiderow h2 a{color:var(--ink); border-bottom-color:transparent;}
.guiderow h2 a:hover{border-bottom-color:var(--ink2);}
.guiderow .sub{text-align:left; margin:0 0 8px; max-width:none;}
.guiderow .sections{margin:10px 0 14px; padding:0; list-style:none; columns:2; column-gap:26px; font-size:14.5px;}
.guiderow .sections li{break-inside:avoid; margin:0 0 5px; color:var(--ink2);}
.guiderow .sections li a{color:var(--ink);}
@media (max-width:640px){.guiderow{grid-template-columns:1fr;} .guiderow .sections{columns:1;}}
